mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
A few tweaks to visuals on PlayHeroesModal hero previews.
This commit is contained in:
parent
991a374da2
commit
5cf37d1796
1 changed files with 6 additions and 2 deletions
|
@ -172,10 +172,14 @@ module.exports = class PlayHeroesModal extends ModalView
|
||||||
layer.on 'new-spritesheet', ->
|
layer.on 'new-spritesheet', ->
|
||||||
#- maybe put some more normalization here?
|
#- maybe put some more normalization here?
|
||||||
m = multiplier
|
m = multiplier
|
||||||
m *= 0.75 if fullHero.get('slug') in ['knight', 'samurai', 'librarian'] # these heroes are larger for some reason, shrink 'em
|
m *= 0.75 if fullHero.get('slug') in ['knight', 'samurai', 'librarian', 'sorcerer'] # these heroes are larger for some reason, shrink 'em
|
||||||
layer.container.scaleX = layer.container.scaleY = m
|
layer.container.scaleX = layer.container.scaleY = m
|
||||||
layer.container.children[0].x = 160/m
|
layer.container.children[0].x = 160/m
|
||||||
layer.container.children[0].y = 250/m
|
layer.container.children[0].y = 250/m
|
||||||
|
if fullHero.get('slug') in ['forest-archer', 'librarian', 'sorcerer', 'potion-master']
|
||||||
|
layer.container.children[0].y -= 3
|
||||||
|
if fullHero.get('slug') in ['librarian', 'sorcerer', 'potion-master']
|
||||||
|
layer.container.children[0].x -= 3
|
||||||
|
|
||||||
stage = new createjs.SpriteStage(canvas[0])
|
stage = new createjs.SpriteStage(canvas[0])
|
||||||
@stages[heroIndex] = stage
|
@stages[heroIndex] = stage
|
||||||
|
@ -194,7 +198,7 @@ module.exports = class PlayHeroesModal extends ModalView
|
||||||
animateHeroes: =>
|
animateHeroes: =>
|
||||||
return unless @visibleHero
|
return unless @visibleHero
|
||||||
heroIndex = Math.max 0, _.findIndex(@heroes.models, ((hero) => hero.get('original') is @visibleHero.get('original')))
|
heroIndex = Math.max 0, _.findIndex(@heroes.models, ((hero) => hero.get('original') is @visibleHero.get('original')))
|
||||||
animation = _.sample(['attack', 'idle', 'move_side', 'move_fore'])
|
animation = _.sample(['attack', 'move_side', 'move_fore']) # Must be in LayerAdapter default actions.
|
||||||
@stages[heroIndex]?.children?[0]?.children?[0]?.gotoAndPlay? animation
|
@stages[heroIndex]?.children?[0]?.children?[0]?.gotoAndPlay? animation
|
||||||
|
|
||||||
playSelectionSound: (hero) ->
|
playSelectionSound: (hero) ->
|
||||||
|
|
Loading…
Reference in a new issue