I either found a bug or I'm going crazy.

Get help using Construct 2

Post » Mon Jun 29, 2015 9:49 pm

So I've got a little frogger clone I'm building. Everything was going great until I got to the logs bit. The frog is supposed to ride on the logs smoothly while in all other instances he moves on a grid. So, I've had a *lot* of trouble getting this to work and I've got the problem nailed down to this.
When I set bullet.speed of the player to a negative value it appears to invert the previous value.
Example: On X pressed Set bullet speed to -200
Each time you hit X the object reverses his direction.

Here is my capx file:
So I've got a little frogger clone I'm building. Everything was going great until I got to the logs bit. The frog is supposed to ride on the logs smoothly while in all other instances he moves on a grid. So, I've had a *lot* of trouble getting this to work and I've got the problem nailed down to this.
When I set bullet.speed of the player to a negative value it appears to invert the previous value.
Example: On X pressed Set bullet speed to -200
Each time you hit X the object reverses his direction.

Here is my capx file:

drive.google[DOT]com/file/d/0BwDq5BPaWAXyR0FsVzdTODlFbEk/view?usp=sharing
Event 47 and 48 are where I'm setting the speed of the player.

Image

I really appreicate any help guys I feel like I'm going nuts.
B
4
Posts: 5
Reputation: 210

Post » Mon Jun 29, 2015 10:11 pm

Why are you even using a bullet instead of a normal movement?
Just do On z pressed set x to self.x +2
and On x pressed set x to self.x -2
Replace 2 with whatever value you want.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Mon Jun 29, 2015 10:13 pm

That would only work if you were to use the expression bullet.speed
Speed is alway a positive number, so it thinks -200 is to go backwards... at 200 pixels per second.
If you want it to stop, set it to 0, or disable the behavior.
The key is experimentation.
Image ImageImage
B
168
S
50
G
169
Posts: 8,280
Reputation: 108,189

Post » Mon Jun 29, 2015 10:25 pm

@Vikings
I'm using bullet because my normal movement is grid based, so I have a different set up for that. When the player is on a log I want the movement to be smooth so I'm using bullet.

@newt
My problem is that this: I set bullet to -200 and my player moves to the left. I set it to -200 again and it starts moving the other way. I'm just setting the value to -200 two different times but I get different results!

If anyone could download the project and see if they could replicate the situation locally I would really appreciate it.
B
4
Posts: 5
Reputation: 210

Post » Mon Jun 29, 2015 10:47 pm

I'd pin the frog to the log, then unpin on jump. Then you don't have to worry about the frog movement.
ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336

Post » Mon Jun 29, 2015 10:52 pm

@blackhornet

That's a really good idea I'll try it out and let you know.
B
4
Posts: 5
Reputation: 210

Post » Tue Jun 30, 2015 12:09 am

did you set the angle of motion for the bullet behavior?
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,597
Reputation: 34,821

Post » Tue Jun 30, 2015 12:16 am

@blackhornet
Pin didn't work, it only grabs me when I get to the edge of the log.

@shinkan
Nope, I tried turning it on, it didn't change anything.

Thanks for all the help so far I do think that there is a bug with construct so I went ahead and filed a bug report here:
scirra[DOT]com/forum/setting-bullet-speed-to-a-negative-value-inverts-the-result_t149146
B
4
Posts: 5
Reputation: 210

Post » Tue Jun 30, 2015 2:03 am

blackhornettechnologies.com/Construct2Stuff/Frogger4_BHT.capx
ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336

Post » Tue Jun 30, 2015 5:39 am

why u using speed to change angle of motion which bullet behavior has.... on x pressed set angle of motion to 0 on z pressed set angle of motion to 180 that way only the movement direction will change.. and not the actor angle if you have the set angle deselected... its not a bug ... its wrong using of the variables..
B
75
S
22
G
68
Posts: 1,331
Reputation: 43,259


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests