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

0 favourites
  • 10 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • 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.

    I really appreicate any help guys I feel like I'm going nuts.

  • 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.

  • 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.

  • 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.

  • I'd pin the frog to the log, then unpin on jump. Then you don't have to worry about the frog movement.

  • blackhornet

    That's a really good idea I'll try it out and let you know.

  • did you set the angle of motion for the bullet behavior?

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • blackhornettechnologies.com/Construct2Stuff/Frogger4_BHT.capx

  • 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..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)