This site works A LOT better with JavaScript enabled!
This is the beta version of this site! Some things may not be working.

Keyboard Controller

Run
var ladybug = null; var SPEED = 200; var ROTSPEED = 150; var game = new tine.Game(null, { preload: function() { game.load.image('bg', 'assets/scene-jungle.png'); game.load.image('lady', 'assets/ladybug.png'); }, create: function() { game.stage.addChild(game.create.bitmap('bg')); ladybug = game.create.bitmap('lady', {regX:'center', regY:'center', x:512, y:288}); game.stage.addChild(ladybug); }, update: function() { if (game.keyboard.isDown(tine.keys.A)||game.keyboard.isDown(tine.keys.LEFT)) { ladybug.rotation -= ROTSPEED*game.time.fdelta; } else if (game.keyboard.isDown(tine.keys.D)||game.keyboard.isDown(tine.keys.RIGHT)) { ladybug.rotation += ROTSPEED*game.time.fdelta; } var dirX = -Math.sin(ladybug.rotation*tine.RADIANS); var dirY = Math.cos(ladybug.rotation*tine.RADIANS); if (game.keyboard.isDown(tine.keys.W)||game.keyboard.isDown(tine.keys.UP)) { ladybug.x -= SPEED*dirX*game.time.fdelta; ladybug.y -= SPEED*dirY*game.time.fdelta; } else if (game.keyboard.isDown(tine.keys.S)||game.keyboard.isDown(tine.keys.DOWN)) { ladybug.x += SPEED*dirX*game.time.fdelta; ladybug.y += SPEED*dirY*game.time.fdelta; } } })