mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-29 23:43:51 -04:00
Not sure why beam behaves differently, but fixed its scaling.
This commit is contained in:
parent
8192a6153d
commit
2e2f184485
1 changed files with 7 additions and 4 deletions
|
@ -157,11 +157,11 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
show: ->
|
show: ->
|
||||||
@hiding = false
|
@hiding = false
|
||||||
@updateAlpha()
|
@updateAlpha()
|
||||||
|
|
||||||
stop: ->
|
stop: ->
|
||||||
@imageObject?.stop?()
|
@imageObject?.stop?()
|
||||||
mark.stop() for name, mark of @marks
|
mark.stop() for name, mark of @marks
|
||||||
|
|
||||||
play: ->
|
play: ->
|
||||||
@imageObject?.play?()
|
@imageObject?.play?()
|
||||||
mark.play() for name, mark of @marks
|
mark.play() for name, mark of @marks
|
||||||
|
@ -206,8 +206,11 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
if @thang.width isnt @lastThangWidth or @thang.height isnt @lastThangHeight
|
if @thang.width isnt @lastThangWidth or @thang.height isnt @lastThangHeight
|
||||||
[@lastThangWidth, @lastThangHeight] = [@thang.width, @thang.height]
|
[@lastThangWidth, @lastThangHeight] = [@thang.width, @thang.height]
|
||||||
bounds = @imageObject.getBounds()
|
bounds = @imageObject.getBounds()
|
||||||
@imageObject.scaleX = @thang.width * Camera.PPM / bounds.width * @thangType.get('scale') ? 1
|
@imageObject.scaleX = @thang.width * Camera.PPM / bounds.width
|
||||||
@imageObject.scaleY = @thang.height * Camera.PPM * @options.camera.y2x / bounds.height * @thangType.get('scale') ? 1
|
@imageObject.scaleY = @thang.height * Camera.PPM * @options.camera.y2x / bounds.height
|
||||||
|
unless @thang.spriteName is 'Beam'
|
||||||
|
@imageObject.scaleX *= @thangType.get('scale') ? 1
|
||||||
|
@imageObject.scaleY *= @thangType.get('scale') ? 1
|
||||||
return
|
return
|
||||||
scaleX = if @getActionProp 'flipX' then -1 else 1
|
scaleX = if @getActionProp 'flipX' then -1 else 1
|
||||||
scaleY = if @getActionProp 'flipY' then -1 else 1
|
scaleY = if @getActionProp 'flipY' then -1 else 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue