Why is my bullet behaviour changing direction?

0 favourites
  • 3 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • I'm working on a a game that's a sort of freerunner. But with spaceships (I like spaceships!). You hold the mouse/touch the screen to pause the forward movement, to avoid enemy spaceships.

    <img src="http://i.imgur.com/jWwAXXS.png" border="0">

    I'm using the bullet behaviour for the Player, which seemed sensible. All it does is travel in a direction until it collides with a directional arrow, and inherits the arrow object's rotation as its angle of movement.

    Seems sensible right? Well it works perfectly until after hitting the direction arrow and changing direction. Then a simple hold and release (changing the bulletspeed to 0 then back to 70 again) makes the spaceship fly in the opposite direction!!! I never asked it to change angle, so why is it changing direction?

    I'd really appreciate it is someone more experienced could download my capx and have a look at what I'm doing wrong. This is my first real C2 project and I'm a bit stuck tbh.

    Here's the download. https://dl.dropboxusercontent.com/u/24767479/c2%20project%20files/TrafficCars.capx

    BTW I've also tried the custom movement behaviour, and this has exactly the same problem. I've tried saving the movement angle to a variable and setting it again after releasing, but this doesn't work either. download

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The angle of motion is based on the bullet's velocity. When you set the bullet speed to 0 it changes the angle of motion. When you release touch you'll need to set the angle of motion again after setting the speed.

  • That makes a lot of sense. Thanks, I've fixed it by saving the angle to a variable, then using that when the ship starts moving again. Simple really, but I was chasing my tail around on this issue for ages.

    Thanks so much ramones!

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