Download NewPlayer/Player/StateMachine/PlayerStateMachine/States/run.gd from NeatoGames/saddle-up: direct link, hf CLI and curl.
- Browser
- Download file 628 Bytes
-
https://huggingface.co/datasets/NeatoGames/saddle-up/resolve/main/NewPlayer/Player/StateMachine/PlayerStateMachine/States/run.gd
- Command line
-
hf download hf://datasets/NeatoGames/saddle-up/NewPlayer/Player/StateMachine/PlayerStateMachine/States/run.gd
-
curl -L -o run.gd https://huggingface.co/datasets/NeatoGames/saddle-up/resolve/main/NewPlayer/Player/StateMachine/PlayerStateMachine/States/run.gd
628 Bytes
| extends Motion | |
| func _state_input(event: InputEvent) -> void: | |
| if event.is_action_pressed("jump"): | |
| finished.emit("Jump") | |
| if event.is_action_pressed("sprint") and sprint_remaining > PLAYER_MOVEMENT_STATS.minimum_sprint_threshold: | |
| finished.emit("Sprint") | |
| if event.is_action_pressed("aim"): | |
| finished.emit("AimWalk") | |
| func _update(delta: float) -> void: | |
| set_direction() | |
| calculate_velocity(speed,direction,PLAYER_MOVEMENT_STATS.acceleration,delta) | |
| replenish_sprint(delta) | |
| direction_updated.emit(input_dir) | |
| if direction == Vector3.ZERO: | |
| finished.emit("Idle") | |
| if not is_on_floor(): | |
| finished.emit("Fall") | |