scripting_player_input.rst: fix small inaccuracy about conditionals (#10573)

* scripting_player_input.rst: fix small inaccuracy about conditionals
This commit is contained in:
Sven Slootweg
2025-02-14 13:49:52 +01:00
committed by GitHub
parent 0c74e787f8
commit 4f3c3fc101

View File

@@ -61,9 +61,10 @@ which the player wants to turn. A value of ``0`` means the player isn't pressing
the left or the right arrow key. A value of ``1`` means the player wants to turn
right, and ``-1`` means they want to turn left.
To produce these values, we introduce conditions and the use of ``Input``. A
condition starts with the ``if`` keyword in GDScript and ends with a colon. The
condition is the expression between the keyword and the end of the line.
To produce these values, we introduce conditional statements and the use of ``Input``.
A conditional statement starts with the ``if`` keyword in GDScript and ends with a colon. The
condition is specifically the expression between the keyword and the colon at
the end of the line.
To check if a key was pressed this frame, we call ``Input.is_action_pressed()``.
The method takes a text string representing an input action and returns ``true``