implemented level restart

This commit is contained in:
Jeena 2014-01-12 04:33:08 +01:00
parent 81611050d2
commit 3edd664412
12 changed files with 104 additions and 47 deletions

View file

@ -22,9 +22,13 @@ define([
this.createItems();
}
Level.prototype.unload = function () {
// TODO unload level from engine if necessary
// Perhaps just remove all bodies?
Level.prototype.destroy = function () {
for (var key in this.gameObjects) {
for (var i = 0; i < this.gameObjects[key].length; i++) {
this.gameObjects[key][i].destroy();
}
//this.gameObjects[key] = [];
}
}
// Private
@ -235,7 +239,7 @@ microwave: 3.744
image:'skateboard.gif',
type:'skateboard',
category:'outdoor',
weight: 5,
weight: 1.5,
width:26,
height:6,
x:200,