Skip to content

6thfdwp/2048-backbone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048-backbone

The original repository is here.

Reimplement game 2048 made by Gabriele Cirulli for learning purpose. Inspired by WilliamLP version

Backbone's collection and model are very suitable to represent the game internal structure. By combining them we transform original 2-D array to 1-D collection to manage a set of tile instances. Each move is to find the next position (the index in the collection) for each tile via simple calculation and update its value property (no need to create and destroy instances).

Its built-in event-driven also allows to render UI based on model state change which ends up with cleaner, more efficient and loose coupling code. Once we get the new state of all occupied tiles for current move, trigger customized events and view could use template engine to build html markups for those tiles and insert them into the page once.

About

A reimplemented version of 2048 based on backbone

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published