소스 검색

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")