if (global.gameState == GAME_STATE.PLAYING) {
	score = floor(-obj_player.y);
	
	/*if (keyboard_check_pressed(ord("Z"))) {
		phy_active = !phy_active;
	}*/

	//if (phy_active) {
		if (keyboard_check(ord("A"))
		|| keyboard_check(vk_left)) {
			physics_apply_force(x, y, -xSpeed, 0);
			global.noMoved = false;
		}
		if (keyboard_check(ord("D"))
		|| keyboard_check(vk_right)) {
			physics_apply_force(x, y, xSpeed, 0);
			global.noMoved = false;
		}
		if (keyboard_check(ord("W"))
		|| keyboard_check(vk_up)) {
			physics_apply_force(x, y, 0, -upSpeed);
			global.noMoved = false;
		}
		if (keyboard_check(ord("S"))
		|| keyboard_check(vk_down)) {
			physics_apply_force(x, y, 0, downSpeed);
			global.noMoved = false;
		}
	/*} else {
		var _speed = 4;
		if (keyboard_check(ord("A"))) {
			phy_position_x -= _speed;
		}
		if (keyboard_check(ord("D"))) {
			phy_position_x += _speed;
		}
		if (keyboard_check(ord("W"))) {
			phy_position_y -= _speed;
		}
		if (keyboard_check(ord("S"))) {
			phy_position_y += _speed;
		}
	}*/
	if (y > global.deathLine) {
		hurtPlayer();
		physics_apply_impulse(x, y, 0, -jumpSpeed);
	}
	if (keyboard_check_pressed(ord("J"))
	|| keyboard_check_pressed(vk_control)) {
		splashPressed = true;
		global.noSplashed = false;
	}
	if (keyboard_check_released(ord("J"))
	|| keyboard_check_released(vk_control)) {
		splashPressed = false;
	}

	if (splashPressed && splashTime == 0 && splashIndex == 0) {
		splashing = true;
		if (global.sound) {
			audio_play_sound(snd_splash, 0, false);
		}
	}
	
	if (splashing) {
		splashIndex += splashSpeed;
		if (splashIndex > splashNumber) {
			splashIndex = 0;
			splashing = false;
			splashTime = splashDelay;
		}
		with (obj_enemy) {
			if (collision_circle(other.x, other.y, other.splashRadiusPercent * other.splashIndex, id, false, false)) {
				var _dir = point_direction(x, y, other.x, other.y);
				//var _dist = point_distance(x, y, other.x, other.y);
				var _impulse = other.bounceImpulse;// * max(1, (other.splashRadius - _dist) * 1);
				var _xImpulse = lengthdir_x(_impulse, _dir);
				var _yImpulse = lengthdir_y(_impulse, _dir);
				with (other) {
					physics_apply_impulse(x, y, _xImpulse, _yImpulse);
				}
				if (bonusArmor) {
					with (other) {
						addArmor();
					}
				}
				if (armor <= 0 && hitTimer == 0) {
					instance_destroy();
					if (global.sound) {
						audio_play_sound(snd_explosion, 0, false);
					}
				} else {
					--armor;
					hitTimer = hitDelay;
				}
			}
		}
	}

	if (splashTime > 0) {
		--splashTime;
	}
		
	if (hitTimer > 0) {
		--hitTimer;
	}
}