Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Game.IntroPlayerAI = function(units, waypoints) {
- // 'units' is an array of all the units in the game including your units and your enemies units.
- // Each unit has an 'isEnemy' property. You can use this to determine which ships are yours and which
- // belong to your enemy.
- // 'waypoints' is an array of waypoints in the game.
- // Each waypoint has a 'reached' property. You can use this to find waypoints that you need to go to.
- // In order to make our ship do anything, you must return from this function an array of Command s.
- // A command is created with a ship and a target.
- // For example:
- // return [new Command(playerShip, new AttackInstruction(enemyShip))];
- // or
- // return [new Command(playerShip, new MoveInstruction(waypoint))];
- // assuming that the variable 'playerShip' is a player owned ship, 'enemyShip' is an enemy ship, and
- // 'waypoint' is a waypoint.
- }
Advertisement
Add Comment
Please, Sign In to add comment