Adds in-game debug menu addon
Adds an in-game debug menu that displays performance metrics (FPS, frame times) and hardware/software information. The menu can be toggled using the F3 key (or a custom input binding). It has different display styles, ranging from a compact FPS display to a detailed view with graphs and system information.
This commit is contained in:
parent
214e0aa5e0
commit
ff62d67f54
37 changed files with 1484 additions and 49 deletions
30
player/scripts/player_combat.gd
Normal file
30
player/scripts/player_combat.gd
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
extends Resource
|
||||
class_name PlayerCombat
|
||||
|
||||
var player: CharacterBody2D
|
||||
var animated_sprite: AnimatedSprite2D
|
||||
|
||||
func process(_delta):
|
||||
# Get mouse position in global coordinates
|
||||
var mouse_position = player.get_global_mouse_position()
|
||||
|
||||
# Get player position (assuming this script is attached to the player)
|
||||
var player_position = player.global_position
|
||||
|
||||
# Calculate direction vector from player to mouse
|
||||
var direction = mouse_position - player_position
|
||||
|
||||
# You can normalize this vector if you want a unit vector (length of 1)
|
||||
# This is useful if you only care about direction, not distance
|
||||
var normalized_direction = direction.normalized()
|
||||
|
||||
if Input.is_action_pressed("fire"):
|
||||
player.weapon.fire(normalized_direction)
|
||||
# Update animation
|
||||
#update_animation()
|
||||
|
||||
func update_animation():
|
||||
Log.pr(animated_sprite.animation)
|
||||
if animated_sprite.animation != "throw":
|
||||
Log.pr('Throwing animation!')
|
||||
animated_sprite.play("throw")
|
||||
Loading…
Add table
Add a link
Reference in a new issue