Quaternius weapons, input fixes, sound & path fixes
- Added 6 Quaternius weapon models (Pistol, Revolver, Rifle, Shotgun, P90, SniperRifle) - Created weapon resource files with balanced stats - Wired Pistol + Rifle into player.tscn replacing Kenney blasters - Fixed WASD input (matched input map action names) - Fixed Escape key toggles mouse capture - Added Audio autoload singleton - Fixed broken sound asset paths across all scripts - Fixed all scene ext_resource text paths (nested under assets/kenney-fps/) - Fixed all .import source_file paths - Deleted stale .import files (will be regenerated by editor on open)
This commit is contained in:
@@ -84,7 +84,7 @@ func _process(delta):
|
||||
camera.position.y = lerp(camera.position.y, 0.0, delta * 5)
|
||||
|
||||
if is_on_floor() and gravity > 1 and !previously_floored: # Landed
|
||||
Audio.play("sounds/land.ogg")
|
||||
Audio.play("assets/kenney-fps/sounds/land.ogg")
|
||||
camera.position.y = -0.1
|
||||
|
||||
previously_floored = is_on_floor()
|
||||
@@ -102,19 +102,18 @@ func _input(event):
|
||||
handle_rotation(event.relative.x, event.relative.y, false)
|
||||
|
||||
func handle_controls(delta):
|
||||
# Mouse capture
|
||||
if Input.is_action_just_pressed("mouse_capture"):
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
mouse_captured = true
|
||||
|
||||
if Input.is_action_just_pressed("mouse_capture_exit"):
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
mouse_captured = false
|
||||
|
||||
input_mouse = Vector2.ZERO
|
||||
# Mouse capture — Escape toggles
|
||||
if Input.is_action_just_pressed("escape"):
|
||||
if mouse_captured:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
mouse_captured = false
|
||||
input_mouse = Vector2.ZERO
|
||||
else:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
mouse_captured = true
|
||||
|
||||
# Movement
|
||||
var input := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
|
||||
var input := Input.get_vector("move_west", "move_east", "move_north", "move_south")
|
||||
movement_velocity = Vector3(input.x, 0, input.y).normalized() * movement_speed
|
||||
|
||||
# Handle Controller Rotation
|
||||
@@ -165,7 +164,7 @@ func handle_gravity(delta):
|
||||
# Jumping
|
||||
|
||||
func action_jump():
|
||||
Audio.play("sounds/jump_a.ogg, sounds/jump_b.ogg, sounds/jump_c.ogg")
|
||||
Audio.play("assets/kenney-fps/sounds/jump_a.ogg, assets/kenney-fps/sounds/jump_b.ogg, assets/kenney-fps/sounds/jump_c.ogg")
|
||||
gravity = - jump_strength
|
||||
jumps_remaining -= 1
|
||||
|
||||
@@ -206,7 +205,7 @@ func action_shoot():
|
||||
|
||||
# Creating an impact animation
|
||||
|
||||
var impact = preload("res://objects/impact.tscn")
|
||||
var impact = preload("res://assets/kenney-fps/objects/impact.tscn")
|
||||
var impact_instance = impact.instantiate()
|
||||
|
||||
impact_instance.play("shot")
|
||||
@@ -232,7 +231,7 @@ func action_weapon_toggle():
|
||||
weapon_index = wrap(weapon_index + 1, 0, weapons.size())
|
||||
initiate_change_weapon(weapon_index)
|
||||
|
||||
Audio.play("sounds/weapon_change.ogg")
|
||||
Audio.play("assets/kenney-fps/sounds/weapon_change.ogg")
|
||||
|
||||
# Initiates the weapon changing animation (tween)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user