Strict movement on the grid

0 favourites
  • 4 posts
From the Asset Store
Snap to visible grid - perfect solution for any game genre
  • Hi everyone! I would like to know as well as you can do to move the object to a point under strict angle ( 0, 90, 180, 270) ? The subject should not move diagonally . I tried this movement do with behavior " Pathfinder " when looking for a way to move and to set position , but even if you ban behavior use " diagonal movement " object will not move under strict angle. And I need to move to a strictly vertical and horizontal , heading for a given position . How to implement this , is there any example or a hint ?

    <img src="http://rghost.ru/private/51869575/cf8ff3ad6abda3f410ab03f4239a9aea/image.png" border="0" />

    In the picture. Green - object, red - point movement, arrows - direction.

    Thanks in advance!

    P.S. Warning. Google translate.

  • I'm not sure you can with the pathfinding behaviour as it is - as you said, even with diagonals and rotations switched off and the cell size set to the grid size, it still seems to 'drift' quite a bit which just seems to be the way the behaviour's coded.

    You might need to make your own pathfinding behaviour, which is quite easy to do if you don't need any obstacles on your map, and quite complicated if you do :P

    EDIT - If anyone at Scirra's reading, a 4- or 8-direction-only pathfinding system would be ace for grid-based game <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Messed around with the manual for a bit, here's what I found.

    On player: Add 8-Direction behavior, then on the Directions properties, select 4 Directions.

    On other objects: Add Pathfinding behavior, then on Diagonals, select Disable.

    You can find all behavior properties on the left side of the C2 screen.

    Hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pathfinding behavior; disbaling diagonals doesn't help because the sprite can simulate semi-diagonals, it's not perfect at all.

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