Skip to content

Commit 7587d4d

Browse files
committed
Added pause menu. Fixed settings. Streamlined actions.
1 parent 7468e86 commit 7587d4d

19 files changed

+447
-161
lines changed

assets/images/back.png

2.71 KB
Loading

assets/images/backHover.png

2.6 KB
Loading
-530 KB
Binary file not shown.
2.53 KB
Loading
2.71 KB
Loading
2.88 KB
Loading
2.99 KB
Loading
1.85 KB
Loading
1.94 KB
Loading
2.11 KB
Loading
2.2 KB
Loading

assets/images/scroll.png

843 KB
Loading
-3.58 KB
Binary file not shown.
-3.34 KB
Binary file not shown.

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<head>
44
<link rel="shortcut icon" href="assets/images/knife.ico">
55
<script type="text/javascript" src="src/crafty 0.5.4.js"></script>
6-
<script type="text/javascript" src="src/components.js"></script>
76
<script type="text/javascript" src="src/scenes.js"></script>
7+
<script type="text/javascript" src="src/components.js"></script>
88
<script type="text/javascript" src="src/main.js"></script>
99
<script>
1010
window.addEventListener('load', Game.start);

src/components.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ var setUpComponents = function(){
1313
volume.music_vol = 1.0
1414
object.tween({w: 200}, 20);
1515
} else if (this._x + 5 > e.realX){
16-
volume.music_vol = 1.0
16+
volume.music_vol = 0
1717
object.tween({w: 0}, 20);
1818
} else {
19-
volume.music_vol = (e.realX-(this._x+10))/200
19+
volume.music_vol = (e.realX-(this._x+5))/200
2020
object.tween({w: e.realX - (this._x + 5)}, 20);
2121
}
22-
Crafty.audio.play("background", -1, change, true)
22+
if (volume.music_vol == 0)
23+
Crafty.audio.stop()
24+
else
25+
Crafty.audio.play("background", -1, volume.music_vol, true)
2326
}
2427
else {
2528
if (this._w + this._x - 5 < e.realX){
@@ -29,7 +32,7 @@ var setUpComponents = function(){
2932
volume.sound_vol = 1.0
3033
object.tween({w: 0}, 20);
3134
} else {
32-
volume.sound_vol = (e.realX-(this._x+10))/200
35+
volume.sound_vol = (e.realX-(this._x+5))/200
3336
object.tween({w: e.realX - (this._x + 5)}, 20);
3437
}
3538
}
@@ -92,7 +95,7 @@ var setUpComponents = function(){
9295
.fourway(3)
9396
.stopOnSolids()
9497
.exitOnDoors()
95-
.attr({z: 3})
98+
.attr({z: 2})
9699
.animate('PlayerMovingUp', 3, 3, 5)
97100
.animate('PlayerMovingRight', 9, 3, 11)
98101
.animate('PlayerMovingDown', 0, 3, 2)
@@ -140,7 +143,7 @@ var setUpComponents = function(){
140143
this.onHit('Door', function(ent){
141144
var door = ent[0].obj;
142145
if (door.contains(this._x+(this._w/2)-5, this._y+(this._h/2)-5, 10, 10)){
143-
Crafty.audio.play("doorSound");
146+
Crafty.audio.play("doorSound", 1, volume.sound_vol, false);
144147
exitLoc = door.at();
145148
load_scene(door.ID, 40);
146149
}

0 commit comments

Comments
 (0)