Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-12-10 10:01:52 -08:00
commit ae7e84e11b
14 changed files with 94 additions and 44 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

View file

@ -1,31 +1,31 @@
SpriteBuilder = require 'lib/sprites/SpriteBuilder'
floors = ['Dungeon Floor', 'Indoor Floor', 'Grass', 'Grass01', 'Grass02', 'Grass03', 'Grass04', 'Grass05', 'Goal Trigger', 'Obstacle']
floors = ['Dungeon Floor', 'Indoor Floor', 'Grass', 'Grass01', 'Grass02', 'Grass03', 'Grass04', 'Grass05', 'Goal Trigger', 'Obstacle', 'Sand 01', 'Sand 02', 'Sand 03', 'Sand 04', 'Sand 05', 'Sand 06']
module.exports = class SingularSprite extends createjs.Sprite
childMovieClips: null
constructor: (@spriteSheet, @thangType, @spriteSheetPrefix, @resolutionFactor=SPRITE_RESOLUTION_FACTOR) ->
super(@spriteSheet)
destroy: ->
destroy: ->
@removeAllEventListeners()
gotoAndPlay: (actionName) -> @goto(actionName, false)
gotoAndStop: (actionName) -> @goto(actionName, true)
_gotoAndPlay: createjs.Sprite.prototype.gotoAndPlay
_gotoAndStop: createjs.Sprite.prototype.gotoAndStop
goto: (actionName, @paused=true) ->
@actionNotSupported = false
action = @thangType.getActions()[actionName]
randomStart = actionName.startsWith('move')
reg = action.positions?.registration or @thangType.get('positions')?.registration or {x:0, y:0}
if action.animation
@framerate = (action.framerate ? 20) * (action.speed ? 1)
func = if @paused then '_gotoAndStop' else '_gotoAndPlay'
animationName = @spriteSheetPrefix + actionName
@[func](animationName)
@ -73,6 +73,6 @@ module.exports = class SingularSprite extends createjs.Sprite
@baseScaleY = @scaleY
@currentAnimation = actionName
return
notifyActionNeedsRender: (action) ->
@lank?.trigger('action-needs-render', @lank, action)
@lank?.trigger('action-needs-render', @lank, action)

View file

@ -69,6 +69,7 @@
change_hero: "Change Hero" # Go back from choose inventory to choose hero
choose_inventory: "Equip Items"
buy_gems: "Buy Gems"
campaign_desert: "Desert Campaign"
campaign_forest: "Forest Campaign"
campaign_dungeon: "Dungeon Campaign"
subscription_required: "Subscription Required"

View file

@ -9,6 +9,7 @@ module.exports = class Level extends CocoModel
@levels:
'dungeons-of-kithgard': '5411cb3769152f1707be029c'
'defense-of-plainswood': '541b67f71ccc8eaae19f3c62'
'the-mighty-sand-yak': '5480b9d01bf0b10000711c5f'
urlRoot: '/db/level'
serialize: (supermodel, session, otherSession, cached=false) ->

View file

@ -143,7 +143,7 @@ me.getLanguageCodeArray = ->
return Language.languageCodes
me.getLanguagesObject = -> return Language
me.extendTranslationCoverageProperties = (schema) ->
schema.properties = {} unless schema.properties?
schema.properties.i18nCoverage = { title: 'i18n Coverage', type: 'array', items: { type: 'string' }}
@ -207,7 +207,7 @@ me.activity = me.object {description: 'Stats on an activity'},
last: me.date()
count: {type: 'integer', minimum: 0}
me.terrainString = me.shortString {enum: ['Grass', 'Dungeon', 'Indoor'], title: 'Terrain', description: 'Which terrain type this is.'}
me.terrainString = me.shortString {enum: ['Grass', 'Dungeon', 'Indoor', 'Desert'], title: 'Terrain', description: 'Which terrain type this is.'}
me.HeroConfigSchema = me.object {description: 'Which hero the player is using, equipped with what inventory.'},
inventory:

View file

