This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tool | |
class_name AimComponent | |
extends Node2D | |
## Component that handles aim mechanics with physics-based mouse following | |
## | |
## This component creates a physical cursor that follows the mouse position with | |
## configurable acceleration, drag, and mass properties to simulate different | |
## weapon handling characteristics. | |
# Signals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class_name HealthBarComponent | |
extends Control | |
## The HealthComponent this health bar represents. | |
@export var health_component: HealthComponent | |
## Reference to the ProgressBar node inside the health bar. | |
@onready var progress_bar: ProgressBar = $ProgressBar | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
class_name HealthComponent | |
## Signal emitted when health changes. Sends the amount of change. | |
signal health_changed(amount: float) | |
## Signal emitted specifically when health decreases. Sends the amount of damage taken. | |
signal health_decreased(amount: float) | |
## Signal emitted when health reaches zero. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Control | |
class_name Tooltip | |
@export_category("Tooltip Settings") | |
## The node that owns this tooltip and triggers its visibility. | |
@export var owner_node: Node | |
## If true, allows the tooltip to be toggled on and off with a key press. | |
## This is kind of specific to some projects, so you might want to remove it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node2D | |
class_name VelocityComponent | |
## The maximum speed this object can move at. | |
@export var max_speed: float = 100 | |
## The rate of acceleration used when applying knockback. | |
@export var knockback_acceleration: float = 15 | |
## The rate of acceleration when moving normally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
## Connect to this to keep track of current experience | |
signal experience_updated(current_experience: float, target_experience: float) | |
signal level_up(new_level: int) ## Connect to this to keep track of level ups | |
## The ratio of experience needed to level up, this value will be added | |
## to the target experience each time the player levels up | |
const TARGET_EXPERIENCE_RATIO = 5 |