Xojo Wars is a space battle between 4 ships flying and firing at each other. You implement an algorithm to control your own ship as it plays through a series of battles with other players. Your score is the number of ships you hit minus the number of times you get hit. After all the battles are completed, the ships with the top 4 scores play a championship round to determine the winner.
- Use Xojo 2015 Release 2!
- Implement ShipInterface
- Add an instance to MainWindow.CreatePlayers
Create a class that implements ShipInterface. Right-click on ShipInterface in the Navigator and select "New Implementor". This class must be completely self-contained with no dependency on anything outside of what is described below.
Add an instance of your class to MainWindow.CreatePlayers. For example:
AddPlayer(New Follower)
Project should be emailed to [email protected] by 8am CT on May 1, 2015. Use the subject line "XDC 2015 Contest". The contest is held at the end of the conference, 4pm CT May 1, 2015.
Your ship always moves forward and you control it by changing its direction and firing.
If you fly into a wormhole, your ship is teleported to random position. You also get two teleports per game.
Everyone will play about 4 to 6 battles (depending on number of participants) with 4 players per battle. Each battle will be around 60 seconds. Your opponents are random.
The number of opponents you hit and the number of times you get hit are counted. Your score is #ShipsYouHit - #TimesYouGetHit.
The top 4 scores after all the battles are finished play in a championship battle. If there is a tie for 4th place then all the 4th place ties are also included in the battle. This could mean that the championship battle has more than four players.
If there is a tie at the end of the championship round, 10 seconds are added to the clock and the battle continues in tie-breaker mode until there is a winner.
- No Introspection usage!
- Do not attempt to access information outside of what you are provided below.
- Have Fun!
Return True to fire a missile. This is only called if there is not already a missile that has been fired. Missiles disappear when:
- They reach edge of screen
- Reach a wormhole
- Hit an enemy
- After moving 250 positions
Return a String containing your Full Name. You must use your full name in order to claim victory!
This is called when a new game/battle starts. You can do initial setup here.
- w : Width of battle canvas
- h : Height of battle canvas
- wormholes(): Positions and sizes of wormholes
Rotate(shipX As Integer, shipY As Integer, Direction As Directions, activeShot As Boolean, enemies() As EnemyInfo) As RotationTypes
- shipX : the ship's X coordinate.
- shipY : the ship's Y coordinate.
- Direction : the direction the ship is pointing. The Directions enum contains N, NE, E, SE, S SW, W, NW.
- activeShot : True when you have an active missile
- enemies : an array of EnemyInfo containing the position of enemies, their direction and missile information. FYI: Missiles move faster than ships.
Return one of the RotationTypes (Left, Right, None) to rotate the ship.
Return True to teleport your ship. You can use two Teleports per game.
A global instance of Random that you can use to generate random values. Or you can use Xojo.Math.RandomInt (if using Xojo 2015 Release 2).
A global instance of Microseconds (based off of Milliseconds) that you can use for timing.
Change kGameSeconds, kGamesToPlay for testing purposes.