|
|
@@ -7,6 +7,7 @@ define([ |
|
|
|
) { |
|
|
|
var scale = 40; |
|
|
|
var scaleMult = 5; |
|
|
|
var round = Math.round.bind(Math); |
|
|
|
|
|
|
|
return { |
|
|
|
type: 'pather', |
|
|
@@ -28,11 +29,11 @@ define([ |
|
|
|
events.on('onDeath', this.onDeath.bind(this)); |
|
|
|
events.on('onClearQueue', this.onDeath.bind(this)); |
|
|
|
|
|
|
|
this.pathPos.x = this.obj.x; |
|
|
|
this.pathPos.y = this.obj.y; |
|
|
|
this.pathPos.x = round(this.obj.x); |
|
|
|
this.pathPos.y = round(this.obj.y); |
|
|
|
}, |
|
|
|
|
|
|
|
onDeath: function() { |
|
|
|
clearPath: function() { |
|
|
|
this.path.forEach(function(p) { |
|
|
|
renderer.destroyObject({ |
|
|
|
layerName: 'effects', |
|
|
@@ -41,8 +42,13 @@ define([ |
|
|
|
}); |
|
|
|
|
|
|
|
this.path = []; |
|
|
|
this.pathPos.x = this.obj.x; |
|
|
|
this.pathPos.y = this.obj.y; |
|
|
|
}, |
|
|
|
|
|
|
|
onDeath: function() { |
|
|
|
this.clearPath(); |
|
|
|
|
|
|
|
this.pathPos.x = round(this.obj.x); |
|
|
|
this.pathPos.y = round(this.obj.y); |
|
|
|
}, |
|
|
|
|
|
|
|
add: function(x, y) { |
|
|
@@ -66,8 +72,8 @@ define([ |
|
|
|
var y = this.obj.y; |
|
|
|
|
|
|
|
if (this.path.length == 0) { |
|
|
|
this.pathPos.x = x; |
|
|
|
this.pathPos.y = y; |
|
|
|
this.pathPos.x = round(x); |
|
|
|
this.pathPos.y = round(y); |
|
|
|
} |
|
|
|
|
|
|
|
if ((x == this.lastX) && (y == this.lastY)) |
|
|
@@ -95,8 +101,8 @@ define([ |
|
|
|
setPath: function(path) { |
|
|
|
this.path = this.path.concat(path); |
|
|
|
|
|
|
|
this.pathPos.x = path[path.length - 1].x; |
|
|
|
this.pathPos.y = path[path.length - 1].y; |
|
|
|
this.pathPos.x = round(path[path.length - 1].x); |
|
|
|
this.pathPos.y = round(path[path.length - 1].y); |
|
|
|
} |
|
|
|
}; |
|
|
|
}); |