Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Commit

Permalink
various changes
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Sep 14, 2013
1 parent 296b221 commit 8e63729
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 65 deletions.
10 changes: 6 additions & 4 deletions cc.sh
@@ -1,17 +1,19 @@
IN="storage.js clone.js engine.js audio.js bitmap.js game_objects.js keyboard.js renderer.js util.js schosm.js"
IN="storage.js clone.js engine.js audio.js bitmap.js game_objects.js keyboard.js renderer.js util.js schnosm.js"
OUT="iwbtc-all.js"

ls -l $OUT
ls -lh $OUT

#--compilation_level ADVANCED_OPTIMIZATIONS\

java -jar ~/closure-compiler.jar \
--compilation_level ADVANCED_OPTIMIZATIONS\
--js_output_file $OUT\
--warning_level VERBOSE\
--externs externs.js\
--define=DEBUG=false\
--language_in ECMASCRIPT5_STRICT\
--js $IN


#echo $FILENAME

ls -l $OUT
ls -lh $OUT
13 changes: 9 additions & 4 deletions engine.js
@@ -1,21 +1,28 @@
"use strict";

/** @define */
var DEBUG = true;

/** @const */
var RIGHT = 0,
LEFT = 1;

/** @const */
var NOT_FALLING = 0,
IN_JUMP = 1,
FALLING = 2;


/** @const */
var GAME_WIDTH = 800,
GAME_HEIGHT = 600;

/** @const */
var FIRST_LEVEL = "level1.js",
LEVEL_DIR = "levels/";


/** @const */
var STORAGE_NO_AUDIO = "no_audio",
STORAGE_LEVEL = "last_level",
STORAGE_STATE = "state";
Expand All @@ -25,7 +32,7 @@ window.addEventListener("load", function()
{
var ge = new GameEngine;

if(location.host === "localhost" && window.LevelEditor)
if(DEBUG && location.host === "localhost" && window.LevelEditor)
{
new LevelEditor(ge);
}
Expand Down Expand Up @@ -113,9 +120,7 @@ function GameEngine()
document.getElementById("reset_save").addEventListener("click",
function()
{
self.levelFile = FIRST_LEVEL;
self.storage.removeItem(STORAGE_STATE);
self.loadLevel(FIRST_LEVEL);
self.nextLevel(FIRST_LEVEL);
}, false);


Expand Down
36 changes: 19 additions & 17 deletions index.html
Expand Up @@ -2,15 +2,7 @@
<meta charset="utf-8">
<title>I Wanna Be Thy Copy</title>

<script src="storage.js"></script>
<script src="keyboard.js"></script>
<script src="renderer.js"></script>
<script src="audio.js"></script>
<script src="util.js"></script>
<script src="game_objects.js"></script>
<script src="bitmap.js"></script>
<script src="engine.js"></script>
<script src="schnosm.js"></script>
<script src="iwbtc-all.js"></script>

<link rel="stylesheet" href="style.css">

Expand All @@ -34,12 +26,22 @@ <h3>Thy Copy : Thy Game</h3>
<pre id="warn"></pre>
Default keys (click to change):<br>
<div id="keys">
<span class="link_like" id="change_left">Left Arrow - Move left</span><br>
<span class="link_like" id="change_right">Right Arrow - Move right</span><br>
<span class="link_like" id="change_jump">Space - Jump</span><br>
<span class="link_like" id="change_shoot">T - Shoot</span><br>
<span class="link_like" id="change_restart">R - Restart</span><br>
<span class="link_like" id="change_mute">M - Mute sound</span>
<table>
<tr><td>
<span class="link_like" id="change_left">Left Arrow - Move left</span><br>
</td><td>
<span class="link_like" id="change_jump">Space - Jump</span><br>
</td><td>
<span class="link_like" id="change_restart">R - Restart</span><br>
</td></tr>
<tr><td>
<span class="link_like" id="change_right">Right Arrow - Move right</span><br>
</td><td>
<span class="link_like" id="change_shoot">T - Shoot</span><br>
</td><td>
<span class="link_like" id="change_mute">M - Mute sound</span>
</td></tr>
</table>
</div>
<br>
<div style="display: none" id="press_key_msg">
Expand All @@ -51,8 +53,8 @@ <h3>Thy Copy : Thy Game</h3>

<br><br>
IWBTG was originally created by <a href=http://kayin.pyoko.org/>Kayin</a>, who shall
be worshipped like Zeus for creating the best game ever. <br>
Props also go to Ellipsis and sam136 from the IWBTG forum for ripping
be worshipped for creating <a href=http://kayin.pyoko.org/iwbtg/>the best game ever</a>. <br>
Also props to Ellipsis and sam136 from the IWBTG forum for ripping
the music and images from the original game.
<br>
<br>
Expand Down
29 changes: 0 additions & 29 deletions iwbtc-all.js

This file was deleted.

6 changes: 1 addition & 5 deletions keyboard.js
Expand Up @@ -50,15 +50,11 @@ function KeyboardManager(game)
"undefined",
"Just kidding.",
"Bored?",
"BOred?",
"BORed?",
"BOREd?",
"BORED?",
"Okay ...",
"There once was a girl from Kentucky ..."
][click_count++];

if(click_count === 12)
if(click_count === 8)
{
location.href = "https://www.youtube.com/watch?v=oHg5SJYRHA0";
}
Expand Down
6 changes: 4 additions & 2 deletions schnosm.js
Expand Up @@ -6,7 +6,9 @@

if(code == 0x4c1aa27a8229)
{
ge.nextLevel("2up.js");
localStorage.last_level = '"2up.js"';
localStorage.removeItem("state");
location.reload();
}
});
}, false);
}();
9 changes: 5 additions & 4 deletions style.css
Expand Up @@ -35,16 +35,17 @@ body {
color: green;
}

#keys td {
padding: 3px 15px;
}

#keys {
min-height: 110px;
margin-left: 50px;
margin-top: 10px;
}


#press_key_msg {
height: 70px;
padding-top: 50px;
height: 40px;
margin-left: 50px;
}

0 comments on commit 8e63729

Please sign in to comment.