[5SD033] Clouds, bugs and yet more clouds
|
This week I spent most of the time fixng bugs or patching things in response to the feedback from the playtest this past monday. So now the potato dropping menu appears right as you fly over the destillery and you are also able to control the menu with keyboard instead of the mouse. I had to remove mouse input in the menu because it made it possible for two buttons to display that they were pushed down at the same time which was not good. So, on to the new features I worked on this week – clouds. Now clouds spawn at the start of the game and slowly drift off to the side out the end map, before teleporting to the left of the map and once again drifting off to the right end, repeating the process over and over again. ![]() The clouds are at the start of the game given random positions across the map with the help of two random variables, one for the X position and one for the Y position. after the cloud is given a position it is randomly allocated one of seven sprites. All clouds have a “speed”-variable that is added to the clouds’ X positions whenever their update function is called. When the clouds pass the right edge of the map they recieve a new randomly generated Y position and “teleported” to outside the left of the screen. The clouds are not only for looks, they are a great way for the player to avoid detection from enemies. While the player is within a certain area in the center of the clouds a bool will start to return true. While the bool returns true the enemies can not be alerted when the player enters their area of view. When the player exits the cloud the bool will start to return false again and they be fully visible for enemies. A player can also use a cloud to force an enemy into search state and if they are skilled or lucky enough they can shake them off and escape. To avoid the player taking advantage of the clouds, they do not only move slower than the player and are smaller than the players turning circle, they will also start to disperse every time a player flies through them. This is done by changing the sprites alpha channel and making them thinner and thinner. They will slowly regain their “mass”(Don’t know if this is the correct word for this situation) while the player isn’t flying through them.
|
