diff --git a/README.md b/README.md
index 0957f2c..52a87bd 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,8 @@
Towerman
========
-Pacman
+ A game like Pac-man, made with the Quintus HTML5 Game Framework
+
+ 
+
+ [Play a live version here](http://towermancoderdojo.azurewebsites.net/final/)
diff --git a/Web.config b/Web.config
new file mode 100644
index 0000000..74f799b
--- /dev/null
+++ b/Web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/final/data/level.json b/final/data/level.json
index cfe768a..c65ec5a 100644
--- a/final/data/level.json
+++ b/final/data/level.json
@@ -1,16 +1,16 @@
[
-[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
-[ 1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1],
-[ 1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1],
-[ 1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1],
-[ 1,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1],
-[ 1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1],
-[ 1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1],
-[ 1,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,1,0,1],
-[ 1,1,1,0,1,1,1,0,1,1,0,1,1,0,0,0,0,1,0,1],
-[ 1,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,0,1,0,1],
-[ 1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,1],
-[ 1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,0,1,0,1],
-[ 1,2,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,2,1],
-[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+[ 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],
+[ 2,1,2,1,1,1,1,1,1,1,1,1,1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,0,0,0,0,0,0,0,0,1,0,1],
+[ 1,0,1,0,1,1,0,1,1,1,1,1,1,0,1,1,0,1,0,1],
+[ 1,0,0,2,0,0,0,1,0,2,0,0,1,0,0,0,0,0,0,1],
+[ 1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1],
+[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+]
\ No newline at end of file
diff --git a/final/data/levelbonus.json b/final/data/levelbonus.json
new file mode 100644
index 0000000..88345d9
--- /dev/null
+++ b/final/data/levelbonus.json
@@ -0,0 +1,16 @@
+[
+[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+[ 1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+[ 1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1],
+[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+]
\ No newline at end of file
diff --git a/final/images/sprites.png b/final/images/sprites.png
index 0521f2f..4d384d1 100644
Binary files a/final/images/sprites.png and b/final/images/sprites.png differ
diff --git a/final/images/sprites2.png b/final/images/sprites2.png
new file mode 100644
index 0000000..5821bab
Binary files /dev/null and b/final/images/sprites2.png differ
diff --git a/final/tower_man.js b/final/tower_man.js
index 0d425f4..b141cf3 100644
--- a/final/tower_man.js
+++ b/final/tower_man.js
@@ -1,11 +1,11 @@
-
+//Not sure if it worked
// 1. Wait for the onload even
window.addEventListener("load",function() {
// Set up a basic Quintus object
// with the necessary modules and controls
var Q = window.Q = Quintus({ development: true })
- .include("Sprites, Scenes, Input, 2D")
+ .include("Sprites, Scenes, Input, 2D, UI")
.setup({ width: 640, height: 480 })
.controls(true)
@@ -13,6 +13,8 @@
// along with joypad controls for touch
Q.input.keyboardControls();
Q.input.joypadControls();
+ Q.state.reset({ score: 0, lives: 2, stage: 1});
+ console.log(Q.state.get("score"));
Q.gravityX = 0;
Q.gravityY = 0;
@@ -73,7 +75,19 @@
}
});
-
+ Q.UI.Text.extend("Score", {
+ init: function(p) {
+ this._super({
+ label: "Score: 0",
+ x:100,
+ y:20
+ });
+ Q.state.on("change.score",this,"scoreChange");
+ },
+ scoreChange: function(score) {
+ this.p.label = "Score: " + score;
+ }
+ });
Q.Sprite.extend("Player", {
init: function(p) {
@@ -84,7 +98,7 @@
});
this.add("2d, towerManControls");
- }
+ }
});
@@ -109,9 +123,10 @@
// Destroy it and keep track of how many dots are left
this.destroy();
this.stage.dotCount--;
+ Q.state.inc("score",100);
// If there are no more dots left, just restart the game
if(this.stage.dotCount == 0) {
- Q.stageScene("level1");
+ Q.stageScene("level2");
}
},
@@ -141,8 +156,8 @@
}
Q.TileLayer.extend("TowerManMap",{
- init: function(p) {
- this._super(p,{
+ init: function() {
+ this._super({
type: SPRITE_TILES,
dataAsset: 'level.json',
sheet: 'tiles',
@@ -169,7 +184,35 @@
}
});
+ Q.TileLayer.extend("TowerManMap2",{
+ init: function() {
+ this._super({
+ type: SPRITE_TILES,
+ dataAsset: 'level2.json',
+ sheet: 'tiles',
+ });
+ },
+
+ setup: function() {
+ // Clone the top level arriw
+ var tiles = this.p.tiles = this.p.tiles.concat();
+ var size = this.p.tileW;
+ for(var y=0;y