@ -118,11 +118,15 @@
position: absolute
.left-wing
@include wing-background('/images/level/loading_left_wing.png', right)
@include wing-background('/images/level/loading_left_wing_1920.jpg', right)
@media screen and ( max-width: 1366px )
@include wing-background('/images/level/loading_left_wing_1366.jpg', right)
left: -50%
@include transition(all $UNVEIL_TIME ease)
.right-wing
@include wing-background('/images/level/loading_right_wing.png', left)
@include wing-background('/images/level/loading_right_wing_1920.jpg', left)
@media screen and ( max-width: 1366px )
@include wing-background('/images/level/loading_right_wing_1366.jpg', left)
right: -50%
@include transition(all $UNVEIL_TIME ease)

View file

@ -4,6 +4,9 @@
$mapHeight: 1536
$forestMapWidth: 2500
$dungeonMapWidth: 2350
$desertMapWidth: 2350
$desertMapSeaBackground: rgba(113, 186, 208, 1)
$desertMapSeaBackgroundTransparent: rgba(113, 186, 208, 0)
$forestMapSeaBackground: rgba(113, 186, 208, 1)
$forestMapSeaBackgroundTransparent: rgba(113, 186, 208, 0)
$dungeonMapCaveBackground: rgba(68, 54, 45, 1)
@ -60,6 +63,21 @@ $gameControlMargin: 30px
&.left-gradient
left: 0
&.desert
background-color: $desertMapSeaBackground
.top-gradient
background: linear-gradient(to bottom, $desertMapSeaBackground 0%, $desertMapSeaBackgroundTransparent 100%)
.right-gradient
background: linear-gradient(to left, $desertMapSeaBackground 0%, $desertMapSeaBackgroundTransparent 100%)
.bottom-gradient
background: linear-gradient(to top, $desertMapSeaBackground 0%, $desertMapSeaBackgroundTransparent 100%)
.left-gradient
background: linear-gradient(to right, $desertMapSeaBackground 0%, $desertMapSeaBackgroundTransparent 100%)
&.forest
background-color: $forestMapSeaBackground
@ -96,7 +114,23 @@ $gameControlMargin: 30px
.map-background
width: 100%
height: 100%
background-size: 100%
@include user-select(none)
&.map-dungeon
background-image: url('/images/pages/play/map_dungeon_1920.jpg')
@media screen and ( max-width: 1366px )
background-image: url('/images/pages/play/map_dungeon_1366.jpg')
&.map-forest
background-image: url('/images/pages/play/map_forest_1920.jpg')
@media screen and ( max-width: 1366px )
background-image: url('/images/pages/play/map_forest_1366.jpg')
&.map-desert
background-image: url('/images/pages/play/map_desert_1920.jpg')
@media screen and ( max-width: 1366px )
background-image: url('/images/pages/play/map_desert_1366.jpg')
.level, .level-shadow
position: absolute
@ -259,6 +293,16 @@ $gameControlMargin: 30px
&:hover
text-decoration: none
&#desert-link
left: 90%
top: 18.5%
transform: scaleY(-1.5) scaleX(1.5)
&#forest-back-link
left: 4%
top: 74.5%
transform: rotate(216deg)
&#forest-link
left: 94.5%
top: 7%

View file

@ -2,7 +2,7 @@ extends /templates/core/modal-base
block modal-header-content
#victory-header.out
#victory-title
if me.get('preferredLanguage') && me.get('preferredLanguage').split('-')[0] == 'en'
if !me.get('preferredLanguage') || me.get('preferredLanguage').split('-')[0] == 'en'
img(src="/images/pages/play/level/modal/victory_word.png", draggable="false")
else
h1(data-i18n="play_level.victory") Victory

View file

