Midnight Storm is a 2D game, made entirely in Microsoft Visual Studio, using self-made sprites. The plot of this game, was that the protagonist must prepare for an oncoming storm that has been reported on the news. As the water pipe is damaged, the protagonist have no choice to collect rain water as a source of water, until the storm passes, so the protagonist can call for help to fix the water pipe.
The goal of the game, is to collect a specific amount of raindrops to proceed with the game. As the player goes through each level, the game will become noticeably harder.
This game was made for an assignment in OCR Technical Diploma [Level 2], which has been showcased to next year's student due to its complexity.
Initially, the game was not supposed to have any difficulties. As I was done with the game, I have decided to implement last-minute difficulties, that introduces new mechanics to the game.
From Medium and onwards, the game introduces the following:
Lightning Strike : The player is randomly struck with lightning that temporarily immobilises the player.
Poison Drop : Temporarily slows down the player's movement speed.
Random Drop : Upon collecting the rain drop, it has a random chance of doing something.
Prior to the development of this game, I had a little to no knowledge in C#, neither did I know how to coherently write C# apps or games without introducing errors and such. Thankfully, prior to creating this game, there were programming exercises that helped with bolstering my confidence of writing in C#. Plus, I have borrowed and tailored code from such exercises.
Before I had created this game, the assets had to be created. I have used Piskel App to make these 2D sprites that were later imported into the game project. Secondly, I had to find some audio assets, as I wanted to make the game slightly unique by adding audio into the game. Upon implementing the audio, my first obstacle - playing two sounds simultaneously. By default, WinForms comes with SoundPlayer class that is very limited and understands .wav audio files. This, by itself, is not good, as .wav files are typically uncompressed and large in file size.
To circumvent this limitation, I had to implement Windows Media Player [WMPLib] library as a cheap workaround. I did not know back then, that there were better alternatives, however, they require more intervention with the implementation.
Each rain drop was handled by a `foreach` loop that looks for picture box components with a corresponding tag (for raindrops, it would be "raindrop", poisondrop, it would be "poisondrop", etc).
Using keyboard events, I have created two events to check whether the corresponding key is being pressed. In this case, it was the left and right arrow key. By pressing either one, the player's picture box will move a certain amount of pixel to the corresponding direction. The amount of pixel that it would move to, depends on a variable called "playerspeed".
To allow the player to "catch" the rain drops, I have used the player's picture box bounds to check whether the rain drop's bounds and the player's bounds are intersecting. The code below shows how this is done.
The only scrapped feature that this game was meant to have, is a store. The store, supposed to serve as an upgrade shop to enhance the player's gameplay by providing them power ups, extra health and other bonuses.