mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-04 17:19:47 -04:00
Merged conflicts.
This commit is contained in:
parent
5af1741333
commit
61a25c5693
2 changed files with 0 additions and 39 deletions
app/lib/surface
|
@ -78,20 +78,9 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
@handledDisplayEvents = {}
|
||||
@age = 0
|
||||
@stillLoading = true
|
||||
<<<<<<< HEAD
|
||||
if @thangType.isFullyLoaded() then @onThangTypeLoaded() else @listenToOnce(@thangType, 'sync', @onThangTypeLoaded)
|
||||
|
||||
toString: -> "<CocoSprite: #{@thang?.id}>"
|
||||
=======
|
||||
@setNameLabel @thang.id if @thang?.showsName and not @thang.health <= 0
|
||||
if @thangType.isFullyLoaded()
|
||||
@setUpSprite()
|
||||
else
|
||||
@thangType.setProjection null
|
||||
@thangType.fetch() unless @thangType.loading
|
||||
@listenToOnce(@thangType, 'sync', @setUpSprite)
|
||||
@setUpPlaceholder()
|
||||
>>>>>>> master
|
||||
|
||||
onThangTypeLoaded: ->
|
||||
@stillLoading = false
|
||||
|
|
|
@ -185,13 +185,8 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
@adjustSpriteExistence() if frameChanged
|
||||
sprite.update frameChanged for sprite in @spriteArray
|
||||
@updateSelection()
|
||||
<<<<<<< HEAD
|
||||
@spriteLayers['Default'].spriteContainer.updateLayerOrder()
|
||||
@cache()
|
||||
=======
|
||||
@spriteLayers['Default'].updateLayerOrder()
|
||||
@cacheObstacles()
|
||||
>>>>>>> master
|
||||
|
||||
adjustSpriteExistence: ->
|
||||
# Add anything new, remove anything old, update everything current
|
||||
|
@ -234,31 +229,8 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
itemsJustEquipped.push item
|
||||
return itemsJustEquipped
|
||||
|
||||
<<<<<<< HEAD
|
||||
cache: (update=false) ->
|
||||
# TODO: remove caching
|
||||
=======
|
||||
cacheObstacles: (updatedObstacles=null) ->
|
||||
return if @cachedObstacles and not updatedObstacles
|
||||
wallSprites = (sprite for sprite in @spriteArray when sprite.thangType?.get('name').search(/(dungeon|indoor).wall/i) isnt -1)
|
||||
return if _.any (s.stillLoading for s in wallSprites)
|
||||
walls = (sprite.thang for sprite in wallSprites)
|
||||
@world.calculateBounds()
|
||||
wallGrid = new Grid walls, @world.size()...
|
||||
if updatedObstacles
|
||||
possiblyUpdatedWallSprites = (sprite for sprite in wallSprites when _.find updatedObstacles, (w2) -> sprite is w2 or (Math.abs(sprite.thang.pos.x - w2.thang.pos.x) + Math.abs(sprite.thang.pos.y - w2.thang.pos.y)) <= 16)
|
||||
else
|
||||
possiblyUpdatedWallSprites = wallSprites
|
||||
#console.log 'updating up to', possiblyUpdatedWallSprites.length, 'of', wallSprites.length, 'wall sprites from updatedObstacles', updatedObstacles
|
||||
for wallSprite in possiblyUpdatedWallSprites
|
||||
wallSprite.updateActionDirection wallGrid
|
||||
wallSprite.updateScale()
|
||||
wallSprite.updatePosition()
|
||||
#console.log @wallGrid.toString()
|
||||
@spriteLayers['Obstacle'].uncache() if @spriteLayers['Obstacle'].cacheID # might have changed sizes
|
||||
@spriteLayers['Obstacle'].cache()
|
||||
@cachedObstacles = true
|
||||
>>>>>>> master
|
||||
|
||||
spriteFor: (thangID) -> @sprites[thangID]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue