With collisions working, it was really easy to add a simple “hitpoints” system. When there is a collision, check the two things that collided. If one of them does damage and the other takes damage, then reduce its hitpoints. If the hitpoints reach zero, destroy it. No fancy explosions, yet, because that’s all for show and doesn’t affect gameplay! I’m sticking to that MVP mantra.
Version 0.0.3.0 here.
Latest version here.
I guess it’s a pretty small group of people who get excited about “spatial partitioning,” but I think it’s one of the most interesting pieces of code to write in a game. There are lots of ways to do it, and the best choice for your game depends on lots of different factors.
Continue reading “Spatial Partitioning”
Detecting when two things are touching each other in 3D space can be a surprisingly difficult task. BabylonJS has its own built-in collision detection system, but it’s pretty basic and generic. I decided to write my own because I want a little more control and Ladon has some pretty specific constraints on how things interact. Also, it’s kind of a fun thing to write.
Continue reading “Collisions”
Spent some time making the ship turn to face the direction of thrust. This is a slightly tricky math problem that I had already solved back when this was a C++ project. The thing that always gets me is the trigonometry and the way that the resulting angles need to be wrapped so that they don’t get bigger than 180° or smaller than -180°. This was a chance for me to really make use of the browser’s debug console.
Continue reading “Flying Around”
Slow but steady progress today. I put the turrets back onto “tiles” like they were in the original. I love how it’s starting to look and feel so familiar, even though it’s a completely different engine. Development is ten times easier. The gameplay (the controls, the movement of the ship and projectiles, etc.) feels almost identical. And just the simple feeling of making progress again is awesome.
Version 0.0.1.3 here.
Latest version here.