Thursday, 7 April 2016

Class 30 - Random Chance

Post 113

Random Chance
Today I began to work on making the pots drop health pots randomly, as well as the occasional enemy drop, just so there is variety. Because currently the game is very repetitive. So I started to do this by setting up a simple variable called random chance. Random chance is a random number range between -2 to 1. When the level starts it randomly sets its random chance to one of these numbers.
Inside the step code it asks what the random chance number is equal to. And if the random chance is positive, It asks one more question. Is the bad chance positive. So what this does is it has two random chances inside each other. When the random chance is equal to a positive number it will spawn a health pot upon being broken open, unless the bad chance is also equal to a positive. Then the pot will spawn an enemy when smashed. Resulting in a dangerous choice for the player.
 Get more health? Or get attacked?


Tomorrow I will work on adding some more depth to the player UI.

No comments:

Post a Comment