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

Get help using Construct 2

### » 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:

Event 47 and 48 are where I'm setting the speed of the player.

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

### » 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

### » 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.
B
173
S
50
G
194
Posts: 8,569
Reputation: 121,374

### » 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

### » 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.
B
71
S
22
G
273
Posts: 3,823
Reputation: 150,789

### » 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

### » Tue Jun 30, 2015 12:09 am

did you set the angle of motion for the bullet behavior?
B
160
S
69
G
43
Posts: 2,606
Reputation: 36,304

### » 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

### » Tue Jun 30, 2015 2:03 am

blackhornettechnologies.com/Construct2Stuff/Frogger4_BHT.capx
B
71
S
22
G
273
Posts: 3,823
Reputation: 150,789

### » 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
79
S
24
G
69
Posts: 1,356
Reputation: 44,125