Permalink
Browse files

fixes

  • Loading branch information...
1 parent 6e665dc commit 3563114e989a019ddf9c0539a734f972a4502b20 @playerx playerx committed Feb 26, 2014
@@ -9,14 +9,15 @@ img {
}
#Root {
- width: 900px;
+ width: 1024px;
margin-left: auto;
margin-right: auto;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
+ overflow: hidden;
}
#Container {
@@ -27,8 +28,8 @@ img {
#Game {
background: black url('/Images/background.jpg') center center no-repeat;
background-size: 100%;
- width: 900px;
- height: 675px;
+ width: 1024px;
+ height: 768px;
box-shadow: inset 0 0 10px black;
margin-left: auto;
margin-right: auto;
@@ -37,8 +37,8 @@ var Game = {
// Stage
var stage = new Kinetic.Stage({
container: 'Container',
- width: 900,
- height: 675
+ width: 1024,
+ height: 768
});
@@ -52,8 +52,8 @@ var Game = {
img.src = RootUrl + '/Images/user_avatar_hp_5.png';
this.userImg = new Kinetic.Image({
- x: 175,
- y: 340,
+ x: 200,
+ y: 360,
image: img,
width: 100,
height: 157,
@@ -64,14 +64,14 @@ var Game = {
// Tribuna Image
var img2 = new Image();
- img2.src = RootUrl + '/Images/gift-package.png';
+ img2.src = RootUrl + '/Images/tribuna.png';
var tribunaImg = new Kinetic.Image({
- x: 0,
- y: 0,
+ x: 137,
+ y: 380,
image: img2,
- width: stage.width(),
- height: stage.height()
+ width: 117.248,
+ height: 196.608
});
this.canvasLayer.add(tribunaImg);
tribunaImg.moveToTop();
@@ -86,15 +86,15 @@ var Game = {
var left = Game.userImg.getPosition().x;
if (e.keyCode == 37) { // left
- if (left < 150)
+ if (left < 160)
return;
Game.userImg.setPosition({ x: left - 20 });
//$('#Game .user_avatar').css('left', left - 10);
}
if (e.keyCode == 39) { // right
- if (left > 690)
+ if (left > 800)
return;
Game.userImg.setPosition({ x: left + 20 });
@@ -204,7 +204,7 @@ var Game = {
var left = Game.userImg.getPosition().x;
- if (left + eventData.rotationRate.alpha < 150 || left + eventData.rotationRate.alpha > 690) return;
+ if (left + eventData.rotationRate.alpha < 160 || left + eventData.rotationRate.alpha > 800) return;
Game.userImg.setPosition({ x: left + eventData.rotationRate.alpha });
},
@@ -235,7 +235,7 @@ var Game = {
autoFireTomato: function () {
var x = ($('#Game').width() - 200) * Math.random() + 100;
- var y = ($('#Game').height() - 600) * Math.random() + 300;
+ var y = ($('#Game').height() - 600) * Math.random() + 270;
var tomatosCount = $('#Game .balance span').html();
@@ -262,7 +262,7 @@ var Game = {
fxSplashPlay: function () {
if (window.JM && window.JM.playAudio) {
- window.JM.playAudio('/Audio/splash.wav');
+ window.JM.playAudio('audio/splash.wav');
return;
}
@@ -272,13 +272,13 @@ var Game = {
fxMissPlay: function () {
- var url = (Math.floor((Math.random() * 10)) == 0) ? '/Audio/miss2.mp3' : '/Audio/miss2.mp3';
-
if (window.JM && window.JM.playAudio) {
- window.JM.playAudio(url);
+ window.JM.playAudio('audio/miss2.mp3');
return;
}
+ var url = (Math.floor((Math.random() * 10)) == 0) ? '/Audio/miss2.mp3' : '/Audio/miss2.mp3';
+
var audio = new Audio(url);
audio.volume = .4;
audio.play();
@@ -371,10 +371,6 @@ var Game = {
_this.userImg.setImage(newImg);
};
- if (count <= 0) {
- this.finishGame(true);
- }
-
} else {
clearTimeout(_this.tomatoFireHandler);
_this.finishGame(false);
@@ -400,6 +396,10 @@ var Game = {
}).play();
}
+
+ if ($('#Game .balance span').html() <= 0) {
+ _this.finishGame(true);
+ }
}
}).play();
View
No changes.
View
No changes.
View
No changes.
No changes.
No changes.
No changes.
View
No changes.
No changes.
No changes.
No changes.
No changes.
View
No changes.
View
No changes.
View
No changes.

0 comments on commit 3563114

Please sign in to comment.