mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
b278525785
5 changed files with 13 additions and 9 deletions
|
@ -136,7 +136,8 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
width = @thang.width * Camera.PPM
|
||||
height = @thang.height * Camera.PPM * @options.camera.y2x
|
||||
depth = @thang.depth * Camera.PPM * @options.camera.z2y * @options.camera.y2x
|
||||
makeColor = (brightnessFactor) => (Math.round(c * brightnessFactor) for c in (healthColors[@thang.team] ? [180, 180, 180]))
|
||||
brightnessFuzzFactor = 1 + 0.1 * (Math.random() - 0.5)
|
||||
makeColor = (brightnessFactor) => (Math.round(c * brightnessFuzzFactor * brightnessFactor) for c in (healthColors[@thang.team] ? [180, 180, 180]))
|
||||
topColor = "rgba(#{makeColor(0.85).join(', ')},1)"
|
||||
mainColor = "rgba(#{makeColor(0.75).join(', ')},1)"
|
||||
ellipse = @thang.shape in ['ellipsoid', 'disc']
|
||||
|
|
|
@ -428,15 +428,18 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
pageHeight = $('#page-container').height() - $('#control-bar-view').outerHeight() - $('#playback-view').outerHeight()
|
||||
newWidth = Math.min pageWidth, pageHeight * aspectRatio
|
||||
newHeight = newWidth / aspectRatio
|
||||
else if $('#editor-level-thangs-tab-view')
|
||||
newWidth = $('#canvas-wrapper').width()
|
||||
newHeight = newWidth / aspectRatio
|
||||
else
|
||||
newWidth = 0.55 * pageWidth
|
||||
newHeight = newWidth / aspectRatio
|
||||
@canvas.width newWidth
|
||||
@canvas.height newHeight
|
||||
return unless newWidth > 0 and newHeight > 0
|
||||
#if InstallTrigger? # Firefox rendering performance goes down as canvas size goes up
|
||||
# newWidth = Math.min 924, newWidth
|
||||
# newHeight = Math.min 589, newHeight
|
||||
##if InstallTrigger? # Firefox rendering performance goes down as canvas size goes up
|
||||
## newWidth = Math.min 924, newWidth
|
||||
## newHeight = Math.min 589, newHeight
|
||||
#@canvas.width newWidth
|
||||
#@canvas.height newHeight
|
||||
@canvas.attr width: newWidth, height: newHeight
|
||||
@stage.scaleX *= newWidth / oldWidth
|
||||
@stage.scaleY *= newHeight / oldHeight
|
||||
|
|
|
@ -199,6 +199,7 @@ module.exports = class WizardSprite extends IndieSprite
|
|||
wizard.beginMoveTween()
|
||||
|
||||
endMoveTween: =>
|
||||
return if @destroyed
|
||||
@thang.action = if @editing then 'cast' else 'idle'
|
||||
@thang.actionActivated = @thang.action is 'cast'
|
||||
@reachedTarget = true
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
c = require './../schemas'
|
||||
ThangComponentSchema = require './thang_component'
|
||||
|
||||
ThangTypeSchema = c.object()
|
||||
ThangTypeSchema = c.object default: {kind: 'Misc'}
|
||||
c.extendNamedProperties ThangTypeSchema # name first
|
||||
|
||||
ShapeObjectSchema = c.object {title: 'Shape'},
|
||||
|
@ -144,7 +144,7 @@ _.extend ThangTypeSchema.properties,
|
|||
|
||||
ThangTypeSchema.required = ['kind']
|
||||
|
||||
ThangTypeSchema.default =
|
||||
ThangTypeSchema.default =
|
||||
raw: {}
|
||||
|
||||
ThangTypeSchema.definitions =
|
||||
|
|
|
@ -318,7 +318,6 @@ module.exports = class ThangsTabView extends CocoView
|
|||
physicalConfig = {pos: {x: 10, y: 10, z: 1}}
|
||||
if physicalOriginal = _.find(defaultComponents ? [], original: componentOriginals['physics.Physical'])
|
||||
physicalConfig.pos.z = physicalOriginal.config?.pos?.z ? 1 # Get the z right
|
||||
console.log physicalOriginal, defaultComponents, componentOriginals['physics.Physical'], physicalConfig
|
||||
[
|
||||
{original: componentOriginals['existence.Exists'], majorVersion: 0, config: {}}
|
||||
{original: componentOriginals['physics.Physical'], majorVersion: 0, config: physicalConfig}
|
||||
|
|
Loading…
Reference in a new issue