11-06-2019, 06:36 AM
If you have a pattern, animating it is just a case of moving it along by its width/height minus 1 pixel (or whatever your speed is), at which point the animation loops.
Let's use the Kirby pattern as an example. It is a 32×32 tile:
If we keep moving it along, we can get a seamless scroll:
This isn't much good as it is, so each frame we tile it to fill as large an area as we want:
These animations may look a bit jittery on a 60Hz display due to the GIF format not supporting 30fps (only multiples of 10ms) but it'll do as an example since you wouldn't have this issue when programming a game anyway.
Let's use the Kirby pattern as an example. It is a 32×32 tile:
If we keep moving it along, we can get a seamless scroll:
This isn't much good as it is, so each frame we tile it to fill as large an area as we want:
These animations may look a bit jittery on a 60Hz display due to the GIF format not supporting 30fps (only multiples of 10ms) but it'll do as an example since you wouldn't have this issue when programming a game anyway.