Fixed sprite offset positioning bug.

This commit is contained in:
Nick Winter 2014-01-31 13:28:42 -08:00
parent 8d81d75d2b
commit 4d891ee7fa

View file

@ -170,7 +170,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
p1 = p1.copy?() or _.clone(p1) p1 = p1.copy?() or _.clone(p1)
p1.z += bobOffset p1.z += bobOffset
return if p0 and p0.x is p1.x and p0.y is p1.y and p0.z is p1.z and not @options.camera.tweeningZoomTo return if p0 and p0.x is p1.x and p0.y is p1.y and p0.z is p1.z and not @options.camera.tweeningZoomTo
wop = x: p1.x, y: p1.y, z: if @thang.isLand then 0 else p1.z - @thang.depth wop = x: p1.x, y: p1.y, z: if @thang.isLand then 0 else p1.z - @thang.depth / 2
sup = @options.camera.worldToSurface wop sup = @options.camera.worldToSurface wop
[@displayObject.x, @displayObject.y] = [sup.x, sup.y] [@displayObject.x, @displayObject.y] = [sup.x, sup.y]
@lastPos = p1.copy?() or _.clone(p1) @lastPos = p1.copy?() or _.clone(p1)