Tile movement?

Get help using Construct 2

Post » Sun Oct 16, 2011 3:47 am

Put a single frame in the animation (a frame of a cell).
Delete the "set animation frame" line (since it is not required).

Like I did for the example of the PathFinder behavior.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sun Oct 16, 2011 5:36 am

When I try that it messes up the movement...I'm going to try something else and post it shortly.
Ready to Jumpstart with Construct 2? Check out my website:
https://www.jerementor.com
B
53
S
14
G
5
Posts: 47
Reputation: 5,744

Post » Sun Oct 16, 2011 5:56 am

You have to make sure that your cell's image is 32X32 pixel.
Or, if you want to modify the size of the cell (sprite) be sure to put the same size to "Player".

It also helps to stick to power of 2 measures.
http://dl.dropbox.com/u/36472942/construct/forumhelp/QuickGridMovement2.capx

The movement works, but hard to figure since there is no visual "refering".
Try to bash an arrow key, at some point you will have the impression it is not moving, and then reach an edge.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sun Oct 16, 2011 6:30 am

lol thanks so much for helping me with this. I'm trying to get my own version to work here. The movement is the hardest part.
Ready to Jumpstart with Construct 2? Check out my website:
https://www.jerementor.com
B
53
S
14
G
5
Posts: 47
Reputation: 5,744

Post » Sat Oct 29, 2011 11:11 am

Hi Im new to C2 and I found your example very interesting. But I was wondering how to implement the same grid-like movement but you can see the player move between each square rather than teleport.

I want to implement my game so that the player sprite is shown moving between two adjacent tiles with a duration of half a second.

Thanks.
B
2
G
1
Posts: 5
Reputation: 460

Post » Sat Oct 29, 2011 1:24 pm

[QUOTE=Kyatric]
Like I did for the example of the PathFinder behavior.[/QUOTE]
This is awesome!   
B
12
S
3
G
1
Posts: 33
Reputation: 1,786

Post » Mon May 14, 2012 8:04 pm

[QUOTE=Kyatric] http://dl.dropbox.com/u/36472942/construct/forumhelp/QuickGridMovement.capx
This is one implementation, just to give you the idea.

Also I didn't use WASD as I have an AZERTY keyboard, and WASD is truely a pain with it.
Nothing beats the arrow and always think about internationalization of your application if you want to hit a large audience.[/QUOTE]

@Kyatric
This might just save my life.

However, may I ask, instead of teleporting the player every button, how do I make it visibly move -> then stop at the next tile?

Should I use dt function here?

Eg:
On pressing "LEFT" : Move "PLAYER" forward 32 pixel *dt???



Oh dear, I didn't know this is a 2 page post. My question is actually the same as Smurfee.ZhaoYun2012-05-17 18:20:59
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Thu May 24, 2012 9:19 pm

There is an explanation of one method to implement Grid-based (a.k.a. Tile-based) movement in a tutorial I've recently written at
http://www.scirra.com/tutorials/308/cloning-the-classics-pacman
Hope it helps someone out there!
B
61
S
18
G
14
Posts: 50
Reputation: 18,592

Post » Wed Feb 18, 2015 3:55 am

Kyatric wrote:Put a single frame in the animation (a frame of a cell).
Delete the "set animation frame" line (since it is not required).

Like I did for the example of the PathFinder behavior.



I wasn't lookin' for pathfinding sample, but that sample shows pretty much all what I need, thanks Kyatric !
B
4
Posts: 4
Reputation: 508

Previous

Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 28 guests