8 Direction, but follow mouse

  • Someone suggested to me that my top down shooter game might be a little better if I could have the main player follow the cursor (On Aim) while still moving in a direction.

    Currently it does follow the cursor to aim but if I'm holding down a key to move in a direction it only aims and shoots in that direction until I release then it turns to the mouse.

    Is there a way for me to set that up to still move in 8 directions and still follow the mouse on aim?

    Thank you in advance for your help.

    Here is my game if you want a better visual of what I have.

    Demo Game

    Thanks

  • You could try:

    * Every Tick - Set Player position to Mouse.X & Mouse.Y

    * Player is moving - set animation to "Walking"

    * INVERT: Player is(not) moving - set animation to "Still"

    You may have to play around with it a lil but if what you're tryna do is get the player's position to match that of the cursor's then that should do it.

  • Using those events you wouldnt need the 8-direction behavior since movement is based of the acceleration of the cursor & not of inputted controls like the keyboard which is a seperate object from the mouse in C2

  • I must be doing something wrong then because it is on 8 direction...

    here is a game I found this is the type of moment I'm talking about.

    http://www.scirra.com/arcade/addicting-shooter-games/11770/soldiershooter-alpha

    I'm not sure why it's not...

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Without seeing your capx I can't say where you are going wrong but have a look at the ghost shooter (tutorial demo) that comes with construct 2 - sounds like that should contain just what you are after. (also see the tutorial that it is based on)

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