Sprite Grid movement

Thanks for getting back to me on this question. I am building a remake of Frogger. When the player is on land, I get the tile location next to player, place a sprite on it (lets call it ‘marker’), and have the player move to it. There is an issue where the sprite does not completely make it to the sprites location (Bug found when a sprite follows a sprite), so I was thinking about using your grid extension. My work around is to check when the vx/vy is zero, to indicate that the sprite is no longer moving so that it can move again.

That is why I was curious if it were possible to set the speed (when snapping) so that it looks like the players moves. My other question about turning off the ‘move by grid’ option, is when the player moves over water and lands on a log/turtle. I want the player to then move by x/y coordinates. In fact, I have stopped using the tile location to move the player all together, as I can just have it move 16px each time. This will work better when the player jumps off a log and back onto land.

@jwunderl & @darzu
May I ask another question regarding velocity/acceleration?
I guess when a sprite is set to ‘start following’ another sprite, that it first accelerates until it reaches the desired velocity and starts to decelerate as it nears the target. When the player has stopped moving, I check whether it overlaps a log and set the player’s vx to that of the log. Is this correct, or do I need to set a value for acceleration?
After setting the vx, the player does not move with the log. I’m starting to suspect that maybe the player does not move, because it is still set to follow the other sprite. I might try setting the vx of the ‘marker’ sprite as well to see if that works.

This leads me inexorably to asking another question… If a sprite is set to follow another sprite, should there not be a way to stop that behavior? Or does this happen automatically?

@darzu
I love your YouTube films; they are informative, easy to follow and fun to watch. Do you still have ‘the beard’? :grin:

@jwunderl
I see that you are also busy on YouTube with Richard and Vivian making games; they are always fun to watch. :ok_hand:

1 Like