Posted March 30, 2023 by Mookie
#devlog #gamedev #indiedev #spritesheet #animations #spaceshooter #texture #asteroids
So now I want to add the sprite animation to the asteroids, so they aren’t just white boxes floating around. I struggled apply the textures in the same manner as the spacecraft, because it’s a large sprite sheet that I need to move around to simulate the animation. The sprite sheet is not ‘perfect’ some of the frame sizes are wonky, and there are 64 frames. I ultimately struggled getting an old animation library resurrected from a few years back, namely around its designed to be implemented by an image element, not a div, so I had to ditch that.
So, I did what I always do, I created a new project just to iron out how this needs to work in my project going forward. I will have to create a new sprite sheet and sequence class AGAIN but do it in a way that’s …. different.
I did get the new project mocked up and tweaked around until I got sprite sheet animations executed in a manner that I was satisfied with. I can control spin direction, spin speed, size, movement direction, which animation I use (there are two in the sprite sheet), and I can add a 2nd spin axis… which is a nice effect. And I think they look great too.
The next step will be porting this experiment back into my game code base, which will center around the new classes that need to be created.
The porting over went well, I mapped out the different sizes of asteroids that I wanted available, I added a randomization of the type, velocity, spin speed, rotation, etc.…
I also added an FPS calculation on my HUD so that I can track if I’m having lagging. Getting up to 1 spaceship and 8 asteroids, I’m not seeing any lag, as I shouldn’t, I should be able to add MANY more asteroids at this point.
I need to perform testing on mobile as well, … I’ll do that in between dev blog posts.
Till next time...
This currently hosted game site: https://asteroids-revisited.vercel.app/
Twitter: @jyoung424242
SlideShare: https://www.slideshare.net/JustinYoung3/next-gen-asteroids
GitHub: https://t.co/utxHxXKdOz