Blocky/Segmented Motion

Get help using Construct 2

Post » Tue Jul 03, 2012 6:27 am

All that stuff I wrote out last time. With the added question of what imbecile would want "system security" on a web forum about game design such that, gasp, if I'm away several minutes (perhaps working on code) it logs me out *and* opts to not remember my damn post...

Shorter-than-last-time-version -- I'm wanting segmented/blocky motion. Type of thing where a 50x50 pixel player will move *fluidly* (standard 8 direction type stuff), but upon key release the player continues at the same speed until they stop on the next tick. 50x50 goes forward 35? It stops at 50. 51? Stops at 100. That sort of thing. I'm wanting it for (decently) fast motion, active/live gameplay, not a chessboard. If *how* the pieces might move might be easy to think of with chess.

A lot of games have this. I think zelda did. I'm sure zelda 2's world map did. Zoop. Zelda 2 had a "character square" moving over "terrain squares" and "encounter squares" that would appear/move around/if they touched you, you'd switch to their encounter screen/fight. But you were always in one square, or moving out of it into another, you weren't half in one or the other, you couldn't sit on a corner and be in 4 squares at once. Zoop? Far more constrained, it had a grid type setup, 4x4 square in the middle that the player could move in. Clearing rows/tetris style game. But while you'd fluidly move from one row to the other in whatever direction you pushed, you'd stop in the next row unless you held your key down. Where-ever you release, you'll end up in the middle of the row you're going into. But never over to the side... Get it?

But how's that done? I've tried a few tricks, setting an instance variable for the player, having keypresses store goal coordinates and when the player coords aren't at goal, move. Trouble is I'm then an nth lil' space past, which sets off the condition in the other direction, I end up going back and forth on whatever (horizontal/vertical) axis. I could figure when it's very-close and do an exact position move, but then there's a jump that doesn't feel like it should be there. Etc, tried a few things. Someone's figured it out, too many games use it. What am I not thinking of?
B
5
Posts: 6
Reputation: 337


Post » Tue Jul 03, 2012 8:40 am

Amazingly helpful. Thanks.
B
5
Posts: 6
Reputation: 337


Return to How do I....?

Who is online

Users browsing this forum: amarcelo, Draconinho, LeFuji, plinkie, totoe and 20 guests