1349 1084 1796 1548 1452 1435 1479 1058 1714 1669 1345 1984 1309 1656 1327 1671 1861 1692 1454 1263 1418 1421 1238 1475 1157 1300 1199 1069 1794 1304 1391 1350 1176 1850 1896 1975 1383 1999 1558 1015 1996 1140 1992 1675 1676 1432 1530 1369 1120 1311 1522 1198 1352 1719 1808 1975 1253 1456 1288 1387 1805 1921 1883 1665 1483 1985 1197 1393 1899 1486 1583 1450 1761 1978 1546 1609 1821 1498 1597 1080 1093 1210 1794 1099 1826 1594 1510 1850 1504 1181 1735 1485 1771 1022 1246 1279 1219 1197 1602 Copycat JavaScript Game | PHPnews.io

PHPnews.io

Copycat JavaScript Game

Written by Bram.us / Original link on Apr. 10, 2017

Fun little game in which you control more than one character at once in a level, all bound to the same controls. Using walls and other obstacles you can sync up the locations between characters in order for each character to reach its own target.

copycat-game.jpg

The game itself is written in “vanillaJS”, sans external libraries, and renders onto a <canvas> element. Be sure to check out the source to see how it’s built (knowing French might come in handy whilst doing so ;)). The level design for example is interesting, as they are just multidimensional arrays:

{
    "nom": "debut",
    "indice": "try to move forward",
    "geometrie": [
      [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
      [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
      [0, 0, 1, 1, 1, 1, 1, 8, 8, 8, 1, 1, 1, 1, 1, 1],
      [0, 1, 1, 1, 1, 1, 1, 8, 1, 8, 1, 1, 1, 1, 1, 1],
      [1, 1, 1, 1, 1, 1, 1, 8, 4, 8, 1, 1, 1, 1, 1, 1],
      [1, 1, 1, 1, 1, 1, 1, 8, 1, 8, 1, 1, 1, 1, 1, 1],
      [1, 1, 1, 1, 1, 1, 1, 8, 1, 8, 1, 1, 1, 1, 1, 0],
      [1, 1, 1, 1, 1, 1, 1, 8, 1, 8, 1, 1, 1, 1, 0, 0],
      [1, 1, 1, 1, 1, 1, 1, 8, 5, 8, 1, 1, 1, 0, 0, 0],
      [1, 1, 1, 1, 1, 1, 1, 8, 1, 8, 1, 1, 0, 0, 0, 0],
      [1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 1, 1, 0, 0, 0, 0],
      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    ]
  }

Copycat →

bram

« Strange Beasts - Getting ready for Symonfy 4.0 »