How do I make 4-way top down movement

0 favourites
  • 7 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • I would like some help on creating 4-way top down movement, where if you press any of the 4 directions the object moves in that direction until it hits a wall. For some reason i can't figure this out. Thank you in advance

  • use the 8-direction behaviour and set it to 4 directions..

  • use the 8-direction behaviour and set it to 4 directions..

    Yes thats the Way to go

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yea but that still dosnet fix the issues where i want the object to keep moving in a direction until it hits a wall, without holding down the key. I would like to make it so that if i press Right arrow, object is gona move to the right until it hits a wall.

  • There are many ways to achieve this..

    one would be giving the object an intance variable and set it to the moving direction

    on key right arrow pressed - object set instance variable to "right"

    object compare instance variable = "right" - object : 8 directions simulate pressing right..

    If you do this for all directions, you are ready to go..

  • I already tryed that and the problem i get is when colliding with the wall (solid object). If i do on collison with another object (wall) > Set "Variable" to None. The collision is not precise and i get a 1 to 20px gap bettween the object and the wall. Any idea on how to fix that. I can post the Capx file if that helps?

  • I had a situation similar to this in a little experiment I was doing when I started using Construct (keep in mind though I have only been using construct a very short time) that was similar to this.

    You could try getting the coordinates of the moving object when it collides with the wall, then set its X and Y to that coordinate at the end of the event.

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