Score stuff and more polish awesomeness
This commit is contained in:
parent
477aa1c0b0
commit
cd11a8485e
4 changed files with 26 additions and 8 deletions
|
@ -45,7 +45,7 @@ ig.module(
|
|||
|
||||
// TODO: Moooar points on speed balls
|
||||
// TODO: Moar points on edge hits
|
||||
if (other.name == 'paddle-player') ig.global.score += 20;
|
||||
if (other.name == 'paddle-player') ig.global.score += 50;
|
||||
this.hitSounds[Math.floor(Math.random()*4)].play();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -19,7 +19,7 @@ ig.module(
|
|||
if (other.name == 'ball') {
|
||||
console.log(this.owner);
|
||||
if (this.owner == 'player') ig.global.lifes -= 1;
|
||||
if (this.owner == 'ai') ig.global.score += 2000;
|
||||
if (this.owner == 'enemy') ig.global.score += 2000;
|
||||
other.reset();
|
||||
this.looseSound.play();
|
||||
}
|
||||
|
|
|
@ -2,14 +2,34 @@ ig.module(
|
|||
'game.entities.paddle-player'
|
||||
)
|
||||
.requires(
|
||||
'game.entities.paddle'
|
||||
'impact.entity'
|
||||
)
|
||||
.defines(function(){
|
||||
EntityPaddlePlayer = EntityPaddle.extend({
|
||||
EntityPaddlePlayer = ig.Entity.extend({
|
||||
size: {x: 30, y: 120},
|
||||
collides: ig.Entity.COLLIDES.FIXED,
|
||||
type: ig.Entity.TYPE.A,
|
||||
|
||||
name: 'paddle-player',
|
||||
animSheet: new ig.AnimationSheet('media/paddle-player.png', 30, 120),
|
||||
animSheet: new ig.AnimationSheet('media/paddle-player_sheet.png', 30, 120),
|
||||
|
||||
maxVel: {x: 0, y: 400},
|
||||
|
||||
init: function(x, y, settings) {
|
||||
this.parent(x, y, settings);
|
||||
|
||||
this.addAnim('idle', 1, [0]);
|
||||
this.addAnim('lives4', 1, [0]);
|
||||
this.addAnim('lives3', 1, [1]);
|
||||
this.addAnim('lives2', 1, [2]);
|
||||
this.addAnim('lives1', 1, [3]);
|
||||
this.addAnim('lives0', 1, [4]);
|
||||
},
|
||||
|
||||
update: function(){
|
||||
this.currentAnim =
|
||||
this.anims['lives'+ig.global.lifes];
|
||||
|
||||
if (ig.input.state('up')) {
|
||||
this.vel.y = -400;
|
||||
} else if (ig.input.state('down')) {
|
||||
|
@ -26,4 +46,3 @@ ig.module(
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -83,8 +83,7 @@
|
|||
draw: function() {
|
||||
ig.system.context.clearRect( 0 ,0, ig.system.realWidth, ig.system.realHeight );
|
||||
this.parent(); // Draw entries and background
|
||||
this.font.draw(ig.global.score, 237, 8, ig.Font.ALIGN.LEFT);
|
||||
this.font.draw(ig.global.lifes, 550, 0, ig.Font.ALIGN.RIGHT);
|
||||
this.font.draw(ig.global.score, 390, 8, ig.Font.ALIGN.RIGHT);
|
||||
|
||||
if (this.showPause) {
|
||||
if(this.pauseDialogAlpha < 1) {
|
||||
|
|
Loading…
Reference in a new issue