public void tick() {
		ax = ay = 0;
		
		if(stamina < MAX_STAMINA && Game.tickCount % 4 == 0) {
			stamina += 1;
		}
		
		if(mana < MAX_MANA && Game.tickCount % 4 == 0) {
			mana  += 1;
		}
		
		if(Game.instance.menu != null) return;
		
		if(key.isKeyDown(KeyEvent.VK_D)) {
			dir = 2;
			ax += 2;
		}
		if(key.isKeyDown(KeyEvent.VK_A)) {
			dir = 3;
			ax -= 2;
		}
		if(key.isKeyDown(KeyEvent.VK_W)) {
			dir = 0;
			ay -= 2;
		}
		if(key.isKeyDown(KeyEvent.VK_S)) {
			dir = 1;
			ay += 2;
		}
		if(key.isKeyDown(KeyEvent.VK_SHIFT) && stamina > 0) {
			ax *= 2;
			ay *= 2;
			if(ax != 0 || ay != 0)
				stamina -= 2;
		}
		super.tick();
		
		if(mouse.isLeftButton()) {
			if(inventory.getItem(0, 0) != null) {
				inventory.getItem(0, 0).onLeftClick(mouse, level, this);
			}
		}
		
		if(mouse.isRightButton()) {
			int mx = mouse.getxPos() >> 4;
			int my = mouse.getyPos() >> 4;
			if(mx >= 0 && my >= 0)
				if (!level.getTile(mx, my).interact(mouse, this, level, mx, my))
					if(inventory.getItem(0, 0) != null)
						inventory.getItem(0, 0).onRightClick(mouse, level, this);
		}
	}