Added a new scene

This commit is contained in:
Anthony
2025-10-12 21:10:24 -05:00
parent 19140b4b2e
commit fb446fe24f
5 changed files with 94 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
extends RigidBody3D
# Initially I used a CharacterBody3D, however, I wanted the player to bounce off
# other objects in the environment and that would have required manual handling
# of collisions. So that's why we're using a RigidBody3D instead.
const ACCELLERATION = 5.0
func _integrate_forces(state):
var input_dir = Vector3.ZERO
input_dir.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
input_dir.z = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
input_dir = input_dir.normalized()
linear_velocity.x += input_dir.x * (ACCELLERATION * state.step)
linear_velocity.z += input_dir.z * (ACCELLERATION * state.step)