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
293
S
117
G
96
Posts: 7,310
Reputation: 71,069

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.
Ever feel like you can't finish the game you are working on? It's time for a game plan, it's time to discover game design.

http://www.discovergamedesign.com



Check out my other courses:

https://www.jerementor.com
B
63
S
17
G
5
Posts: 51
Reputation: 6,566

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.
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
293
S
117
G
96
Posts: 7,310
Reputation: 71,069

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.
Ever feel like you can't finish the game you are working on? It's time for a game plan, it's time to discover game design.

http://www.discovergamedesign.com



Check out my other courses:

https://www.jerementor.com
B
63
S
17
G
5
Posts: 51
Reputation: 6,566

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
S
1
G
1
Posts: 5
Reputation: 610

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
16
S
3
G
1
Posts: 41
Reputation: 1,923

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
63
S
23
G
14
Posts: 52
Reputation: 19,835

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
5
Posts: 4
Reputation: 533

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests