This is a silly "space battle" simulator.
It is primarily a vehicle to experiment with performing various DML operations and
become more accustomed to designing event/button-driven programs where the state only lasts for as long as a single transaction.
Note: At this time most variables are set to public. It's possible that they don't need to be -- I may update this in the future. Exception handling has only been implemented in a couple of places.
The player is initially presented with a Welcome screen (Figure 1). Clicking New Game begins the game.
The game generates new enemy ships (Figure 2). The player can Fire Photon Torpedoes.
Figure 2 - Enemy ships approaching
During each round, the player and the enemy ships fire at each other (Figure 3). The amount of damage is a random seed multiplied by a "power level" for each weapon type.
When an enemy ship's health reaches zero, it is destroyed. The table lists it as "deceased" (Figure 4). The player can click the Generate More Enemies button to add more enemy ships to the battle. The game will add a small number of random ship types each time the button is clicked.
Figure 4 - Some enemy ships destroyed
After all enemy ships are destroyed, the game is won (Figure 5).
If the player's health reaches zero first, the game is lost (Figure 6).
A custom tab can be added, allowed the user to browse the ships, make changes, or even add new ships (Figure 7).
The game utilizes a custom object called "Ships" (Figure 8) with the following custom fields:
- Attack Power
- Health
- Playable_or_Enemy
- Status
- Weapon