Skip to content

Commit

Permalink
plenty of bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hossamahamid committed Mar 8, 2015
1 parent 15aba29 commit 05ed26c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h1 id="logo"><a href="index.html">Dumb Ways To Die</a></h1>
<div class="container" style="height: 525px ;width: 750px;">
<header class="major">
<h2>Dumb Ways To Die</h2>
<p>JavaScript Project powerd by phaser game engine </p>
<p>JavaScript Project powered by phaser game engine </p>
<div id="gameDiv" align="center" ></div>
</header>
</div>
Expand Down
21 changes: 10 additions & 11 deletions stages/killThatDear.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@

var killThatDearStage = {
changeCut: true,
cutX: 0,
cutY: 0,
cutNumber: 0,
cutCount: 1,

letters: ['Q', 'A', 'L', 'H','B','R','I', 'P'],

preload: function(){
game.load.image('cut', 'assets/killThatDear/cut.png');
Expand All @@ -15,7 +8,14 @@ var killThatDearStage = {

create: function(){
game.stage.backgroundColor = "#89d14f";

this.letters = ['Q', 'A', 'L', 'H','B','R','I', 'P'];
this.win = false;
this.changeCut = true;
this.cutX = 0;
this.cutY = 0;
this.cutNumber = 0;
this.cutCount = 0;

game.physics.startSystem(Phaser.Physics.ARCADE);

Expand Down Expand Up @@ -67,11 +67,9 @@ var killThatDearStage = {

this.bloodTimer.start();

this.cutKeyChar = this.letters[game.rnd.integerInRange(0, globals.stages.length - 1)];

//this.cutKeyChar = game.rnd.integerInRange(65, 90);
this.cutKeyChar = this.letters[game.rnd.integerInRange(0, this.letters.length - 1)];
console.log(this.cutKeyChar);

//var cutChar = String.fromCharCode(this.cutKeyChar);

var cutKey = game.add.text(this.cutX, this.cutY, this.cutKeyChar, style);

Expand Down Expand Up @@ -164,6 +162,7 @@ var killThatDearStage = {
}
else{
globals.score -= 50;
globals.lives--;
game.state.start('scoreStage');
}
},
Expand Down
4 changes: 2 additions & 2 deletions stages/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ game.state.add('killThatDear', killThatDearStage);
// globals
var globals = {
// add your stage to this stages array to make the game choose randomly from it
stages: ['electricityStage', 'forkStage', 'runningStage', 'spaceStage', 'trainStage', 'waspsStage','dontPressTheButtonStage', 'pokeTheBearStage', 'killThatDear'],
//stages: ['dontPressTheButtonStage'],
stages: ['electricityStage', 'killThatDear', 'forkStage', 'runningStage', 'spaceStage', 'trainStage', 'waspsStage','dontPressTheButtonStage', 'pokeTheBearStage'],
//stages: ['killThatDear'],
score: 0,
lives: 3 ,
duration : 5,
Expand Down
1 change: 1 addition & 0 deletions stages/poke.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ var pokeTheBearStage = {
}
else{
globals.score -= 50;
globals.lives --;
game.state.start('scoreStage');
}
},
Expand Down

0 comments on commit 05ed26c

Please sign in to comment.