Finishing the gameplay loop

We now have winning and losing conditions enabled via object components (health component). In addition to disabling the object when health reaches 0, the component also sends messages to registered listener objects, most notably the main game object. This is the object which handles the creation of all the assets but now also has logic sending winning/losing messages, dealing with the score and restarting for next level (by re-enabling all the assets and resetting them) and update the score.

However, the UI is very “rough”, since we just print the health and score changes in the text log, and use windows message box to signify victory and defeat.

Animated gif showing destruction of all enemies - Level is then won once they are all destroyed

Shooting the bad guys and getting the winning popup!

Unfortunately, the collision problems are showing...

Time spent for this Time spent so far
5 h 50 h
[Read More]

Projectile and early game logic

Finally working on game logic, with objects interacting together!

Projectiles, just like the other objects in the engine, do not need to be created/destroyed in memory every time we want to use them. Rather they get enabled/disabled, to save execution performance. Additionally, I created a health and a life-time component which when attached to an object become responsible to handle their disabling. Based either on receiving collision messages (you have been hit, so your life is diminishing) or a specific duration (it’s been X seconds, so you disappear).

Time spent for this Time spent so far
4 h 45 h
[Read More]