mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-07 10:34:46 -04:00
Merge branch 'arrow' of git://github.com/ItsLastDay/codecombat into ItsLastDay-arrow
This commit is contained in:
commit
9713f7d142
2 changed files with 7 additions and 1 deletions
|
@ -252,6 +252,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
|
||||
|
|
|
@ -5,4 +5,4 @@ module.exports.setup = ->
|
|||
winston.add(winston.transports.Console,
|
||||
colorize: true,
|
||||
timestamp: true
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue