/DiamondDash

final code club competition working on with Tiko B

Primary LanguageJava

**

Welcome to Diamond Dash!

##Update 1/19

  • A bug involving not being able to mine emerald or coal was fixed. There is a bug where robots will occasionally be able to mine a single block even after they have zero coal. A fix is being made.

##Update 1/15

  • A bug was pointed out where bots do not loose coal from mining stone, coal, or emeralds. This has been fixed. Please note that bots do not loose coal every turn in which you mine and only loose coal the moment a block is finished being mined.

The only classes you will need to access for this bot competition are Play and any bots you decide to make (TestBot is provided as an example) Basic Instructions

  • When you make a bot, please name the class your name
  • if you ever need help in the process of designing the bot or a question about the game, reach out to Alex or Tiko
  • There will be both an overnight and in-person competition for deciding the places of bots. The in-person competition will occur with a timer, and after a certain amount of time, the bot with the highest score wins. This tournament will occur in a bracket style. For the overnight competition, rounds will run until all diamonds have been mined. Many rounds will be played.

Every bot class includes the following methods

  • void newGame(Location currentLocation, int mapWidth, int mapHeight, int numPlayers); - currentLocation --> (x,y) coordinates of the bot - mapWidth --> how wide the map is (# of grid boxes not pixels) - mapHeight --> how high the map is (# of grid boxes not pixels) - numPlayers --> the number of players

  • String newTurn(Location currentLocation, String[] objectsDetected, int numCoal, int numEmerald, HashMap<Location,String> vision); - this happens every iteration of the game. - currentLocation --> (x,y) coordinates of the bot - objectsDetected --> an array of strings which has all the object detected around the bot in the following format: objectsDetected[0] objectsDetected[1] objectsDetected[2] objectsDetected[3] [YOUR BOT IS HERE] objectsDetected[4] objectsDetected[5] objectsDetected[6] objectsDetected[8] - Possible strings include: "EMPTY" "STONE" "MAPS_EDGE" "DIAMOND" "EMERALD" "COAL" "BOT:[Name of bot]" "MAPS_EDGE" - return a String which is the action of the bot. Possible strings include: "MOVE" --> Moves bot in direction it is facing if it's empty in front of it "TURN_RIGHT" --> Turns bot right "TURN_LEFT" --> Turns bot left "MINE" --> mines whatever is in front of it anything else will result in bot doing nothing - numCoal --> the current number of coal you have - numEmerald --> the current number of emeralds you have - vision --> this is a hash map of coordinates and their respective sprites at those coordinates when you use the vision powerup. this is NOT null in the step after you use the vision powerup, unless you have less than three emeralds objectsDetected --> an array of strings which has all the object detected around the bot in the following format: objectsDetected[0] objectsDetected[1] objectsDetected[2] objectsDetected[3] [YOUR BOT IS HERE] objectsDetected[4] objectsDetected[5] objectsDetected[6] objectsDetected[8] - Possible strings include: "EMPTY" "STONE" "MAPS_EDGE" "DIAMOND" "EMERALD" "COAL" "BOT:[Name of bot]" "MAPS_EDGE" - return a String which is the action of the bot. Possible strings include: "MOVE" --> Moves bot in direction it is facing if it's empty in front of it "TURN_RIGHT" --> Turns bot right "TURN_LEFT" --> Turns bot left "MINE" --> mines whatever is in front of it "VISION" --> uses vision powerup if you have three emeralds anything else will result in bot doing nothing

  • String getName(); - Return what you want your bot to be named (only runs once at the start)

Blocks and Game Mechanics

  • Diamonds
    • Diamonds are used to increase your score. They take three turns to mine. They provide no powerups and are the way in which we will indicate a bot's rank. They are the most important block. Diamonds are rare. You get one diamond upon mining.
  • Coal
    • Coal takes three turns to mine. You loose one coal on completion of mining any block. You start with ten coal, and coal is fairly common. Without any coal, you can't continue to mine blocks. For every coal mined you get between 3-5 coal.
  • Emeralds
    • Emeralds takes six turns to mine. Once you have three emeralds you can use the vision powerup, which reveals all blocks within a radius of 50 blocks of you. This is the only use for emeralds, and they are rare. For every emerald mined you get between 1-3 emeralds.
  • Stone
    • Stone takes three turns to mine. It provides no value to you.