Additional resource tweaks.
This commit is contained in:
parent
2c2b23f0bb
commit
6c41810add
5 changed files with 36 additions and 7 deletions
|
|
@ -26,7 +26,6 @@ func shoot():
|
|||
|
||||
# Calculate horizontal offset for this bullet (symmetrical: left=-ve, right=+ve)
|
||||
var bullet_horizontal_offset: float = index_from_center * weapon_data.horizontal_offset
|
||||
print("horizontal_offset: ", weapon_data.horizontal_offset, " index: ", index_from_center, " result: ", bullet_horizontal_offset)
|
||||
|
||||
# Calculate vertical offset from center point (symmetrical vertical spread)
|
||||
var distance_from_center: float = abs(index_from_center)
|
||||
|
|
@ -42,5 +41,9 @@ func shoot():
|
|||
# Set the bullet data
|
||||
bullet.set_weapon_data(weapon_data.bullet_scene, weapon_data)
|
||||
|
||||
# Offset animation playback per projectile if enabled
|
||||
if weapon_data.stagger_animation:
|
||||
bullet.set_animation_offset(index_from_center * weapon_data.stagger_offset)
|
||||
|
||||
# Subtract projectile spacing from current Player travel for next shot
|
||||
player.travel -= weapon_data.spacing
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
class_name WeaponShot
|
||||
extends Resource
|
||||
|
||||
@export_category("Info")
|
||||
@export_category("Parameters")
|
||||
@export var shot_name: String
|
||||
@export var bullet_scene: PackedScene = null
|
||||
|
||||
@export_category("Shot Data")
|
||||
@export var damage: int = 1
|
||||
@export var speed: int = 135
|
||||
@export var projectiles: int = 2
|
||||
# Vertical spacing between projectiles
|
||||
@export var spacing: float = 35
|
||||
# Origin offset from center of player
|
||||
@export var origin: int = -23
|
||||
|
||||
@export_category("Spread")
|
||||
@export var horizontal_offset: float = 6.5 # Horizontal distance between projectiles
|
||||
@export var stagger_offset: float = 0.25 # Time delay per projectile index
|
||||
# Horizontal distance between projectiles
|
||||
@export var horizontal_offset: float = 6.5
|
||||
# Time delay per projectile index
|
||||
@export var stagger_offset: float = 0.25
|
||||
|
||||
@export_category("Effects")
|
||||
# Offset animation playback per projectile index
|
||||
@export var stagger_animation: bool = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue