mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Fixed the camera to not move around when the world is reset and being cast.
This commit is contained in:
parent
63ef2860d6
commit
5bda4d5e5f
1 changed files with 3 additions and 3 deletions
|
@ -164,16 +164,16 @@ module.exports = class Camera extends CocoClass
|
|||
@zoomTo target, newZoom, 0
|
||||
|
||||
onLevelRestarted: ->
|
||||
@setBounds(@firstBounds)
|
||||
@setBounds(@firstBounds, false)
|
||||
|
||||
# COMMANDS
|
||||
|
||||
setBounds: (worldBounds) ->
|
||||
setBounds: (worldBounds, updateZoom=true) ->
|
||||
# receives an array of two world points. Normalize and apply them
|
||||
@firstBounds = worldBounds unless @firstBounds
|
||||
@bounds = @normalizeBounds(worldBounds)
|
||||
@calculateMinZoom()
|
||||
@updateZoom true
|
||||
@updateZoom true if updateZoom
|
||||
@target = @currentTarget unless @target.name
|
||||
|
||||
normalizeBounds: (worldBounds) ->
|
||||
|
|
Loading…
Reference in a new issue