0 Favourites

custom movement for straffing left and right

  • Hi,

    I am building a space game and at the moment the player has the spaceship behaviour movement, but i also want them to be able to have thruster control so they can thrust to the left and to the right.

    Can anyone advise how to do this with the custom movement behaviour.

    So my final controls ideally will be:

    W = Thrust forward

    S = Thrust backwards

    A = rotate left

    D = rotate right

    Q = Thrust left

    E = Thrust right.

    Any help greatly appreciated.

    thanks.

  • If you use the eight move behavior you can turn off the angle movement in the object properties, so that you can control the angle manually with the rotation control you have.

    It will still allow you to move left and right without changing the angle of the object =). The rest is just setting the custom controls properly.

    Hope this is what you need =)

  • Why dont you use events?

    For example:

    YourKeyboard W is down: YourSpaceship move forward x pixels

    YourKeyboard a is down: YourSpaceship rotate x degrees counter-clockwise

  • Sargas: The 8 move behaviour is incompatible with standard rotation in the spaceship plugin behaviour. Even if rotation is turned off; essentially moving left always moves the player left on the screen regardless of what direction they are facing, this means they cannot strafe left in relation to their current angle, they can only move left across the screen.

    d4n13l: I am happy to use events, I figured i would have to for this custom movement, however I cannot workout what events will create a thruster style movement going left and right, based ont he current angle of the ship. The ones you describe are obvious and allow you to move down and turn.. But those abilities I have already done. What I need is to be able to allow the ship to strafe left and right based on their current angle and as indicated in my original post I dont know how to do that.

    Can anyone out there please help etermine how to create custom movement to strafe left and right in combination with spaceship style behaviours.

  • i don't really know what do you need , but if you want the player always facing (one side) for example right side you can do this from 8-direction properties tab "set angle" change it to no and it will fix the problem.

    with event

       condition : everytick

       action : set player angle to (0 for example).

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Alternatively:

    -Move at angle.

    Set the angle to move at to the player's angle +/- 90 degrees (Depending if it is strafe right or left)

    Something like this.

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