ig.module( 'game.entities.paddle-player' ) .requires( 'game.entities.paddle' ) .defines(function(){ EntityPaddlePlayer = EntityPaddle.extend({ animSheet: new ig.AnimationSheet( 'media/paddle-player.png', 64, 128 ), 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; } if( ig.input.state('left') ) { this.vel.x = -400; } else if( ig.input.state('right') ) { this.vel.x = 400; } else { this.vel.x = 0; } this.parent(); } }); });