mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 16:47:58 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
b91140bcad
17 changed files with 81 additions and 36 deletions
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
app/assets/images/level/popover_border_background.png
Normal file
BIN
app/assets/images/level/popover_border_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
app/assets/images/pages/game-menu/lock-processed.png
Normal file
BIN
app/assets/images/pages/game-menu/lock-processed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
|
@ -37,14 +37,7 @@ module.exports = class SpriteParser
|
||||||
blocks = @findBlocks ast, source
|
blocks = @findBlocks ast, source
|
||||||
containers = _.filter blocks, {kind: 'Container'}
|
containers = _.filter blocks, {kind: 'Container'}
|
||||||
movieClips = _.filter blocks, {kind: 'MovieClip'}
|
movieClips = _.filter blocks, {kind: 'MovieClip'}
|
||||||
if movieClips.length
|
|
||||||
# First movie clip is root, so do it last
|
|
||||||
movieClips = movieClips[1 ... movieClips.length].concat([movieClips[0]])
|
|
||||||
|
|
||||||
# first container isn't necessarily root... actually the last one is root in blue-cart
|
|
||||||
# else if containers.length
|
|
||||||
# # First container is root, so do it last
|
|
||||||
# containers = containers[1 ... containers.length].concat([containers[0]])
|
|
||||||
mainClip = _.last(movieClips) ? _.last(containers)
|
mainClip = _.last(movieClips) ? _.last(containers)
|
||||||
@animationName = mainClip.name
|
@animationName = mainClip.name
|
||||||
for container, index in containers
|
for container, index in containers
|
||||||
|
@ -69,17 +62,24 @@ module.exports = class SpriteParser
|
||||||
break
|
break
|
||||||
continue unless container.bounds and instructions.length
|
continue unless container.bounds and instructions.length
|
||||||
@addContainer {c: instructions, b: container.bounds}, container.name
|
@addContainer {c: instructions, b: container.bounds}, container.name
|
||||||
|
|
||||||
|
childrenMovieClips = []
|
||||||
|
|
||||||
for movieClip, index in movieClips
|
for movieClip, index in movieClips
|
||||||
if index is 0
|
lastBounds = null
|
||||||
for bounds in movieClip.frameBounds
|
# fill in bounds which are null...
|
||||||
bounds[0] -= @width / 2
|
for bounds, boundsIndex in movieClip.frameBounds
|
||||||
bounds[1] -= @height / 2
|
if not bounds
|
||||||
movieClip.bounds[0] -= @width / 2
|
movieClip.frameBounds[boundsIndex] = _.clone(lastBounds)
|
||||||
movieClip.bounds[1] -= @height / 2
|
else
|
||||||
|
lastBounds = bounds
|
||||||
|
|
||||||
localGraphics = @getGraphicsFromBlock(movieClip, source)
|
localGraphics = @getGraphicsFromBlock(movieClip, source)
|
||||||
[shapeKeys, localShapes] = @getShapesFromBlock movieClip, source
|
[shapeKeys, localShapes] = @getShapesFromBlock movieClip, source
|
||||||
localContainers = @getContainersFromMovieClip movieClip, source, true
|
localContainers = @getContainersFromMovieClip movieClip, source, true
|
||||||
localAnimations = @getAnimationsFromMovieClip movieClip, source, true
|
localAnimations = @getAnimationsFromMovieClip movieClip, source, true
|
||||||
|
for animation in localAnimations
|
||||||
|
childrenMovieClips.push(animation.gn)
|
||||||
localTweens = @getTweensFromMovieClip movieClip, source, localShapes, localContainers, localAnimations
|
localTweens = @getTweensFromMovieClip movieClip, source, localShapes, localContainers, localAnimations
|
||||||
@addAnimation {
|
@addAnimation {
|
||||||
shapes: localShapes
|
shapes: localShapes
|
||||||
|
@ -91,6 +91,14 @@ module.exports = class SpriteParser
|
||||||
frameBounds: movieClip.frameBounds
|
frameBounds: movieClip.frameBounds
|
||||||
}, movieClip.name
|
}, movieClip.name
|
||||||
|
|
||||||
|
for movieClip in movieClips
|
||||||
|
if movieClip.name not in childrenMovieClips
|
||||||
|
for bounds in movieClip.frameBounds
|
||||||
|
bounds[0] -= @width / 2
|
||||||
|
bounds[1] -= @height / 2
|
||||||
|
movieClip.bounds[0] -= @width / 2
|
||||||
|
movieClip.bounds[1] -= @height / 2
|
||||||
|
|
||||||
@saveToModel()
|
@saveToModel()
|
||||||
return movieClips[0]?.name
|
return movieClips[0]?.name
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,8 @@ kbd
|
||||||
|
|
||||||
.popover
|
.popover
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 29 39 fill stretch
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill stretch
|
||||||
border-width: 15px 20px
|
border-width: 16px 12px
|
||||||
.arrow
|
.arrow
|
||||||
display: none
|
display: none
|
||||||
.btn
|
.btn
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
max-width: 400px
|
max-width: 400px
|
||||||
padding: 10px
|
padding: 10px
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 18 fill round
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
|
||||||
border-width: 8px
|
border-width: 8px 6px
|
||||||
.progress
|
.progress
|
||||||
position: relative
|
position: relative
|
||||||
span
|
span
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
right: 10%
|
right: 10%
|
||||||
padding: 4%
|
padding: 4%
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 18 fill round
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
|
||||||
border-width: 15px
|
border-width: 16px 12px
|
||||||
|
|
||||||
html.no-borderimage
|
html.no-borderimage
|
||||||
#spell-list-view
|
#spell-list-view
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
overflow: scroll
|
overflow: scroll
|
||||||
padding: 4%
|
padding: 4%
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 18 fill round
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
|
||||||
border-width: 15px
|
border-width: 16px 12px
|
||||||
|
|
||||||
.thang-avatar-view
|
.thang-avatar-view
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
|
|
|
@ -56,8 +56,8 @@ body:not(.dialogue-view-active)
|
||||||
max-width: 600px
|
max-width: 600px
|
||||||
padding: 0
|
padding: 0
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 29 39 fill stretch
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
|
||||||
border-width: 15px 20px
|
border-width: 16px 12px
|
||||||
@include box-shadow(0 0 0 #000)
|
@include box-shadow(0 0 0 #000)
|
||||||
|
|
||||||
// Jiggle animation
|
// Jiggle animation
|
||||||
|
|
|
@ -83,9 +83,9 @@
|
||||||
z-index: 10
|
z-index: 10
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 29 39 fill stretch
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
|
||||||
padding: 0
|
padding: 0
|
||||||
border-width: 15px 20px
|
border-width: 16px 12px
|
||||||
font-variant: small-caps
|
font-variant: small-caps
|
||||||
text-overflow: ellipsis
|
text-overflow: ellipsis
|
||||||
font-size: 13px
|
font-size: 13px
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
.popover
|
.popover
|
||||||
padding: 10px 10px 30px 10px
|
padding: 10px 10px 30px 10px
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 18 fill round
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
|
||||||
border-width: 15px
|
border-width: 16px 12px
|
||||||
@include box-shadow(0 0 0 #000)
|
@include box-shadow(0 0 0 #000)
|
||||||
|
|
||||||
h1:not(.not-code), h2:not(.not-code), h3:not(.not-code), h4:not(.not-code), h5:not(.not-code), h6:not(.not-code)
|
h1:not(.not-code), h2:not(.not-code), h3:not(.not-code), h4:not(.not-code), h5:not(.not-code), h6:not(.not-code)
|
||||||
|
|
|
@ -110,6 +110,9 @@ $heroCanvasHeight: 265px
|
||||||
background-color: goldenrod
|
background-color: goldenrod
|
||||||
@include filter(contrast(50%) brightness(65%))
|
@include filter(contrast(50%) brightness(65%))
|
||||||
|
|
||||||
|
&.ie
|
||||||
|
@include opacity(0.35)
|
||||||
|
|
||||||
.lock-indicator
|
.lock-indicator
|
||||||
position: absolute
|
position: absolute
|
||||||
width: 40%
|
width: 40%
|
||||||
|
|
|
@ -199,6 +199,15 @@ $gameControlMargin: 30px
|
||||||
&.started .glyphicon-star
|
&.started .glyphicon-star
|
||||||
left: 0.5px
|
left: 0.5px
|
||||||
|
|
||||||
|
img.hero-portrait
|
||||||
|
width: 120%
|
||||||
|
position: absolute
|
||||||
|
bottom: 75%
|
||||||
|
left: 75%
|
||||||
|
border: 1px solid black
|
||||||
|
border-radius: 100%
|
||||||
|
background: white
|
||||||
|
|
||||||
|
|
||||||
.level-shadow
|
.level-shadow
|
||||||
z-index: 1
|
z-index: 1
|
||||||
|
@ -250,11 +259,11 @@ $gameControlMargin: 30px
|
||||||
position: absolute
|
position: absolute
|
||||||
z-index: 3
|
z-index: 3
|
||||||
padding: 10px
|
padding: 10px
|
||||||
border-width: 15px
|
border-width: 16px 12px
|
||||||
// Using modernizr-mixin for compat detection
|
// Using modernizr-mixin for compat detection
|
||||||
@include yep(borderimage)
|
@include yep(borderimage)
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-image: url(/images/level/popover_background.png) 18 fill round
|
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
|
||||||
@include nope(borderimage)
|
@include nope(borderimage)
|
||||||
background-color: rgb(247, 242, 218)
|
background-color: rgb(247, 242, 218)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,10 @@
|
||||||
li(data-hero-id=hero.get('original'), title=hero.name, data-slide-to=index, data-target="#hero-carousel", class="hero-indicator hero-index-" + index + (hero.locked ? " locked" : "") + (hero.purchasable ? " purchasable" : "") + (hero.restricted ? " restricted" : ""))
|
li(data-hero-id=hero.get('original'), title=hero.name, data-slide-to=index, data-target="#hero-carousel", class="hero-indicator hero-index-" + index + (hero.locked ? " locked" : "") + (hero.purchasable ? " purchasable" : "") + (hero.restricted ? " restricted" : ""))
|
||||||
.hero-avatar
|
.hero-avatar
|
||||||
if hero.locked && !hero.purchasable
|
if hero.locked && !hero.purchasable
|
||||||
img.lock-indicator(src="/images/pages/game-menu/lock.png", draggable="false")
|
if isIE
|
||||||
|
img.lock-indicator(src="/images/pages/game-menu/lock-processed.png", draggable="false")
|
||||||
|
else
|
||||||
|
img.lock-indicator(src="/images/pages/game-menu/lock.png", draggable="false")
|
||||||
.carousel-inner
|
.carousel-inner
|
||||||
for hero in heroes
|
for hero in heroes
|
||||||
div(class="item hero-item" + (hero.locked ? " locked" : "") + (hero.purchasable ? " purchasable" : "") + (hero.restricted ? " restricted" : ""), data-hero-id=hero.get('original'))
|
div(class="item hero-item" + (hero.locked ? " locked" : "") + (hero.purchasable ? " purchasable" : "") + (hero.restricted ? " restricted" : ""), data-hero-id=hero.get('original'))
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
- var next = level.id == nextLevel || (!seenNext && levelStatusMap[level.id] != "complete" && !level.locked && !level.disabled);
|
- var next = level.id == nextLevel || (!seenNext && levelStatusMap[level.id] != "complete" && !level.locked && !level.disabled);
|
||||||
- seenNext = seenNext || next;
|
- seenNext = seenNext || next;
|
||||||
div(style="left: #{level.x}%; bottom: #{level.y}%; background-color: #{level.color}", class="level" + (next ? " next" : "") + (level.disabled ? " disabled" : "") + (level.locked ? " locked" : "") + " " + levelStatusMap[level.id] || "", data-level-id=level.id, title=level.name + (level.disabled ? ' (Coming Soon to Adventurers)' : ''))
|
div(style="left: #{level.x}%; bottom: #{level.y}%; background-color: #{level.color}", class="level" + (next ? " next" : "") + (level.disabled ? " disabled" : "") + (level.locked ? " locked" : "") + " " + levelStatusMap[level.id] || "", data-level-id=level.id, title=level.name + (level.disabled ? ' (Coming Soon to Adventurers)' : ''))
|
||||||
|
if level.unlocksHero && !level.unlockedHero
|
||||||
|
img.hero-portrait(src=level.unlocksHero.img)
|
||||||
a(href=level.type == 'hero' ? '#' : level.disabled ? "/play" : "/play/#{level.levelPath || 'level'}/#{level.id}", disabled=level.disabled, data-level-id=level.id, data-level-path=level.levelPath || 'level', data-level-name=level.name)
|
a(href=level.type == 'hero' ? '#' : level.disabled ? "/play" : "/play/#{level.levelPath || 'level'}/#{level.id}", disabled=level.disabled, data-level-id=level.id, data-level-path=level.levelPath || 'level', data-level-name=level.name)
|
||||||
if level.requiresSubscription
|
if level.requiresSubscription
|
||||||
img.star(src="/images/pages/play/star.png")
|
img.star(src="/images/pages/play/star.png")
|
||||||
|
|
|
@ -141,6 +141,9 @@ module.exports = class WorldMapView extends RootView
|
||||||
level.color = 'rgb(255, 80, 60)'
|
level.color = 'rgb(255, 80, 60)'
|
||||||
if level.requiresSubscription
|
if level.requiresSubscription
|
||||||
level.color = 'rgb(80, 130, 200)'
|
level.color = 'rgb(80, 130, 200)'
|
||||||
|
if level.unlocksHero
|
||||||
|
level.color = 'rgb(0,0,0)'
|
||||||
|
level.unlockedHero = level.unlocksHero.originalID in (me.get('earned')?.heroes or [])
|
||||||
level.hidden = level.locked or level.disabled
|
level.hidden = level.locked or level.disabled
|
||||||
|
|
||||||
## put lower levels in last, so in the world map they layer over one another properly.
|
## put lower levels in last, so in the world map they layer over one another properly.
|
||||||
|
@ -441,6 +444,10 @@ dungeon = [
|
||||||
y: 10.70
|
y: 10.70
|
||||||
nextLevels:
|
nextLevels:
|
||||||
continue: 'the-raised-sword'
|
continue: 'the-raised-sword'
|
||||||
|
unlocksHero: {
|
||||||
|
img: '/file/db/thang.type/53e12be0d042f23505c3023b/portrait.png'
|
||||||
|
originalID: '53e12be0d042f23505c3023b'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: 'Favorable Odds'
|
name: 'Favorable Odds'
|
||||||
|
@ -779,6 +786,10 @@ forest = [
|
||||||
x: 38
|
x: 38
|
||||||
y: 72
|
y: 72
|
||||||
requiresSubscription: true
|
requiresSubscription: true
|
||||||
|
unlocksHero: {
|
||||||
|
img: '/file/db/thang.type/52fc0ed77e01835453bd8f6c/portrait.png'
|
||||||
|
originalID: '52fc0ed77e01835453bd8f6c'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: 'Swift Dagger'
|
name: 'Swift Dagger'
|
||||||
|
@ -817,6 +828,10 @@ forest = [
|
||||||
x: 47
|
x: 47
|
||||||
y: 71
|
y: 71
|
||||||
requiresSubscription: true
|
requiresSubscription: true
|
||||||
|
unlocksHero: {
|
||||||
|
img: '/file/db/thang.type/52fbf74b7e01835453bd8d8e/portrait.png'
|
||||||
|
originalID: '529ec584c423d4e83b000014'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: 'Touch of Death'
|
name: 'Touch of Death'
|
||||||
|
@ -887,6 +902,10 @@ forest = [
|
||||||
x: 74.5
|
x: 74.5
|
||||||
y: 92
|
y: 92
|
||||||
requiresSubscription: true
|
requiresSubscription: true
|
||||||
|
unlocksHero: {
|
||||||
|
img: '/file/db/thang.type/5466d449417c8b48a9811e83/portrait.png'
|
||||||
|
originalID: '5466d449417c8b48a9811e83'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: 'Rich Forager'
|
name: 'Rich Forager'
|
||||||
|
@ -898,6 +917,10 @@ forest = [
|
||||||
continue: 'siege-of-stonehold'
|
continue: 'siege-of-stonehold'
|
||||||
x: 80
|
x: 80
|
||||||
y: 88
|
y: 88
|
||||||
|
unlocksHero: {
|
||||||
|
img: '/file/db/thang.type/52e9adf7427172ae56002172/portrait.png'
|
||||||
|
originalID: '52e9adf7427172ae56002172'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: 'Siege of Stonehold'
|
name: 'Siege of Stonehold'
|
||||||
|
@ -907,11 +930,9 @@ forest = [
|
||||||
description: 'Unlock the desert world, if you are strong enough to win this epic battle!'
|
description: 'Unlock the desert world, if you are strong enough to win this epic battle!'
|
||||||
nextLevels:
|
nextLevels:
|
||||||
continue: 'the-dunes'
|
continue: 'the-dunes'
|
||||||
disabled: not me.isAdmin()
|
|
||||||
x: 85.5
|
x: 85.5
|
||||||
y: 83.5
|
y: 83.5
|
||||||
adventurer: true
|
adventurer: true
|
||||||
requiresSubscription: true
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: 'Multiplayer Treasure Grove'
|
name: 'Multiplayer Treasure Grove'
|
||||||
|
@ -943,7 +964,6 @@ desert = [
|
||||||
description: 'Behold, the desert, full of glory, danger, and sand. Lots of sand.'
|
description: 'Behold, the desert, full of glory, danger, and sand. Lots of sand.'
|
||||||
nextLevels:
|
nextLevels:
|
||||||
continue: 'the-mighty-sand-yak'
|
continue: 'the-mighty-sand-yak'
|
||||||
disabled: not me.isAdmin()
|
|
||||||
x: 8.47
|
x: 8.47
|
||||||
y: 21.93
|
y: 21.93
|
||||||
adventurer: true
|
adventurer: true
|
||||||
|
@ -957,7 +977,6 @@ desert = [
|
||||||
description: 'Test your nerves by dodging huge sand yaks on the open dunes!'
|
description: 'Test your nerves by dodging huge sand yaks on the open dunes!'
|
||||||
nextLevels:
|
nextLevels:
|
||||||
continue: 'oasis'
|
continue: 'oasis'
|
||||||
disabled: not me.isAdmin()
|
|
||||||
x: 16.56
|
x: 16.56
|
||||||
y: 27.77
|
y: 27.77
|
||||||
adventurer: true
|
adventurer: true
|
||||||
|
@ -971,7 +990,6 @@ desert = [
|
||||||
description: 'Run a gauntlet of sand yaks to reach oasis and quench your thirst!'
|
description: 'Run a gauntlet of sand yaks to reach oasis and quench your thirst!'
|
||||||
#nextLevels:
|
#nextLevels:
|
||||||
# continue: ''
|
# continue: ''
|
||||||
disabled: not me.isAdmin()
|
|
||||||
x: 23.35
|
x: 23.35
|
||||||
y: 31.60
|
y: 31.60
|
||||||
adventurer: true
|
adventurer: true
|
||||||
|
|
|
@ -69,11 +69,13 @@ module.exports = class PlayHeroesModal extends ModalView
|
||||||
context.confirmButtonI18N = @confirmButtonI18N
|
context.confirmButtonI18N = @confirmButtonI18N
|
||||||
context.visibleHero = @visibleHero
|
context.visibleHero = @visibleHero
|
||||||
context.gems = me.gems()
|
context.gems = me.gems()
|
||||||
|
context.isIE = @isIE()
|
||||||
context
|
context
|
||||||
|
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
super()
|
super()
|
||||||
return unless @supermodel.finished()
|
return unless @supermodel.finished()
|
||||||
|
@$el.find('.hero-avatar').addClass 'ie' if @isIE()
|
||||||
heroes = @heroes.models
|
heroes = @heroes.models
|
||||||
@$el.find('.hero-indicator').each ->
|
@$el.find('.hero-indicator').each ->
|
||||||
heroID = $(@).data('hero-id')
|
heroID = $(@).data('hero-id')
|
||||||
|
|
Loading…
Reference in a new issue