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

30 lines
424 B
JavaScript
Raw Normal View History

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