Skip to content

Commit

Permalink
Getting rid of clay stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
prtksxna committed Aug 24, 2013
1 parent 54dde24 commit 4007aaa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 88 deletions.
21 changes: 0 additions & 21 deletions index.html
Expand Up @@ -7,21 +7,6 @@
<script type="text/javascript" src="res/js/game.js"></script>
<script type="text/javascript" src="res/js/player.js"></script>
<script type="text/javascript" src="res/js/button.js"></script>

<script type="text/javascript">
var Clay = Clay || {};
Clay.gameKey = "vertigo";
Clay.readyFunctions = [];
Clay.ready = function( fn ) {
Clay.readyFunctions.push( fn );
// Clay.options = { debug: true };
};
( function() {
var clay = document.createElement("script");
clay.src = ( "https:" == document.location.protocol ? "https://" : "http://" ) + "clay.io/api/api.js";
var tag = document.getElementsByTagName("script")[0]; tag.parentNode.insertBefore(clay, tag);
} )();
</script>
</head>
<body>
<div class="hidden">
Expand All @@ -44,12 +29,6 @@
</div>

<div id="container"></div>
<div id="menu">
<!-- <img src="res/img/ic_twitter.gif" id="ic_twitter">
<img src="res/img/ic_facebook.gif" id="ic_facebook">-->
<img src="res/img/ic_hiscore.png" id="ic_hiscore">
</div>

<audio height="100" width="100" id="jump_sound" src="res/ogg/jump.ogg">
<source src="res/ogg/jump.ogg" type="audio/ogg">
</audio>
Expand Down
30 changes: 0 additions & 30 deletions res/js/button.js
Expand Up @@ -113,37 +113,7 @@ var Button = function(game,y){
}

this.game.points += (this.h * 10) + ((this.combo_hits ^ 2) * 10);
// this.destroy();
this.is_taken = true;

// Achievements
/* if(this.game.combo_hits == 5){
a = new Clay.Achievement({id:"combo5", noUI: false});
a.award(function(response){
console.log(response);
});
}
if(this.game.combo_hits == 10){
a = new Clay.Achievement({id:"combo10", noUI: false});
a.award(function(response){
console.log(response);
});
}
if(this.game.points > 50000){
a = new Clay.Achievement({id:"points50k", noUI: false});
a.award(function(response){
console.log(response);
});
}
if(this.game.points > 100000){
a = new Clay.Achievement({id:"points100k", noUI: false});
a.award(function(response){
console.log(response);
});
}*/
}

this.destroy = function(){
Expand Down
48 changes: 11 additions & 37 deletions res/js/game.js
@@ -1,3 +1,13 @@
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 1000 / 60);
};
})();


$(window).bind("load",function(e){
var k = Game.init();
});
Expand Down Expand Up @@ -326,31 +336,6 @@ var Game = {
}


// Social
var points = this.points;
$("#ic_twitter").bind("click", function(e){
var screenshot = new Clay.Screenshot( { prompt: false } );
screenshot.save(function(response) {
(new Clay.Twitter()).post( { message: "Playing http://vertigo.clay.io ! Just scored " + this.points + "! Can you beat my score?", picture: response.imageSrc, editable: true } );
}).bind(this);

}).bind(this);

$("#ic_facebook").bind("click", function(e){
var screenshot = new Clay.Screenshot( { prompt: false } );
screenshot.save(function(response) {
(new Clay.Facebook()).post( { message: "Playing http://vertigo.clay.io ! Just scored " + this.points + "! Can you beat my score?", picture: response.imageSrc, editable: true } );
}).bind(this);
}).bind(this);

$("#ic_hiscore").bind("click", function(e){
var leaderboard = new Clay.Leaderboard({id:"score"});
leaderboard.show({limit:10}, function(response){
console.log(response)
});
});


$(window).resize(function(){
game.fullScreen();
}).bind(this);
Expand Down Expand Up @@ -400,7 +385,7 @@ var Game = {
update: function(){
this.canvas.clearRect(0, 0, this.w, this.h); // Clear Canvas

this.updateBg();
// this.updateBg();
this.updateSpeed();
this.updateButtons();
this.player.react(); // Make player react to event
Expand Down Expand Up @@ -486,17 +471,6 @@ var Game = {
// TODO Fix game over check
if((this.height + this.h) < this.max_height){
$("#fall_sound")[0].play();

var leaderboard = new Clay.Leaderboard({id:"score"});
leaderboard.post({score : this.points}, function(response){
console.log(response);
var a = new Clay.Achievement({id : "first"});
a.award(function(response){
console.log(response);
});

});

this.destroyGame();
}
},
Expand Down

0 comments on commit 4007aaa

Please sign in to comment.