So Many Rocks, So Little Time

I changed the rocks so that when you smash them, they don’t just immediately turn into “drops” that you can collect. Instead, they turn into randomly smaller rocks. And you can continue to smash them into smaller rocks until they’re small enough for you to pick up.

This didn’t seem like a big change as I was writing the code, but it turned out to be an important milestone — it’s the first time when I was testing the game that it started to feel fun. Something about the randomness of the pieces of rock flying out into space and chasing after them actually feels like a game.

Check out version 0.0.6.2 over on the releases page.

Heads Up

It’s really easy to add GUI controls in BabylonJS, like text blocks. I’ll use these for the basic heads-up display. I also fixed a really sneaky bug that allowed the player to blow up the same rock twice if two bullets hit it at exactly the same time.

Check out version 0.0.6.1 over on the releases page.

Blow Stuff Up

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.

Flying Around

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”