Skip to content

Commit

Permalink
quick fix, adding Fork Me on Github link, removing cheat now that the…
Browse files Browse the repository at this point in the history
… presentation is over
  • Loading branch information
AlexNisnevich committed Mar 9, 2013
1 parent f8fd254 commit 0d93379
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<link rel="stylesheet" href="styles/game.css">
</head>
<body onload="init()">
<a href="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/AlexNisnevich/untrusted" target="_blank"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 9999;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
<div id="container">
<div>
<h1>Untrusted</h1>
Expand Down
13 changes: 8 additions & 5 deletions scripts/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,12 @@ function loadLevel(lvlCode, lvlNum) {
return code;
}

// start the level
// start the level and fade in
evalLevelCode(lvlNum);
if (lvlNum < levelFileNames.length) {
// don't fade in for dummy level
display.fadeIn(map);
}

// on first level, display intro text
if (currentLevel == 0) {
Expand All @@ -219,11 +223,11 @@ function evalLevelCode(lvlNum) {
if (validatedStartLevel) {
map.reset();
validatedStartLevel(map);
if (lvlNum < levelFileNames.length) {
if (lvlNum >= levelFileNames.length) {
// don't do this for dummy level
display.drawAll(map);
display.fadeIn(map);
return;
}
display.drawAll(map);
}
}

Expand All @@ -240,4 +244,3 @@ shortcut.add('ctrl+2', focusOnEditor);
shortcut.add('ctrl+4', resetEditor);
shortcut.add('ctrl+5', evalLevelCode);
shortcut.add('ctrl+6', usePhone);
shortcut.add('ctrl+0', moveToNextLevel);

0 comments on commit 0d93379

Please sign in to comment.