This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const door = Machine({ | |
id: 'door', | |
initial: 'locked', | |
states: { | |
locked: { | |
id: 'locked', | |
on: { UNLOCK: 'unlocked' } | |
}, | |
unlocked: { | |
initial: 'closed', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Search for this/self in level code / solutions | |
// Prints the level slug if this or self is still present. | |
// NOTE: add/change this campaign slug array as needed | |
var campaignSlug = ['intro','course-2','course-3','course-4']; | |
print("Levels that still need converting to hero:"); | |
campaignSlug.forEach(function(slug) { | |
print("*** " + slug + " ***"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(currentView) { | |
var thangs = currentView.level.get('thangs'); | |
// **** Change sample code and solutions **** // | |
// Search level thangs | |
for(var i=0; i < thangs.length; i++) { | |
var thang = thangs[i]; | |
// Search thang components | |
if(thang.components) { | |
for(var j=0; j < thang.components.length; j++) { | |
var component = thang.components[j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(currentView) { | |
var thangs = currentView.level.get('thangs'); | |
var refereeThang = null; | |
for(var i=0; i < thangs.length; i++) { | |
var thang = thangs[i]; | |
if(thang.components) { | |
for(var j=0; j < thang.components.length; j++) { | |
var component = thang.components[j]; | |
if(component.config && component.config.extraCode) { | |
refereeThang = thang; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node script to download the Code Combat systems source | |
var http = require('http'); | |
var fs = require('fs'); | |
var componentDir = __dirname+'/systems'; | |
// Make sure the components directory exists | |
try { | |
fs.mkdirSync(componentDir); | |
} catch(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node script to download the Code Combat component source | |
var https = require('https'); | |
var fs = require('fs'); | |
var componentDir = __dirname+'/components'; | |
// Make sure the components directory exists | |
try { | |
fs.mkdirSync(componentDir); | |
} catch(e) { |