Advertisement Jump to content
Sign in to follow this  

Recording sprite movement

This topic is 3311 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

so i have a little sprite game and want to record every movement position of the player , what would be the best solution?

Share this post

Link to post
Share on other sites
"Best" could have a lot of meanings, depending on your exact scenario the best scenario could be different.

That being said...

If your game is 100% deterministic you should be able to just record the input button changes and the time/frame they occur into an array and then play them back later.

If your game isn't perfectly deterministic, you could record player and spawned enemy position and movement information for every frame, as well as storing events (i.e. animation changes, deaths, spawns, etc) as applicable.

If your game isn't written in a way that you can store and reenact event triggers you could either fix that, or you could save everything each frame -- including camera position (i.e. screen offset in to your 'map') visible player/enemy locations and texture ids. This is expensive (basically saving a complete render list every frame), but would work.

There are lots of spots in between, and completely different techniques, but hopefully that should get you started finding the right solution for your game.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!