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”

Tiles are Back

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.

Code Cleanup

Did some much-needed code cleanup. Moved a bunch of global variables that I was experimenting with into the objects where they belong. Now, for example, each moving object has its own “velocity” member and each object that can fire a projectile owns its array of “bullet” objects, and so on. Not glamorous, but work that eventually has to be done. The thing I’m most happy about is that I didn’t overthink it. I just put things where they made sense, without trying to architect a complicated solution for any possible thing that I might want to add in the future. That’s a bad habit that I have, but I’m doing it less often.

Version 0.0.1.1 here.

Latest version here.

Shots Fired

I added code to handle mouse click events. Clicking now fires, which is cool enough that I thought it was worth calling it version 0.0.1.0. It feels much more like the beginnings of a game now. I just had to work out some math for rotations and learn about how BabylonJS’s coordinate system deals with parent/child meshes. Pretty straightforward, which is refreshing.

Check out version 0.0.1.0 here.

Latest version here.