فهرست منبع

forgot to check on floor before jumping

Juan Linietsky 9 سال پیش
والد
کامیت
cf98fed099
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      2d/platformer/player.gd

+ 1 - 1
2d/platformer/player.gd

@@ -54,7 +54,7 @@ func _fixed_process(delta):
 	linear_vel.x = lerp( linear_vel.x, target_speed, 0.1 )
 	
 	# Jumping
-	if (Input.is_action_just_pressed("jump")):
+	if (on_floor and Input.is_action_just_pressed("jump")):
 		linear_vel.y=-JUMP_SPEED
 		get_node("sound").play("jump")