I’ve used what I learned yesterday during the Number Wizard part of the course to successfully create two console based games on my own.
The first one that I created was a Rock, Paper, Scissors game that the player plays against the computer. By pressing “R”, “P” or “S” on the keyboard, the player makes their choice. The computer selects one at random and whoever wins each round gets a point. No points are awarded for a draw. The game keeps track of the scores and the first person (or computer) to reach a score of 10 wins.
The second game that I made I call “Escape from Zorg”. It is based on a game I think I remember writing for the BBC micro many, many moons ago from a learn BASIC book. The player has crash landed on a hostile alien planet and must win enough money to be able to fix their ship and escape Zorg. The player does this by engaging in a game of dice. Pressing the up or down arrow keys increases or decreases the bet that the player makes and pressing the “R” key will roll the dice. The player rolls 2 dice at once and as such a random number between 2 and 12 is generated. If the player rolls 2 to 6 then they lose the amount that they bet, if they roll 7, 8 or 9 then they keep their bet. Rolling a 10 or 11 will win double their bet, while rolling a 12 triples what they bet. Checks are in place to make sure that you can’t bet nothing, nor can you bet more than you have. If you lose a bet and you have less money than what you bet last time, then the betting amount is automatically lowered to the what the player has left. Losing all your money dooms you to spend the rest of your presumably short life on the hostile planet, while winning more than (or equal to) the target amount will allow the player to escape the planet and a win the game.
I thought I’d put this here as a kind of suggestion to others to practice what you have learned before moving on to the next stage as it will help you to better remember everything that you learn along the way.
Looks like I’m ready for the next part of the course.