Input Handler 90% there.

This commit is contained in:
Richard Davey
2013-09-08 22:38:19 +01:00
parent abe344b408
commit ebda1f99e3
10 changed files with 183 additions and 65 deletions
+9 -1
View File
@@ -7,17 +7,19 @@ Phaser.LinkedList.prototype = {
prev: null,
first: null,
last: null,
total: 0,
sprite: { name: 'HD' },
add: function (child) {
// If the list is empty
if (this.first == null && this.last == null)
if (this.total == 0 && this.first == null && this.last == null)
{
this.first = child;
this.last = child;
this.next = child;
child.prev = this;
this.total++;
return;
}
@@ -28,6 +30,10 @@ Phaser.LinkedList.prototype = {
this.last = child;
this.total++;
return child;
},
remove: function (child) {
@@ -38,6 +44,8 @@ Phaser.LinkedList.prototype = {
return;
}
this.total--;
// The only node?
if (this.first == child && this.last == child)
{