8 Directional Movement and Freeze Player

0 favourites
  • 8 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi

    I have 2 issues at the moment.

    (a) I'm struggling with my player movement and i cant figure out the solution. I want the player to face the same direction when moving up and down the layout. So if he is moving left and then you press on keyboard up or down , he is still facing left moving up or down and vice versa if moving right. The same movement you typically get in beat em ups.

    (b) Second issue is how do i freeze the character for example during dialogue so pressing on keyboard has no effect to player animation or movement. After the dialogue i then want to enable keyboard input back to normal.

    Hope all this makes sense!

    cheers

  • for B you could use a boolean

  • Thank you Yonda for your reply but unfortunately hasn't really helped me since i know nothing about boolean's. I will read through the tutorials, forums and stuff and see if any of it makes sense. I am new to construct

    and i am learning with each challenge my game demo brings up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Going trough tutorials is a good idea cause we wont be able to help you much until you learn the basics. GL

  • Answer A) On keyboard press UP - set player animation to "walk up"

    On keyboard press Down - set player animation to "walk down"

    etc.

    Answer B)When your game triggers your dialogue event eg: when the player goes up to a NPC and presses a button to talk, you would simply use

    Player - (8 direction - set enabled = false)

    this disables all input control on the 8 direction movement on the player until you call another action (like when he's done talking to the NPC - to enable it again.

    Player - (8 direction - set enabled = True)

  • Hi Guys

    Thanks for the advice. I am reading as many tutorials as i can but it literally is like learning a new language and i am impatient, haha. Justifun thanks for pointing me in the right direction ( is that a pun?). i will try your solution to question (b). With regards to (A) i have attached a link to example capx to illustrate my issue. As you can see the player when moving right can move up and down at the same angle i.e right but when player moves left and you press up and down, he still moves right. Funny thing is if you disable the events 10 to 14 then player moves correctly with events 5 to 9. You will see what i mean when you play the test and then disable the vents 10 to 14. I am hoping it will be a simple solution to you C2 experts.

    cheers

    dropbox.com/s/hq7vkalq533woat/WALK%20TEST.capx

  • Your "Sprite2 within 0 degrees of 180" event hasn't got any actions attached to it, so it does nothing.

    You probably want to put the events below it as subevents of this event.

    These are very very basic things you'd learn if you follow the tutorials.

    Right now there are two events for on down arrow pressed overwriting eachother. so only the last one is called.

  • By the way, your is within degrees won't work anyway for your sprite2 isn't rotated anywhere.

    Anyway, there is no need to make a mirrored walkanimation unless it will be completely different from the non-mirrored. Within C2 either the mirroring is done automatic or you can just set your sprite mirrored when the direction of movement changes.

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