diff --git a/levels/08_trees.jsx b/levels/08_intoTheWoods.jsx similarity index 97% rename from levels/08_trees.jsx rename to levels/08_intoTheWoods.jsx index 367c1ba1..6cad8749 100644 --- a/levels/08_trees.jsx +++ b/levels/08_intoTheWoods.jsx @@ -8,9 +8,9 @@ } } #END_PROPERTIES# -/************ - * trees.js * - ************ +/******************* + * intoTheWoods.js * + ******************* * * Ah, you're out of the woods now. Or into the woods, as the * case may be. Your function phone may serve you well here. diff --git a/levels/09_river.jsx b/levels/09_fordingTheRiver.jsx similarity index 94% rename from levels/09_river.jsx rename to levels/09_fordingTheRiver.jsx index 9bffb7e0..4820ffc8 100644 --- a/levels/09_river.jsx +++ b/levels/09_fordingTheRiver.jsx @@ -5,8 +5,9 @@ "music": "Spectrofuzz_Sunset_84" } #END_PROPERTIES# -/* - * river.js +/********************** + * fordingTheRiver.js * + ********************** * * And there's the river. Fortunately, I was prepared for this. * See the raft on the other side? diff --git a/levels/14_crispsContest.jsx b/levels/14_crispsContest.jsx index 2179cd3f..28256c1c 100644 --- a/levels/14_crispsContest.jsx +++ b/levels/14_crispsContest.jsx @@ -1,79 +1,22 @@ #BEGIN_PROPERTIES# { - "commandsIntroduced": - ["object.type", "object.behavior", "object.findNearest", - "object.getX", "object.getY", "object.canMove", "object.move"] + } #END_PROPERTIES# -/* - * ambush.js + +/******************** + * crispsContest.js * + ******************** * - * [This one's still in progress.] + * Do you remember, dear Professor, a certain introductary class you taught long ago? + * Perhaps some 'reeducation' is apropos. */ function startLevel(map) { - function moveToward(obj, type) { - var target = obj.findNearest(type); - var leftDist = obj.getX() - target.x; - var upDist = obj.getY() - target.y; - - var direction; - if (upDist > 0 && upDist >= leftDist) { - direction = 'up'; - } else if (upDist < 0 && upDist < leftDist) { - direction = 'down'; - } else if (leftDist > 0 && leftDist >= upDist) { - direction = 'left'; - } else { - direction = 'right'; - } - - if (obj.canMove(direction)) { - obj.move(direction); - } - } - map.placePlayer(2, 2); + map.placePlayer(1, 1); + map.placeObject(map.getWidth()-7, map.getHeight()-5, 'exit'); +} - map.defineObject('attackDrone', { - 'type': 'dynamic', - 'symbol': 'd', - 'color': 'red', - 'onCollision': function (player) { - player.killedBy('an attack drone'); - }, - 'behavior': function (me) { #BEGIN_EDITABLE# - moveToward(me, 'player'); #END_EDITABLE# - } - }); - - map.defineObject('defenseDrone', { - 'type': 'dynamic', - 'symbol': 'd', - 'color': 'green', - 'onCollision': function (player) { - player.killedBy('a defense drone'); - }, - 'behavior': function (me) { -#BEGIN_EDITABLE# - -#END_EDITABLE# - } - }); - - for (var x = 0; x <= 20; x++) { - map.placeObject(x, 20 - x, 'attackDrone'); - } - - for (var x = 30; x < 50; x++) { - map.placeObject(x, 55 - x, 'defenseDrone'); - } - - map.placeObject(map.getWidth()-2, map.getHeight()-2, 'exit'); -} - -function validateLevel(map) { - validateExactlyXManyObjects(map, 1, 'exit'); -} diff --git a/levels/15_exceptionalCrossing.jsx b/levels/15_exceptionalCrossing.jsx index 811de418..5ddb7caf 100644 --- a/levels/15_exceptionalCrossing.jsx +++ b/levels/15_exceptionalCrossing.jsx @@ -4,11 +4,11 @@ "music": "Spectrofuzz_Sunset_84" } #END_PROPERTIES# -/* - * backToTheRiver.js +/************************** + * exceptionalCrossing.js * + ************************** * - * Exceptional deeds can be performed in - * exceptional circumstances. + * [Insert betrayal here] */ function startLevel(map) { diff --git a/levels/16_teleporterCanvasLevel.jsx b/levels/16_pointers.jsx similarity index 85% rename from levels/16_teleporterCanvasLevel.jsx rename to levels/16_pointers.jsx index d3f4ef0d..be8b42ad 100644 --- a/levels/16_teleporterCanvasLevel.jsx +++ b/levels/16_pointers.jsx @@ -4,9 +4,9 @@ } #END_PROPERTIES# -/**************** - * drones101.js * - **************** +/*************** + * pointers.js * + *************** * * Do you remember, dear Professor, a certain introductary class you taught long ago? * Perhaps some 'reeducation' is apropos. @@ -20,4 +20,3 @@ function startLevel(map) { #BEGIN_EDITABLE# #END_EDITABLE# - diff --git a/levels/17_platformer.jsx b/levels/17_superDrEvalBros.jsx similarity index 94% rename from levels/17_platformer.jsx rename to levels/17_superDrEvalBros.jsx index 58cccec2..da71a34f 100644 --- a/levels/17_platformer.jsx +++ b/levels/17_superDrEvalBros.jsx @@ -6,6 +6,14 @@ } } #END_PROPERTIES# + +/********************** + * superDrEvalBros.js * + ********************** + * + * + */ + function startLevel(map) { var fl = Math.floor; diff --git a/levels/18_domManipulation.jsx b/levels/18_domManipulation.jsx index d3f4ef0d..3717426e 100644 --- a/levels/18_domManipulation.jsx +++ b/levels/18_domManipulation.jsx @@ -4,12 +4,11 @@ } #END_PROPERTIES# -/**************** - * drones101.js * - **************** +/********************** + * domManipulation.js * + ********************** + * * - * Do you remember, dear Professor, a certain introductary class you taught long ago? - * Perhaps some 'reeducation' is apropos. */ function startLevel(map) { @@ -20,4 +19,3 @@ function startLevel(map) { #BEGIN_EDITABLE# #END_EDITABLE# - diff --git a/levels/19_bossFight.jsx b/levels/19_bossFight.jsx index d3f4ef0d..3c63ada6 100644 --- a/levels/19_bossFight.jsx +++ b/levels/19_bossFight.jsx @@ -4,12 +4,11 @@ } #END_PROPERTIES# -/**************** - * drones101.js * - **************** +/***************** + * bossFight.js * + ***************** + * * - * Do you remember, dear Professor, a certain introductary class you taught long ago? - * Perhaps some 'reeducation' is apropos. */ function startLevel(map) { @@ -20,4 +19,3 @@ function startLevel(map) { #BEGIN_EDITABLE# #END_EDITABLE# - diff --git a/levels/20_ULTIMA_BOSS_FIGHT.jsx b/levels/20_ULTIMA_BOSS_FIGHT.jsx index d3f4ef0d..d0a69e20 100644 --- a/levels/20_ULTIMA_BOSS_FIGHT.jsx +++ b/levels/20_ULTIMA_BOSS_FIGHT.jsx @@ -4,12 +4,11 @@ } #END_PROPERTIES# -/**************** - * drones101.js * - **************** +/************************ + * ULTIMA_BOSS_FIGHT.js * + ************************ + * * - * Do you remember, dear Professor, a certain introductary class you taught long ago? - * Perhaps some 'reeducation' is apropos. */ function startLevel(map) { @@ -20,4 +19,3 @@ function startLevel(map) { #BEGIN_EDITABLE# #END_EDITABLE# - diff --git a/scripts/game.js b/scripts/game.js index fe0d0e39..4cb655c5 100644 --- a/scripts/game.js +++ b/scripts/game.js @@ -20,18 +20,18 @@ function Game(debugMode) { '05_minesweeper.jsx', '06_drones101.jsx', '07_colors.jsx', - '08_trees.jsx', - '09_river.jsx', + '08_intoTheWoods.jsx', + '09_fordingTheRiver.jsx', '10_ambush.jsx', '11_robot.jsx', '12_robotNav.jsx', '13_robotMaze.jsx', '14_crispsContest.jsx', '15_exceptionalCrossing.jsx', - '16_teleporterCanvasLevel.jsx', - '17_platformer.jsx', + '16_pointers.jsx', + '17_superDrEvalBros.jsx', '18_domManipulation.jsx', - '19_boss_fight.jsx', + '19_bossFight.jsx', '20_ULTIMA_BOSS_FIGHT.jsx', '99_credits.jsx' ]; diff --git a/scripts/objects.js b/scripts/objects.js index 698356a7..888ed919 100644 --- a/scripts/objects.js +++ b/scripts/objects.js @@ -33,7 +33,7 @@ Game.prototype.objects = { 'block': { 'symbol': '#', - 'color': '#f00', + 'color': '#999', 'impassable': true },