Fireball, need to tweak the animation to get some grey at the end like the standing fire
Deploy Promiscuity Auth API / deploy (push) Has been cancelled
Deploy Promiscuity Character API / deploy (push) Has been cancelled
Deploy Promiscuity Crafting API / deploy (push) Has been cancelled
Deploy Promiscuity Inventory API / deploy (push) Has been cancelled
Deploy Promiscuity Locations API / deploy (push) Has been cancelled
Deploy Promiscuity Mail API / deploy (push) Has been cancelled
Deploy Promiscuity World API / deploy (push) Has been cancelled
k8s smoke test / test (push) Has been cancelled

SHIFT + B
This commit is contained in:
2026-05-04 23:59:26 -05:00
parent 98220921bd
commit a9e546a121
6 changed files with 180 additions and 0 deletions
+16
View File
@@ -14,6 +14,8 @@ const MAX_NUMBER_OF_JUMPS := 2
const MIN_FOV := 10.0
const MAX_FOV := 179.0
const ZOOM_FACTOR := 1.1 # Zoom out when >1, in when < 1
const FIREBALL_SPAWN_FORWARD_OFFSET := 1.5
const FIREBALL_SPAWN_UP_OFFSET := 1.2
var mouse_sensitivity := 0.005
var rotation_x := 0.0
var rotation_y := 0.0
@@ -45,6 +47,7 @@ var _jump_triggered := false
@export var anim_sprint_speed_threshold := 10.0
var jump_sound = preload("res://assets/audio/jump.ogg")
var fireball_scene = preload("res://scenes/Projectiles/fireball.tscn")
var audio_player = AudioStreamPlayer.new()
@export var camera_path: NodePath
@@ -183,6 +186,10 @@ func _input(event):
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
zoom_camera(ZOOM_FACTOR) # Zoom out
if event.is_action_pressed("player_fireball"):
shoot_fireball()
return
if event.is_action_pressed("player_light"):
_flashlight.visible = !_flashlight.visible
@@ -192,6 +199,13 @@ func zoom_camera(factor):
var new_fov = cam.fov * factor
cam.fov = clamp(new_fov, MIN_FOV, MAX_FOV)
func shoot_fireball() -> void:
var direction := get_look_direction()
var origin := get_look_origin() + direction * FIREBALL_SPAWN_FORWARD_OFFSET
var fireball := fireball_scene.instantiate()
get_tree().current_scene.add_child(fireball)
fireball.launch(origin, direction)
func _update_animation(on_floor: bool, velocity: Vector3) -> void:
if _anim_player == null:
return
@@ -266,4 +280,6 @@ func get_look_origin() -> Vector3:
func get_look_direction() -> Vector3:
if cam:
return (-cam.global_transform.basis.z).normalized()
return (-global_basis.z).normalized()