2012-06-22 18:20:41 +02:00
|
|
|
ig.module(
|
|
|
|
'game.entities.paddle-player'
|
|
|
|
)
|
|
|
|
.requires(
|
|
|
|
'game.entities.paddle'
|
|
|
|
)
|
|
|
|
.defines(function(){
|
2012-07-06 17:09:07 +02:00
|
|
|
EntityPaddlePlayer = EntityPaddle.extend({
|
|
|
|
animSheet: new ig.AnimationSheet( 'media/paddle-player.png', 30, 96 ),
|
2012-06-22 18:20:41 +02:00
|
|
|
|
2012-07-06 17:09:07 +02:00
|
|
|
update: function(){
|
|
|
|
if (ig.input.state('up')) {
|
|
|
|
this.vel.y = -400;
|
|
|
|
} else if (ig.input.state('down')) {
|
|
|
|
this.vel.y = 400;
|
|
|
|
} else if (ig.input.state('force-top')) {
|
|
|
|
this.pos.y = 48;
|
|
|
|
} else if (ig.input.state('force-bottom')) {
|
|
|
|
this.pos.y = 240;
|
|
|
|
} else {
|
|
|
|
this.vel.y = 0;
|
|
|
|
}
|
2012-06-22 18:20:41 +02:00
|
|
|
|
2012-07-06 17:09:07 +02:00
|
|
|
this.parent();
|
|
|
|
}
|
|
|
|
});
|
2012-06-24 10:50:26 +02:00
|
|
|
});
|
2012-06-22 18:20:41 +02:00
|
|
|
|