prevent continuous drift with spaceship controls

Get help using Construct 2

Post » Mon Jan 07, 2013 12:31 pm


I am creating a 2D space shootem-up style game, anyway at the moment I am using one of the additional plugins for spaceship movement, where w thrusts forward and s thrusts backwards and a and d rotate the player left and right.

The problem I am having is that if the player goes forward a little, they will continue to drift forever... but ideally i want them to gradually slow down, and come to a stop. So that they will only drift for a short time and not forever.

If people would like to see an example of how it works at the moment, you can see my prototype tests here:

Sorry for long download I have also been testing how to build the introduction with some placeholder gfx, press start game and after the intro wasd will control the spaceship and youll see what i mean.

Should I keep using the spaceship controls and add some rules to make the ship slow down, or use custom controls to do the same thing,m and if so can anyone provide a capx with how to build the control system.

Thanks for any help you can give.AJTilley2013-01-07 12:31:56
Posts: 185
Reputation: 5,056

Post » Mon Jan 07, 2013 12:49 pm

I'm not familiar with the plugin/behaviours you use for spaceship control but how about including a countdown variable that runs whenever w isn't pressed? Pseudo-code:

System -> every tick
If (key.w <= 0 And ship.speed > 0)
   If (ship.countdown > 0)
      ship.countdown -= 1; (or whatever)
      ship.speed *= ship.countdown;
      ship.countdown = 0;
      ship.speed = 0;

Posts: 385
Reputation: 3,306

Return to How do I....?

Who is online

Users browsing this forum: aquadijoib, eleanorawesome, LaMachineFactory, Yahoo [Bot], yurinkab and 16 guests