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

Here are gifs showing the loosing conditions:

Animated gif showing destruction of the player - Game is lost when the player is destroyed

Getting shot by the bad guys and getting the losing popup!

Of course if you jump in their shooting range...

Animated gif showing destruction of platforms - Game is lost when all platforms are destroyed

Letting the bad guys shoot all platforms and getting the losing popup!

Once more, collision problems are showing...

With this done, let’s take a break before going back to this^^. Next thing will be to try to make these graphics better!


See also