The purpose of this project is to create a fairly simple strategy game in Visual Basic.
The premise is that you are managing an asteroid colony, whose only export is the Iridium ore mined from the asteroid. Every year you get a status report and may sell your ore, spend money on food for your people, or buy or sell Iridium mines. The goal of the game is to survive as administrator until the 10th year, with as much money as possible.
The following should be displayed somewhere on the window:
There should be four text boxes on the window, one for the number of mines to sell, another for the number of mines to buy, another for the amount of money to spend on food, and another for the amount of ore to sell.
At the bottom of the window should be two (command) buttons, one that should advance to the next year, and another that quits the game.
There should be a File drop-down menu, with only one item: Exit.
The initial values of the various variables in the game should be as follows:
A low tax rate is 0.1, a medium tax rate is 0.2, and a high tax rate is 0.3.
On each new turn, the following (listed in pseudocode) should be calculated:
Add "Tax Rate" times "Population" to "Amount of money in bank" Subtract "Amount of Iridium to sell" from "Iridium in storage" Add "Amount of Iridium to sell" times "Price of Iridium" to "Amount of money in bank" Subtract "Number of mines to sell" from "Number of mines" Add "Number of mines to sell" times "Price of a mine" to "Amount of money in bank" Add "Number of mines to buy" to "Number of mines" Subtract "Number of mines to buy" times "Price of a mine" from "Amount of money in bank" Subtract "Money to spend on food" from "Amount of money in bank" IF "Money to spend on food" divided by "Number of people" is greater than 12, Add 0.1 to "Satisfaction factor" ELSEIF "Money to spend on food" divided by "Number of people" is less than 8, Subtract 0.2 from "Satisfaction factor" END IF IF "Satisfaction factor" is less than 0.6, Tell the player that the colonists revolted End the game ELSEIF "Satisfaction factor" is greater than 1.1, Add a random number between 1 and 20 to "Amount of Iridium produced per mine" Add between 1 and 10 people to "Population" ELSEIF "Satisfaction factor" is less than 0.9, Subtract a random number between 1 and 20 from "Amount of Iridium produced per mine" Subtract between 1 and 10 people from "Population" END IF IF "Population" divided by "Number of mines" is less than 10, Tell the player that everyone's overworked End the game ELSEIF "Population" is less than 30, Tell the player that there's not enough colonists left End the game END IF IF "Current year" is 10, Congratulate the player End the game END IF |
Extra Improvements:
Enabled = False
), forcing the user to either Quit or Restart. If the user selects Restart, re-enable the Next Year button (Enabled = True
).
population = 2 / 3 * population
).