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
|
|
@ -1,9 +1,12 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
@export var speed = 200
|
||||
@export var weapon: RangedWeapon
|
||||
@export var special_ability: Ability
|
||||
@export var movement: PlayerMovement
|
||||
|
||||
var weapon: RangedWeapon
|
||||
|
||||
var movement: PlayerMovement
|
||||
var combat: PlayerCombat
|
||||
|
||||
# Last direction for idle state
|
||||
var last_direction = Vector2.DOWN
|
||||
|
|
@ -11,19 +14,16 @@ var last_direction = Vector2.DOWN
|
|||
@onready var animated_sprite = $PlayerSprite
|
||||
|
||||
func _ready():
|
||||
weapon = RangedWeapon.new()
|
||||
Log.pr("Weapon", weapon)
|
||||
weapon = $RangedWeapon
|
||||
combat = PlayerCombat.new()
|
||||
|
||||
# Initialize the movement resource with references
|
||||
if movement:
|
||||
movement.player = self
|
||||
movement.animated_sprite = animated_sprite
|
||||
movement.last_direction = Vector2.DOWN # Default direction
|
||||
else:
|
||||
# Create a new resource instance if none was assigned in the editor
|
||||
movement = PlayerMovement.new()
|
||||
movement.player = self
|
||||
movement.animated_sprite = animated_sprite
|
||||
movement = PlayerMovement.new()
|
||||
movement.player = self
|
||||
movement.animated_sprite = animated_sprite
|
||||
movement.speed = speed
|
||||
|
||||
combat.player = self
|
||||
combat.animated_sprite = animated_sprite
|
||||
|
||||
Log.pr("Adding projectile size additive modifier")
|
||||
weapon.add_modifier(ProjectileSizeAdditive.new())
|
||||
|
|
@ -37,11 +37,15 @@ func _ready():
|
|||
# Size is now 1.5 * 1.5 = 2.25
|
||||
|
||||
# Add another additive size modifier (+0.7 or 70% increase)
|
||||
Log.pr("Adding another projectile size additive modifier", 0.7)
|
||||
Log.pr("Adding another projectile size additive modifier", 2)
|
||||
var another_size_mod = ProjectileSizeAdditive.new()
|
||||
another_size_mod.size_increase = 0.7
|
||||
weapon.add_modifier(another_size_mod)
|
||||
Log.pr(weapon.stats.get_stat("projectile_size"))
|
||||
|
||||
weapon.add_modifier(FireRateAdditive.new())
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
movement.process(delta)
|
||||
combat.process(delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue