From 28ae5c4daf03d8c4c1b5495c4a8a975f5bb2bd4c Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 11 Jun 2014 10:06:32 -0700 Subject: [PATCH] Refactoring --- moonlight/js/moonlight-skulk.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index b406d0f..ed06d2d 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -201,14 +201,14 @@ GameState.prototype.create = function() this.physics.arcade.enable(player); player.body.collideWorldBounds = true; - addAnimation(player, 'bipedwalkleft'); - addAnimation(player, 'bipedwalkright'); - addAnimation(player, 'bipedwalkup'); - addAnimation(player, 'bipedwalkdown'); - addAnimation(player, 'bipedrunleft'); - addAnimation(player, 'bipedrunright'); - addAnimation(player, 'bipedrunup'); - addAnimation(player, 'bipedrundown'); + this.addAnimation(player, 'bipedwalkleft'); + this.addAnimation(player, 'bipedwalkright'); + this.addAnimation(player, 'bipedwalkup'); + this.addAnimation(player, 'bipedwalkdown'); + this.addAnimation(player, 'bipedrunleft'); + this.addAnimation(player, 'bipedrunright'); + this.addAnimation(player, 'bipedrunup'); + this.addAnimation(player, 'bipedrundown'); this.camera.follow(player, Phaser.Camera.FOLLOW_TOPDOWN); controls = game.input.keyboard.createCursorKeys(); @@ -327,7 +327,7 @@ GameState.prototype.update = function() this.fpsText.setText(game.time.fps + ' FPS'); } - check_input(); + this.check_input(); this.physics.arcade.collide(player, layer); this.lightSprite.x = game.camera.x; this.lightSprite.y = game.camera.y;