Red Robot is a 1-player puzzle game I built during the Ironhack bootcamp that runs in the browser. The player controls the Red Robot, trying to outmanoeuvre various colorful animal opponents, to get the most points.
The game can be played on Github Pages: https://aioimo.github.io/RedRobot/.
- Use the arrow keys to move the Red Robot around the board.
- Each colored square left behind by each player is 1 point for that player.
- You can (and should) take points away from a player by covering up their color.
- If a colored square has been untouched for a certain number of moves, it will become impassable, designated by a thick black border.
- When a player no longer has access to a still-uncolored square, the player is out of the round.
- The round ends when all players have no access to a still-uncolored square, and the one with the most points is the winner of the round.
- Vanilla JavaScript
- the canvas HTML element
The opponents configuration is in the Players.js
file. There are currently 4 classes of AI player: PlayerAI
, EasyAI
, MediumAI
, FairAI
with their own moving behavior. These 4 classes inherit from the Player
class.
To change how an opponent moves, update the return values of the corresponding evaluateCoordinate(y,x)
method.
Do not change the evaluateCoordinate(y,x)
method of the Player
class or risk breaking the code.
The game has 9 levels, but creating your own new level is straightforward. You have to add a Level object (like below) to the levels array in the js/levels.js
file.
{
"level": 10,
//The size of the grid
"maxSize": 14,
//The color of the human player, starting X coordinate, starting Y coordinate.
"humanPlayer": [new Player("#A5243D"), 0, 0],
// Add opponents here with following parameters:
// class of Computer Opponent, color, character Image,
// starting coordinate X, starting coordinate Y
"computerOpponents": [
new MediumAI("Raven", "#17BEBB", "./images/raven.png", 6, 6),
new EasyAI("Kangaroo Rat", "#4B1D3F", "./images/kangarooRat.png", 3, 5),
new PlayerAI("Pigeon", "#0E7C7B", "./images/pigeonSquare.png", 5, 3)
],
//Number of turns until colored squares become impassable.
"maximumDuration": 16,
"starterText": ["Round 10", "A customized level."],
"scoreBoardColor": "#33032F",
"backgroundColor": "white"
}