June 2015
Beginner
354 pages
8h 23m
English
We will refractor our code to support the loading of static ground bodies from a levels data structure. Let's work on it by carrying out the following steps:
box2dcargame.js JavaScript file in a text editor.var carGame = { currentLevel: 0 } carGame.levels = new Array(); carGame.levels[0] = [{"type":"car","x":50,"y":210,"fuel":20}, {"type":"box","x":250, "y":270, "width":250, "height":25, "rotation":0}, {"type":"box","x":500,"y":250,"width":65,"height":15, ...Read now
Unlock full access