Strict movement on the grid

Get help using Construct 2

Post » Thu Jan 23, 2014 3:18 pm

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 ?


In the picture. Green - object, red - point movement, arrows - direction.
Thanks in advance!
P.S. Warning. Google translate.marsep2014-01-23 15:21:26
B
4
G
1
Posts: 11
Reputation: 447

Post » Thu Jan 23, 2014 11:42 pm

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 lolpaca2014-01-24 00:13:56
B
15
S
4
G
1
Posts: 286
Reputation: 1,988

Post » Fri Jan 24, 2014 1:55 am

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.
B
7
S
2
Posts: 12
Reputation: 583

Post » Fri Jan 24, 2014 5:34 am

Pathfinding behavior; disbaling diagonals doesn't help because the sprite can simulate semi-diagonals, it's not perfect at all.
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests