feat: implement player movement controller and initial weapon framework including double barrel shotgun and explosive projectiles

This commit is contained in:
DottsGit
2026-06-06 21:09:40 -04:00
parent 54dfd342c2
commit 30dbf7a4cd
3 changed files with 37 additions and 15 deletions
+5 -6
View File
@@ -146,12 +146,11 @@ func _apply_impulse() -> void:
var push_dir = camera.global_transform.basis.z.normalized()
# Apply impulse to player velocity
player.velocity += push_dir * impulse_strength
# Small hack to ensure we aren't considered on floor if we shoot down
if push_dir.y > 0:
# Just slightly lift the player to break floor contact immediately
player.position.y += 0.05
var final_force = push_dir * impulse_strength
if multiplayer.has_multiplayer_peer() and multiplayer.multiplayer_peer is not OfflineMultiplayerPeer:
player.server_apply_impulse.rpc_id(1, final_force)
else:
player.apply_impulse(final_force)
func _play_muzzle_flash() -> void:
if muzzle_flash: