rpg movement question

  • I get how to do the directional and turn sprite and animation.

    what i want to make the player only move in one direction such as left, up, right, down.

    And if the player press two or more button the same time do not move. The codes works for the up+down=stop moving that works. the Left+right=stop moving works.

    What is strange is that Up+right = stop moving does not work because even though the sprite animation stop moving yet the sprite is slowly being dragged upward.

    And the same happens when i press down Left How can i fix that I tried setting the speed to 0 yet it still drag itself upward or downward.

    Could this be a bug or is there something else going on that i cannot see

  • I don't quite understand what is going on in your project, neither what you are trying to do LOL

    Can you upload your .capx, so we can take a better look at it?

    Sorry for not being that much help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • By slightly adjusting my easy keyboard example, you could get exactly what you'd like:

  • yeah i can see how your example LittleStain would help in some ways i like that shift + example but i am rather confuse on how to input the variable for the movement ? i suppose i can just use the variable number and then convert it into a word's variable and do code base on what the word says. even then that is alot of event to track. I would hate for a bug to crawl from that lol

    so after fiddling around with the 8 directional action event that we are given, I just found it easier to put start ignoring input and stop ignoring is for the best to use.

    But still if you were to code the 4 way directional and then put in the stop moving when up and right are pressed the same time. You would see a dragging going upward id like to know why that is the case ? Im pretty sure you can code that in pretty quick if not i can do it

  • This tutorial should cover what you are trying to do:

    https://www.scirra.com/tutorials/791/4- ... -animation

  • if key up is pressed

    ELSE

    if key down is pressed

    ELSE

    if key left is pressed

    ELSE

    if key right is pressed

    This will only allow for 1 key to be pressed at a time.

    If you want to allow only up or down and only left or right

    if key up is pressed

    ELSE

    if key down is pressed

    if key left is pressed

    ELSE

    if key right is pressed

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