uberpong/dev/lib/game/entities/paddle-player.js

29 lines
424 B
JavaScript

ig.module(
'game.entities.paddle-player'
)
.requires(
'game.entities.paddle'
)
.defines(function(){
EntityPaddlePlayer = EntityPaddle.extend({
animSheet: new ig.AnimationSheet( 'media/paddle-player.png', 30, 96 ),
update: function(){
if( ig.input.state('up') ) {
this.vel.y = -400;
}
else if( ig.input.state('down') ) {
this.vel.y = 400;
}
else {
this.vel.y = 0;
}
this.parent();
}
});
});