Skip to content

Commit

Permalink
renaming things
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNisnevich committed Nov 15, 2013
1 parent a4be201 commit 109755f
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 104 deletions.
6 changes: 3 additions & 3 deletions levels/08_trees.jsx → levels/08_intoTheWoods.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions levels/09_river.jsx → levels/09_fordingTheRiver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
77 changes: 10 additions & 67 deletions levels/14_crispsContest.jsx
Original file line number Diff line number Diff line change
@@ -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');
}
8 changes: 4 additions & 4 deletions levels/15_exceptionalCrossing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -20,4 +20,3 @@ function startLevel(map) {

#BEGIN_EDITABLE#
#END_EDITABLE#

8 changes: 8 additions & 0 deletions levels/17_platformer.jsx → levels/17_superDrEvalBros.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
}
}
#END_PROPERTIES#

/**********************
* superDrEvalBros.js *
**********************
*
*
*/

function startLevel(map) {

var fl = Math.floor;
Expand Down
10 changes: 4 additions & 6 deletions levels/18_domManipulation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -20,4 +19,3 @@ function startLevel(map) {

#BEGIN_EDITABLE#
#END_EDITABLE#

10 changes: 4 additions & 6 deletions levels/19_bossFight.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -20,4 +19,3 @@ function startLevel(map) {

#BEGIN_EDITABLE#
#END_EDITABLE#

10 changes: 4 additions & 6 deletions levels/20_ULTIMA_BOSS_FIGHT.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -20,4 +19,3 @@ function startLevel(map) {

#BEGIN_EDITABLE#
#END_EDITABLE#

10 changes: 5 additions & 5 deletions scripts/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
];
Expand Down
2 changes: 1 addition & 1 deletion scripts/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Game.prototype.objects = {

'block': {
'symbol': '#',
'color': '#f00',
'color': '#999',
'impassable': true
},

Expand Down

0 comments on commit 109755f

Please sign in to comment.