@ -3,7 +3,7 @@
.gradient.vertical-gradient.right-gradient
.gradient.horizontal-gradient.bottom-gradient
.gradient.vertical-gradient.left-gradient
img.map-background(src="/images/pages/play/map_" + mapType + ".jpg", alt="", draggable="false")
.map-background(class="map-"+mapType alt="", draggable="false")
- var seenNext = nextLevel;
each level in campaign.levels
@ -44,6 +44,11 @@
a#forest-link.glyphicon.glyphicon-share-alt.campaign-switch(href="/play/forest", data-i18n="[title]play.campaign_forest")
if mapType === 'forest'
a#dungeon-link.glyphicon.glyphicon-share-alt.campaign-switch(href="/play/dungeon", data-i18n="[title]play.campaign_dungeon")
if desertIsAvailable
a#desert-link.glyphicon.glyphicon-share-alt.campaign-switch(href="/play/desert", data-i18n="[title]play.campaign_desert")
if mapType === 'desert'
a#forest-back-link.glyphicon.glyphicon-share-alt.campaign-switch(href="/play/forest", data-i18n="[title]play.campaign_forest")
.game-controls.header-font
button.btn.items(data-toggle='coco-modal', data-target='play/modal/PlayItemsModal', data-i18n="[title]play.items")

View file

@ -434,7 +434,7 @@ module.exports = class ThangTypeEditView extends RootView
@lastKind = kind
Backbone.Mediator.publish 'editor:thang-type-kind-changed', kind: kind
if kind in ['Doodad', 'Floor', 'Wall'] and not @treema.data.terrains
@treema.set '/terrains', ['Grass', 'Dungeon', 'Indoor'] # So editors know to set them.
@treema.set '/terrains', ['Grass', 'Dungeon', 'Indoor', 'Desert'] # So editors know to set them.
onSelectNode: (e, selected) =>
selected = selected[0]

View file

