mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-29 18:45:48 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
f6ae4bc709
5 changed files with 60 additions and 42 deletions
|
@ -86,6 +86,7 @@ module.exports = class Simulator extends CocoClass
|
||||||
@cleanupAndSimulateAnotherTask()
|
@cleanupAndSimulateAnotherTask()
|
||||||
|
|
||||||
processSingleGameResults: (simulationResults) ->
|
processSingleGameResults: (simulationResults) ->
|
||||||
|
return console.error "Weird, we destroyed the Simulator before it processed results?" if @destroyed
|
||||||
taskResults = @formTaskResultsObject simulationResults
|
taskResults = @formTaskResultsObject simulationResults
|
||||||
console.log 'Processing results:', taskResults
|
console.log 'Processing results:', taskResults
|
||||||
humanSessionRank = taskResults.sessions[0].metrics.rank
|
humanSessionRank = taskResults.sessions[0].metrics.rank
|
||||||
|
|
|
@ -403,7 +403,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
zFactor = vz / Math.sqrt(vz * vz + vx * vx)
|
zFactor = vz / Math.sqrt(vz * vz + vx * vx)
|
||||||
rotation -= xFactor * zFactor * 45
|
rotation -= xFactor * zFactor * 45
|
||||||
imageObject ?= @imageObject
|
imageObject ?= @imageObject
|
||||||
return imageObject.rotation = rotation if not rotationType
|
return imageObject.rotation = rotation if rotationType is 'free' or not rotationType
|
||||||
@updateIsometricRotation(rotation, imageObject)
|
@updateIsometricRotation(rotation, imageObject)
|
||||||
|
|
||||||
getRotation: ->
|
getRotation: ->
|
||||||
|
|
|
@ -63,13 +63,14 @@ module.exports = class SpriteBoss extends CocoClass
|
||||||
|
|
||||||
layerForChild: (child, sprite) ->
|
layerForChild: (child, sprite) ->
|
||||||
unless child.layerPriority?
|
unless child.layerPriority?
|
||||||
# TODO: make better system
|
if thang = sprite?.thang
|
||||||
child.layerPriority = 0 if sprite?.thang?.isSelectable
|
child.layerPriority = thang.layerPriority
|
||||||
child.layerPriority = -40 if sprite?.thang?.isLand
|
child.layerPriority ?= 0 if thang.isSelectable
|
||||||
|
child.layerPriority ?= -40 if thang.isLand
|
||||||
return @spriteLayers['Default'] unless child.layerPriority
|
return @spriteLayers['Default'] unless child.layerPriority
|
||||||
layer = _.findLast @spriteLayers, (layer, name) ->
|
layer = _.findLast @spriteLayers, (layer, name) ->
|
||||||
layer.layerPriority <= child.layerPriority
|
layer.layerPriority <= child.layerPriority
|
||||||
#console.log 'layer for', child, 'is', (layer ? @spriteLayers['Default'])
|
layer ?= @spriteLayers['Land'] if child.layerPriority < -40
|
||||||
layer ? @spriteLayers['Default']
|
layer ? @spriteLayers['Default']
|
||||||
|
|
||||||
addSprite: (sprite, id=null, layer=null) ->
|
addSprite: (sprite, id=null, layer=null) ->
|
||||||
|
|
|
@ -112,7 +112,7 @@ _.extend ThangTypeSchema.properties,
|
||||||
say: c.object {format: 'slug-props', additionalProperties: {$ref: '#/definitions/sound'}},
|
say: c.object {format: 'slug-props', additionalProperties: {$ref: '#/definitions/sound'}},
|
||||||
defaultSimlish: c.array({}, {$ref: '#/definitions/sound'})
|
defaultSimlish: c.array({}, {$ref: '#/definitions/sound'})
|
||||||
swearingSimlish: c.array({}, {$ref: '#/definitions/sound'})
|
swearingSimlish: c.array({}, {$ref: '#/definitions/sound'})
|
||||||
rotationType: {title: 'Rotation', type: 'string', enum: ['isometric', 'fixed']}
|
rotationType: {title: 'Rotation', type: 'string', enum: ['isometric', 'fixed', 'free']}
|
||||||
matchWorldDimensions: {title: 'Match World Dimensions', type: 'boolean'}
|
matchWorldDimensions: {title: 'Match World Dimensions', type: 'boolean'}
|
||||||
shadow: {title: 'Shadow Diameter', type: 'number', format: 'meters', description: 'Shadow diameter in meters'}
|
shadow: {title: 'Shadow Diameter', type: 'number', format: 'meters', description: 'Shadow diameter in meters'}
|
||||||
layerPriority:
|
layerPriority:
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
@import 'bootstrap/variables'
|
@import 'bootstrap/variables'
|
||||||
|
|
||||||
|
// absolutes
|
||||||
|
$icon-margin-scale: 0.7
|
||||||
|
|
||||||
|
// control relative size
|
||||||
|
$overall-scale: 0.7
|
||||||
|
$bar-width: 340px
|
||||||
|
$bar-height: 30px
|
||||||
|
$icon-size: 200px
|
||||||
|
$icon-image-size: 130px
|
||||||
|
$content-width: 450px
|
||||||
|
$content-height: 160px
|
||||||
|
|
||||||
|
// just on user achievement list page
|
||||||
|
$user-achievements-scale: 0.8
|
||||||
|
|
||||||
.achievement-body
|
.achievement-body
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
|
@ -10,12 +25,14 @@
|
||||||
width: 100%
|
width: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
img
|
img
|
||||||
|
border-radius: 25%
|
||||||
position: absolute
|
position: absolute
|
||||||
margin: auto
|
margin: auto
|
||||||
top: 0
|
top: 0
|
||||||
left: 0
|
left: 0
|
||||||
right: 0
|
right: 0
|
||||||
bottom: 0
|
bottom: 0
|
||||||
|
width: $overall-scale * $icon-image-size
|
||||||
|
|
||||||
&.locked
|
&.locked
|
||||||
.achievement-content
|
.achievement-content
|
||||||
|
@ -36,7 +53,7 @@
|
||||||
max-height: 2em
|
max-height: 2em
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
text-overflow: ellipsis
|
text-overflow: ellipsis
|
||||||
|
font-size: 18px
|
||||||
|
|
||||||
> .achievement-description
|
> .achievement-description
|
||||||
white-space: initial
|
white-space: initial
|
||||||
|
@ -57,15 +74,13 @@
|
||||||
margin: 10px 0px
|
margin: 10px 0px
|
||||||
|
|
||||||
.achievement-icon
|
.achievement-icon
|
||||||
width: 120px
|
width: $overall-scale * $icon-size * $user-achievements-scale
|
||||||
height: 120px
|
height: $overall-scale * $icon-size * $user-achievements-scale
|
||||||
top: -10px
|
top: -5px
|
||||||
|
|
||||||
.achievement-image
|
.achievement-image
|
||||||
img
|
img
|
||||||
-moz-transform: scale(0.6)
|
width: $overall-scale * $user-achievements-scale * $icon-image-size
|
||||||
-webkit-transform: scale(0.6)
|
|
||||||
transform: scale(0.6)
|
|
||||||
|
|
||||||
.achievement-content
|
.achievement-content
|
||||||
margin-left: 60px
|
margin-left: 60px
|
||||||
|
@ -83,16 +98,16 @@
|
||||||
max-height: 2.6em
|
max-height: 2.6em
|
||||||
|
|
||||||
.achievement-popup
|
.achievement-popup
|
||||||
padding: 20px 0px
|
padding: $overall-scale * 20px 0px
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
.achievement-body
|
.achievement-body
|
||||||
.achievement-icon
|
.achievement-icon
|
||||||
z-index: 1000
|
z-index: 1000
|
||||||
width: 200px
|
width: $overall-scale * $icon-size
|
||||||
height: 200px
|
height: $overall-scale * $icon-size
|
||||||
left: -140px
|
left: $overall-scale * (-$icon-margin-scale * $icon-size)
|
||||||
top: -20px
|
top: $overall-scale * -20px
|
||||||
|
|
||||||
.achievement-image
|
.achievement-image
|
||||||
img
|
img
|
||||||
|
@ -106,53 +121,53 @@
|
||||||
.achievement-content
|
.achievement-content
|
||||||
background-image: url("/images/achievements/achievement_background.png")
|
background-image: url("/images/achievements/achievement_background.png")
|
||||||
position: relative
|
position: relative
|
||||||
width: 450px
|
width: $overall-scale * $content-width
|
||||||
height: 160px
|
height: $overall-scale * $content-height
|
||||||
padding: 24px 30px 20px 60px
|
padding: $overall-scale * 24px $overall-scale * 30px $overall-scale * 20px $overall-scale * 60px
|
||||||
|
|
||||||
.achievement-title
|
.achievement-title
|
||||||
font-family: Bangers
|
font-family: Bangers
|
||||||
font-size: 28px
|
font-size: $overall-scale * 28px
|
||||||
padding-left: -50px
|
padding-left: $overall-scale * -50px
|
||||||
|
|
||||||
.achievement-description
|
.achievement-description
|
||||||
font-size: 15px
|
font-size: $overall-scale * 16px
|
||||||
line-height: 1.3em
|
line-height: 1.3em
|
||||||
max-height: 2.6em
|
max-height: 2.6em
|
||||||
margin-top: auto
|
margin-top: auto
|
||||||
margin-bottom: 0px !important
|
margin-bottom: 0px !important
|
||||||
|
|
||||||
.progress-wrapper
|
.progress-wrapper
|
||||||
margin-left: 20px
|
margin-left: $overall-scale * 20px
|
||||||
position: absolute
|
position: absolute
|
||||||
bottom: 48px
|
bottom: $overall-scale * 48px
|
||||||
|
|
||||||
.user-level
|
.user-level
|
||||||
font-size: 20px
|
font-size: $overall-scale * 20px
|
||||||
color: white
|
color: white
|
||||||
position: absolute
|
position: absolute
|
||||||
left: -15px
|
left: $overall-scale * -15px
|
||||||
margin-top: -8px
|
margin-top: $overall-scale * -8px
|
||||||
vertical-align: middle
|
vertical-align: middle
|
||||||
z-index: 1000
|
z-index: 1000
|
||||||
|
|
||||||
> .progress-bar-wrapper
|
> .progress-bar-wrapper
|
||||||
position: absolute
|
position: absolute
|
||||||
margin-left: 17px
|
margin-left: $overall-scale * 17px
|
||||||
width: 314px
|
width: $overall-scale * ($bar-width - (2 * 5px) - 17px)
|
||||||
height: 20px
|
height: $overall-scale * ($bar-height - (2 * 5px))
|
||||||
z-index: 2
|
z-index: 2
|
||||||
|
|
||||||
> .progress
|
> .progress
|
||||||
margin-top: 5px
|
margin-top: $overall-scale * 5px
|
||||||
border-radius: 50px
|
border-radius: $overall-scale * 50px
|
||||||
height: 14px
|
height: $overall-scale * 14px
|
||||||
|
|
||||||
> .progress-bar-border
|
> .progress-bar-border
|
||||||
position: absolute
|
position: absolute
|
||||||
width: 340px
|
width: $overall-scale * $bar-width
|
||||||
height: 30px
|
height: $overall-scale * $bar-height
|
||||||
margin-top: -2px
|
margin-top: $overall-scale * -2px
|
||||||
background: url("/images/achievements/bar_border.png") no-repeat
|
background: url("/images/achievements/bar_border.png") no-repeat
|
||||||
background-size: 100% 100%
|
background-size: 100% 100%
|
||||||
z-index: 1
|
z-index: 1
|
||||||
|
@ -236,8 +251,9 @@
|
||||||
|
|
||||||
.user-level
|
.user-level
|
||||||
background-image: url("/images/achievements/level-bg.png")
|
background-image: url("/images/achievements/level-bg.png")
|
||||||
width: 38px
|
background-size: 100% 100%
|
||||||
height: 38px
|
width: $overall-scale * 38px
|
||||||
line-height: 38px
|
height: $overall-scale * 38px
|
||||||
font-size: 20px
|
line-height: $overall-scale * 38px
|
||||||
|
font-size: $overall-scale * 20px
|
||||||
font-family: $font-family-base
|
font-family: $font-family-base
|
||||||
|
|
Loading…
Reference in a new issue