uberpong/dev/lib/game/entities/paddle.js
Aaron Mueller 60b6af8e63 Add some score mechanism
If the AI or the human player looses 10 games, the game is over
and goes back into the main screen. A score is displayed on top
of the game for each side.
2012-06-24 23:03:05 +02:00

31 lines
452 B
JavaScript

ig.module(
'game.entities.paddle'
)
.requires(
'impact.entity'
)
.defines(function(){
EntityPaddle = ig.Entity.extend({
name: 'paddle',
scores: 0,
size: {x: 30, y: 96},
collides: ig.Entity.COLLIDES.FIXED,
type: ig.Entity.TYPE.A,
animSheet: new ig.AnimationSheet( 'media/paddle.png', 30, 96 ),
maxVel: {x: 0, y: 400},
init: function( x, y, settings ) {
this.parent( x, y, settings );
this.addAnim( 'idle', 1, [0] );
}
});
});