Book Image

Build the Game of Life Using JavaScript [Video]

By : Elisabeth Robson, Eric Freeman
Book Image

Build the Game of Life Using JavaScript [Video]

By: Elisabeth Robson, Eric Freeman

Overview of this book

JavaScript frameworks are great tools for building mobile apps. They’re efficient, lower development costs, and tend to have the security benefits that come with large, active communities of developers. In this course, we’ll build the Game of Life, a project that takes you through building a generative, cellular automaton game from start to finish in a one-page app using HTML, CSS, and JavaScript. This project is a great way for you to integrate your skills with markup, style, and behavior by creating an interactive and dynamic application right in your browser. In this project, we’ll make heavy use of the DOM, events, timing, and simple logic to create a truly generative application. By the end of this course, we’ll be able to build a creative and completely running gaming application with JavaScript. All the code files and resources for this course are available at https://github.com/PacktPublishing/Build-the-Game-of-Life-Using-JavaScript
Table of Contents (6 chapters)
Chapter 4
Create the Grid Model
Content Locked
Section 1
Introduction
We've got the view and the controllers mostly complete. Now what we need is a grid model. The model is where we're going to store the state of the game. This is where we'll keep track of the live and dead cells for computing the next generation of cells. In this module, we'll get the grid model into place, so we can apply the rules of the game to the state stored in the model. Remember the rules of the Game of Life? If not, no worries! We'll review the rules, and then implement the code to compute the next generation of life using those rules.