Smooth Grid Movement

  • Hello, I'm new to Construct 2 but I have a game in mind I want to create and it uses Grid Movement. I've searched through the forums and Google, even found a thread from 2 months ago on this topic. However, all the links from the previous thread are inactive so it's not very useful. I've looked at the "How Do I" thread as well, but it seems none of the links cover what I'm looking for.

    I've found a video of the movement style I'd like, however I'm not allowed to make links yet. So, if you Youtube pokemon gameplay, it should give an idea of the type of movement.

    Basically, I'm planning on using the keyboard arrows for movement, and what I'd like to happen is for the hero sprite to move one grid per press of the proper key, and if the key is held for it to continue moving in that direction but staying with the grid. While the sprite is moved, it is animated, and if the direction key is tapped (rather than held) for the animation to play once fully. In the video, the key is held so it makes it look like the hero is walking. If the button is tapped, it looks like the hero takes one step.

    I currently have 8-Direction as my movement, although it's changed to 4 direction and is animated.

    Can anyone help me recreate this classic style of movement? Thanks for all your time and help!

  • Wow that took longer than I thought.

    CAPX

    Also note that player collision polygon is 1 pixel inward.

  • Thanks for the reply! It works smoothly. I notice that you created your own movement, not using the 8-Directional Movement. I'll have to pick through it a bit more tomorrow to decipher all the pieces.

    I really appreciate the help!

  • Actually I forgot I am using version 161 but it should't open it then if you are using later version. If that even is the issue.

  • I don't suppose you'd write out the steps to achieve the end result?

    Edit: Nevermind, I'm figuring most of it out. :)

  • That Capx helped me so much! I really appreciate it, thank you

  • Hello!

    Using Katala source code, I implement touchscreen.

    But it does not work.

    What am I doing wrong?

    https://db.tt/X9c9Wgi7

  • Wenaptic Maybe you should use UI buttons or path finding.

  • I put this in my game, changing everything to 16 instead of 32. It worked in your example, but it will not work in my actual game. Is there something I didn't do properly?

    EDIT: I made sure all variables and what-not were the same, so there weren't any errors on import. I simply replaced my movement code with yours and nothing happened.

    EDIT 2: I left it at 32 because I realized that's the size I needed anyways, but it still didn't work. :\

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wenaptic try this

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