@Override
	public void update() {

		//Get current time
		double currentTime = System.currentTimeMillis();
		double movement = ((currentTime - previousTime) * movementSpeed) / 1000.0;
		
		//Create a translation vector
		Vector translation = new Vector(2);

		boolean moving = false;
		
		//Determine which keys are pressed
		if(Directory.inputManager.isKeyPressed('w')){
			//Set translation Vector to move up
			translation.setComponent(1, translation.getComponent(1)-movement);
			attachedTo.getSprite().playAnimation(3, true);
			moving = true;
		}
		if(Directory.inputManager.isKeyPressed('s')){
			//Set translation vector to move down
			translation.setComponent(1, translation.getComponent(1) + movement);
			attachedTo.getSprite().playAnimation(2, true);
			moving = true;

		}
		if(Directory.inputManager.isKeyPressed('a')){
			//Set translation Vector to move left
			translation.setComponent(0, translation.getComponent(0)-movement);
			attachedTo.getSprite().playAnimation(0, true);
			moving = true;

		}
		if(Directory.inputManager.isKeyPressed('d')){
			//Set translation Vector to move right
			translation.setComponent(0, translation.getComponent(0)+movement);
			attachedTo.getSprite().playAnimation(1, true);
			moving = true;

		}
		
		if(!moving) attachedTo.getSprite().setRepeating(false);
		
		//Move this gameObject
		getAttachedMObj().move(translation);
		
		//Update previous time
		previousTime = currentTime;
			
	}