I recently started working on project 2 of my LibGDX book. It’s a multidirectional shooter called Space Rocks. It’s kinda like asteroids. You fly a ship, shoot a laser, blow up some rocks, and you can warp around. The process has been fairly easy so far.
Thanks to the beauty of object oriented programming, I was able to reuse a lot of code from the first project. That led to me being able to get it mostly finished in about a day. Most of my time on this project will probably be spent on making my own sprites and tweaking things to make it better.
There are a few things in my book that are outdated or IDE-specific. It makes things challenging at times but it also helps make me a better programmer by forcing me to seek alternative solutions. The LibGDX community has been great so far and I’ve had no problems finding answers to my problems.
One such problem is the way this book goes about spawning game objects. I’ve had to change the manner in which the level screen spawns non-player objects. As a result, I have to refactor the collision loops. This is something that took me a while to figure out in the first project, but with the help of this blog post, I was able to get everything working.
Along with getting the collision figured out, I also need to get the laser working properly. At this point, it shows up on top of the spaceship and doesn’t go anywhere. As far as I can tell, the code is right so the error might be coming from changes that got copied over from the first project’s source code. My best guess would be that the speed or velocity isn’t being applied to the laser properly.
Once I get all that figured out, I’m probably gonna give all the assets a makeover. I do think they look better than most of the assets that come with books and tutorials, but I also love pixel art and need to practice. Not only that, but I want to do as much as I can to change each game and make it stand out.