@ -41,7 +41,7 @@ module.exports = class WorldMapView extends RootView
constructor: (options, @terrain) ->
if options and application.isIPAdApp # TODO: later only clear the SuperModel if it has received a memory warning (not in app store yet)
options.supermodel = null
@terrain ?= 'dungeon' # or 'forest'
@terrain ?= 'dungeon' # or 'forest', 'desert'
super options
@nextLevel = @getQueryVariable 'next'
@levelStatusMap = {}
@ -154,6 +154,7 @@ module.exports = class WorldMapView extends RootView
context.mapType = _.string.slugify @terrain
context.nextLevel = @nextLevel
context.forestIsAvailable = @startedForestLevel or (Level.levels['defense-of-plainswood'] in (me.get('earned')?.levels or []))
context.desertIsAvailable = @startedDesertLevel or (Level.levels['the-mighty-sand-yak'] in (me.get('earned')?.levels or []))
context.requiresSubscription = @requiresSubscription
context
@ -191,9 +192,11 @@ module.exports = class WorldMapView extends RootView
onSessionsLoaded: (e) ->
forestLevels = (f.id for f in forest)
desertLevels = (f.id for f in desert)
for session in @sessions.models
@levelStatusMap[session.get('levelID')] = if session.get('state')?.complete then 'complete' else 'started'
@startedForestLevel = true if session.get('levelID') in forestLevels
@startedDesertLevel = true if session.get('levelID') in desertLevels
if @nextLevel and @levelStatusMap[@nextLevel] is 'complete'
@nextLevel = null
@render()
@ -282,7 +285,7 @@ module.exports = class WorldMapView extends RootView
onWindowResize: (e) =>
mapHeight = iPadHeight = 1536
mapWidth = if @terrain is 'dungeon' then 2350 else 2500
mapWidth = {dungeon: 2350, forest: 2500, desert: 2350}[@terrain] or 2350
aspectRatio = mapWidth / mapHeight
pageWidth = $(window).width()
pageHeight = $(window).height()
@ -303,7 +306,7 @@ module.exports = class WorldMapView extends RootView
playAmbientSound: ->
return if @ambientSound
return unless file = {dungeon: 'ambient-dungeon', forest: 'ambient-map-grass'}[@terrain]
return unless file = {dungeon: 'ambient-dungeon', forest: 'ambient-map-grass', desert: 'ambient-desert'}[@terrain]
src = "/file/interface/#{file}#{AudioPlayer.ext}"
unless AudioPlayer.getStatus(src)?.loaded
AudioPlayer.preloadSound src
@ -647,7 +650,6 @@ forest = [
continue: 'patrol-buster'
x: 24
y: 35
adventurer: true
}
{
name: 'Patrol Buster'
@ -659,6 +661,7 @@ forest = [
continue: 'thornbush-farm'
x: 34
y: 25
adventurer: true
}
{
name: 'Endangered Burl'
@ -813,7 +816,6 @@ forest = [
continue: 'touch-of-death'
x: 47
y: 71
adventurer: true
requiresSubscription: true
}
{
@ -826,7 +828,6 @@ forest = [
continue: 'bonemender'
x: 52
y: 70
adventurer: true
requiresSubscription: true
}
{
@ -839,7 +840,6 @@ forest = [
continue: 'coinucopia'
x: 58
y: 67
adventurer: true
requiresSubscription: true
}
@ -872,7 +872,7 @@ forest = [
original: '54626472f3c64b7b0598590c'
description: 'This level exercises: flag position, object members.'
nextLevels:
continue: 'deadly-pursuit'
continue: 'rich-forager'
x: 65.5
y: 91
}
@ -895,11 +895,9 @@ forest = [
original: '546283ddfdd66af405fa8209'
description: 'This level exercises: if/else if, collection, combat.'
nextLevels:
continue: 'multiplayer-treasure-grove'
continue: 'siege-of-stonehold'
x: 80
y: 88
adventurer: true
requiresSubscription: true
}
{
name: 'Siege of Stonehold'
@ -923,7 +921,6 @@ forest = [
description: 'Mix collection, flags, and combat in this multiplayer coin-gathering arena.'
x: 56.5
y: 20
adventurer: true
}
{
name: 'Dueling Grounds'
@ -935,7 +932,9 @@ forest = [
y: 23
adventurer: true
}
]
desert = [
{
name: 'The Dunes'
type: 'hero'
@ -945,8 +944,8 @@ forest = [
nextLevels:
continue: 'the-mighty-sand-yak'
disabled: not me.isAdmin()
x: 88.66
y: 62.61
x: 8.47
y: 21.93
adventurer: true
requiresSubscription: true
}
@ -955,38 +954,34 @@ forest = [
type: 'hero'
id: 'the-mighty-sand-yak'
original: '5480b9d01bf0b10000711c5f'
description: 'In addition to sand, there are also yaks. Sandy yaks. Yak attack, back to back, man that\'s whack.'
description: 'Test your nerves by dodging huge sand yaks on the open dunes!'
nextLevels:
continue: 'oasis'
disabled: not me.isAdmin()
x: 81.00
y: 55.37
x: 16.56
y: 27.77
adventurer: true
requiresSubscription: true
requiresSubscription: false
}
{
name: 'Oasis'
type: 'hero'
id: 'oasis'
original: '5480ba761bf0b10000711c64'
description: 'There is a bit of water in the desert, too. Probably.'
description: 'Run a gauntlet of sand yaks to reach oasis and quench your thirst!'
#nextLevels:
# continue: ''
disabled: not me.isAdmin()
x: 92.56
y: 40.88
x: 23.35
y: 31.60
adventurer: true
requiresSubscription: true
requiresSubscription: false
}
]
WorldMapView.campaigns = campaigns = [
#{id: 'beginner', name: 'Beginner Campaign', description: '... in which you learn the wizardry of programming.', levels: tutorials, color: "rgb(255, 80, 60)"}
#{id: 'multiplayer', name: 'Multiplayer Arenas', description: '... in which you code head-to-head against other players.', levels: arenas, color: "rgb(80, 5, 60)"}
#{id: 'dev', name: 'Random Harder Levels', description: '... in which you learn the interface while doing something a little harder.', levels: experienced, color: "rgb(80, 60, 255)"}
#{id: 'classic_algorithms' ,name: 'Classic Algorithms', description: '... in which you learn the most popular algorithms in Computer Science.', levels: classicAlgorithms, color: "rgb(110, 80, 120)"}
#{id: 'player_created', name: 'Player-Created', description: '... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>.', levels: playerCreated, color: "rgb(160, 160, 180)"}
{id: 'dungeon', name: 'Dungeon Campaign', levels: dungeon }
{id: 'forest', name: 'Forest Campaign', levels: forest }
{id: 'desert', name: 'Desert Campaign', levels: desert }
]