mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-14 14:04:38 -04:00
Made updatePosition use getWorldPosition
This commit is contained in:
parent
99f43028a0
commit
51d7bd656d
1 changed files with 1 additions and 4 deletions
|
@ -197,12 +197,9 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
|
||||
updatePosition: ->
|
||||
return unless @thang?.pos and @options.camera?
|
||||
wop = @getWorldPosition()
|
||||
[p0, p1] = [@lastPos, @thang.pos]
|
||||
if bobOffset = @getBobOffset()
|
||||
p1 = p1.copy?() or _.clone(p1)
|
||||
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
|
||||
wop = x: p1.x, y: p1.y, z: if @thang.isLand then 0 else p1.z - @thang.depth / 2
|
||||
sup = @options.camera.worldToSurface wop
|
||||
[@displayObject.x, @displayObject.y] = [sup.x, sup.y]
|
||||
@lastPos = p1.copy?() or _.clone(p1)
|
||||
|
|
Loading…
Add table
Reference in a new issue