Round system
This commit is contained in:
parent
bcb42f8d16
commit
3df8247a84
32 changed files with 573 additions and 123 deletions
|
|
@ -1,6 +1,7 @@
|
|||
extends State
|
||||
|
||||
@export var player: Player
|
||||
@export var player_movement: PlayerMovement
|
||||
@export var max_speed: float = 5.0
|
||||
@export var acceleration: float
|
||||
@export var weapon_system: WeaponSystem
|
||||
|
|
@ -20,11 +21,4 @@ func physics_update(delta: float) -> void:
|
|||
|
||||
player.velocity += player.get_gravity() * delta
|
||||
|
||||
var input_dir := Input.get_vector("plr_strafe_r","plr_strafe_l", "plr_back","plr_forward")
|
||||
var direction := (player.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
|
||||
var modified_max_speed = max_speed * weapon_system.get_speed_modifier()
|
||||
if direction:
|
||||
if abs(player.velocity.x + direction.x * acceleration * delta) < abs(modified_max_speed * direction.x):
|
||||
player.velocity.x += direction.x * acceleration * delta
|
||||
if abs(player.velocity.z + direction.z * acceleration * delta) < abs(modified_max_speed * direction.z):
|
||||
player.velocity.z += direction.z * acceleration * delta
|
||||
player_movement.process_movement(max_speed * weapon_system.get_speed_modifier(),acceleration,0,delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue