mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-02 21:48:23 +03:00
Compare commits
1 Commits
2.1.2-stab
...
2.1.3-stab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbccc3a3da |
@@ -119,6 +119,14 @@ func _integrate_forces(s):
|
||||
|
||||
# Process jump
|
||||
if (jumping):
|
||||
# We want the character to immediately change facing side when the player
|
||||
# tries to change direction, during air control.
|
||||
# This allows for example the player to shoot quickly left then right.
|
||||
if (move_left and not move_right):
|
||||
get_node("sprite").set_scale(Vector2(-1, 1))
|
||||
if (move_right and not move_left):
|
||||
get_node("sprite").set_scale(Vector2(1, 1))
|
||||
|
||||
if (lv.y > 0):
|
||||
# Set off the jumping flag if going down
|
||||
jumping = false
|
||||
|
||||
Reference in New Issue
Block a user