Skip to content

aioimo/RedRobot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Red Robot and the Color Crusades

Introduction

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/.

alt text

alt text

alt text

alt text

How to Play

  • 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.

Used technologies

  • Vanilla JavaScript
  • the canvas HTML element

Opponents

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 Playerclass.

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 Playerclass or risk breaking the code.

Levels

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"
}

About

An original single-player puzzle game made with Javascript and Canvas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published