mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 17:02:18 -05:00
added perspectivizion for arrows (issue #46)
This commit is contained in:
parent
a28eedc229
commit
97f9e548e2
1 changed files with 6 additions and 0 deletions
|
@ -250,6 +250,12 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
return
|
||||
scaleX = if @getActionProp 'flipX' then -1 else 1
|
||||
scaleY = if @getActionProp 'flipY' then -1 else 1
|
||||
if @thangType.get('name') is 'Arrow'
|
||||
# scale the arrow so it appears longer when flying parallel to horizon
|
||||
angle = @getRotation()
|
||||
angle = -angle if angle < 0
|
||||
angle = 180 - angle if angle > 90
|
||||
scaleX = 0.5 + 0.5 * (90 - angle) / 90
|
||||
scaleFactorX = @thang.scaleFactorX ? @scaleFactor
|
||||
scaleFactorY = @thang.scaleFactorY ? @scaleFactor
|
||||
@imageObject.scaleX = @originalScaleX * scaleX * scaleFactorX
|
||||
|
|
Loading…
Reference in a new issue