Milestone 10– adding asteroid textures and sprite animations
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
Asteroids Plus 2.0
next gen space shooter
More posts
- Asteroids Plus 2.0 - Milestone 19– Updating to Peasy-physicsMay 17, 2023
- Asteroids Plus 2.0 - Milestone 18– Adding the enemy AIMay 12, 2023
- Asteroids Plus 2.0 - Milestone 17 dynamic background Part 2May 06, 2023
- Asteroids Plus 2.0 - Milestone 17 - Dynamic Background Part 1May 06, 2023
- Asteroids Plus 2.0 - Milestone 16 - AudioMay 01, 2023
- Asteroids Plus 2.0 - Milestone 15 - Mobile DebuggingApr 25, 2023
- Asteroids Plus 2.0 - Milestone 14 - Heads Up DisplayApr 20, 2023
- Asteroids Plus 2.0 - Milestone 13, light housekeeping, spawning, HUD data, healt...Apr 15, 2023
- Asteroids Plus 2.0 - Milestone 12– collisions, the bane of my existenceApr 10, 2023
- Asteroids Plus 2.0 - Milestone 11– bullet hell…Apr 03, 2023
Leave a comment
Log in with itch.io to leave a comment.