diff --git a/dev/lib/game/entities/paddle-player.js b/dev/lib/game/entities/paddle-player.js index 00cd268..311c6b3 100644 --- a/dev/lib/game/entities/paddle-player.js +++ b/dev/lib/game/entities/paddle-player.js @@ -5,25 +5,24 @@ ig.module( 'game.entities.paddle' ) .defines(function(){ + EntityPaddlePlayer = EntityPaddle.extend({ + animSheet: new ig.AnimationSheet( 'media/paddle-player.png', 30, 96 ), -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(); - } + 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; + } + this.parent(); + } + }); }); -}); diff --git a/dev/lib/game/entities/paddle.js b/dev/lib/game/entities/paddle.js index 16950a0..2fe2caa 100644 --- a/dev/lib/game/entities/paddle.js +++ b/dev/lib/game/entities/paddle.js @@ -9,7 +9,7 @@ ig.module( EntityPaddle = ig.Entity.extend({ name: 'paddle', - scores: 0, + scores: 0, // TODO: whats this? size: {x: 30, y: 96}, collides: ig.Entity.COLLIDES.FIXED, diff --git a/dev/lib/game/main.js b/dev/lib/game/main.js index 47a0c4d..daa2b9f 100755 --- a/dev/lib/game/main.js +++ b/dev/lib/game/main.js @@ -23,6 +23,8 @@ ig.module( ig.input.bind(ig.KEY.ESC, 'mainmenu'); ig.input.bind(ig.KEY.UP_ARROW, 'up'); ig.input.bind(ig.KEY.DOWN_ARROW, 'down'); + ig.input.bind(ig.KEY.T, 'force-top'); + ig.input.bind(ig.KEY.B, 'force-bottom'); // vim goodness ig.input.bind(ig.KEY.K, 'up'); ig.input.bind(ig.KEY.J, 'down');