Grid based movement for sprites

Get help using Construct 2

Post » Mon Dec 16, 2013 11:07 am

I was introduced to Construct 2 over the weekend, and absolutely like the tool! My son and I created a game in about 6 hours. It's based off of the GhostShooter example.

What I would like to do now, is instead of having smooth movement, I would prefer my sprites to move according to a 32px by 32px grid ... moving one tile at a time. I've dug around a little and haven't found any good examples of a tilebased layout with grid movement.

If someone could assist I'd greatly appreciate it!
B
17
S
3
Posts: 33
Reputation: 1,666

Post » Mon Dec 16, 2013 11:11 am

Is THIS THREAD of use?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,486
Reputation: 59,758

Post » Mon Dec 16, 2013 1:11 pm

Thanks for the reply! Clicking through the links on that thread leads me to a lot of dead ends. I am really looking for an example project on how to do this ... is there a specific link available for that?
B
17
S
3
Posts: 33
Reputation: 1,666

Post » Mon Dec 16, 2013 1:22 pm

what behaviour are you using to move your sprites?
Are you using the mouse or the keyboard to make the player move?
Will the player be able to go diagonally or only straight?
will the player be able to set destination further away than one grid-move?

grid-based movement can mean a lot of different things to different people. In the FAQ there are some links to topics where people have tried. Using the search function you can find even more topics.

Basically it's setting the destination of movement based on the size of your grid.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Dec 16, 2013 3:00 pm

I'd like to use keyboard and mouse (touch) to move the "hero" sprite, and then move the enemy sprites at different times. I'm leaning towards just N,S,E and W movement. For now, just one tile at a time, future would be nice to give the hero a movement, something like 3 squares a second, and then let the user pick a spot on the map to move to.

I'll revisit the links ...

B
17
S
3
Posts: 33
Reputation: 1,666

Post » Mon Dec 16, 2013 6:04 pm

I think I figured this out ... but not sure if this is the proper way ... just using keyboard commands.

https://skydrive.live.com/redir?resid=68B3A9749787B11E!16044&authkey=!AKZ1OMjmYYUqbjU&ithint=file%2c.capx

Does this look correct? What if I wanted to limit them to one move per second?
B
17
S
3
Posts: 33
Reputation: 1,666

Post » Mon Dec 16, 2013 6:13 pm

I use dt that is Delta Time
Which is about 1 second.
But moving 32pixel on each keystroke is about 1 sec anyways.

A good example of moving player tokens x number squares is this little [URLhttp://gamedevelopment.tutsplus.com/tutorials/small-tactics-construct-2-part-2--gamedev-12241 ]Tutorial/demo[/URL] comes in part 1 and 2

Edit: Not everyone uses skydrive and doesn't have account to download. Suggest you get free dropbox or copy account to use for sharing. See my sig below - 20 gig for free.


Just checked out your capx - that should work. You can also use the move at angle and put angle 0 and distance 32 for right and 90|32 for down etc etc
Many ways to skin a cat - lolDUTOIT2013-12-16 18:37:24
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718


Return to How do I....?

Who is online

Users browsing this forum: banquetburger and 46 guests