Skip to content

lionelGoffaux/Simple-Game-Of-Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Simple-Game-Of-Life

Why a game of life more? Just for fun

How it works

To setup the game you just have to create a div tag with the id of your choice and add "game.js"

<body>
    <div id="app"></div>
    <script src="Game.js"></script>
</body>

Then you have to bind the id using the Game's bind method with the ccs selector of your div tag as parameter

let app = Game.bind("#app")

This method can also take an object as second parameter to config some game options

let app = Game.bind("#app", {tps: 10, cellSize: 5, canvasSize: 750, initCellNbr: 20})

Options list

  • tps : to set the number of turn per second of the game
  • cellSize : the size of a cell (px)
  • canvasSize : the size of the game's canvas (px)
  • initCellNbr : the number of initial cells