How do I position and Grid move

Get help using Construct 2

Post » Wed Mar 19, 2014 1:06 pm

Hi

i know there are plugins (which i cannot get to work)
help needed
to randomly position a sprite on a tile map

turn based movement snapping to grid
so lets say goblin moves towards hero on a tile map background it can move two tiles per turn

I am really struggling with grid movement within C2 or finding a location which puts them in the middle of a 32x32 square
B
10
S
2
G
2
Posts: 45
Reputation: 2,039

Post » Wed Mar 19, 2014 1:14 pm

do you already know how to use "lerp" for the movement itself?

For moving 1 tile on the x-axis, you only have to move the sprite by 32x1 pixels.
Example 1: sprite1.x = sprite1.x+(32)

For moving 2 tiles on the x-axis, you only have to move the sprite by 32x2 pixels.
Example 2: sprite1.x = sprite1.x+(32*2)
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Wed Mar 19, 2014 1:20 pm

Ubivis wrote:do you already know how to use "lerp" for the movement itself?

For moving 1 tile on the x-axis, you only have to move the sprite by 32x1 pixels.
Example 1: sprite1.x = sprite1.x+(32)

For moving 2 tiles on the x-axis, you only have to move the sprite by 32x2 pixels.
Example 2: sprite1.x = sprite1.x+(32*2)


thanks after just testing some things this is really useful

then i found snapx on tilemap manual stuff and answered my own random placement question

you sir have just answered my movement problem many thanks, very straightforward
B
10
S
2
G
2
Posts: 45
Reputation: 2,039


Return to How do I....?

Who is online

Users browsing this forum: zenox98 and 13 guests