1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-13 07:07:12 +08:00

Refactor and update various components and assets

- Updated WaterBottle scene to change field values and costs, and modified avatar texture and display name.
- Removed unused pencil SVG and its import files.
- Updated Chomp sound effect with a new binary file.
- Modified Diamond bullet behavior to improve tracing logic.
- Increased rotation speed for Laser bullet.
- Adjusted Chick and Hen character attack methods to generate bullets without returning prematurely.
- Updated Rooster character to use PurpleCrystal bullet instead of Pencil.
- Enhanced BulletBase with new properties for energy consumption and animation control.
- Adjusted blend position interpolation in EntityBase for smoother movement.
- Added new Star bullet with its scene and script, including animation setup.
- Updated SVG and import files for new Star bullet graphics.
This commit is contained in:
2025-08-27 15:38:30 +08:00
parent 2e1d15a0a0
commit 1a918a7a14
22 changed files with 259 additions and 93 deletions
+8 -2
View File
@@ -10,7 +10,9 @@ class_name BulletBase
@export var lifeTime: float = -1 # -1表示无限时间
@export var indisDamage: bool = false # 是否无差别伤害(不区分敌我)
@export var canDamageSelf: bool = false # 是否可以伤害发射者
@export var needEnergy: float = 4.0 # 发射时需要消耗的能量
@export var needEnergy: float = 0.0 # 发射时需要消耗的能量
@export var autoSpawnAnimation: bool = false
@export var autoLoopAnimation: bool = false
@onready var animator: AnimationPlayer = $"%animator"
@onready var hitbox: CollisionShape2D = $"%hitbox"
@@ -24,8 +26,12 @@ func _ready():
area_entered.connect(hit)
spawnInWhen = Time.get_ticks_msec()
spawnInWhere = position
animator.play("spawn")
spawn()
if autoSpawnAnimation:
animator.play("spawn")
await animator.animation_finished
if autoLoopAnimation:
animator.play("loop")
func _process(_delta: float) -> void:
if lifeTime > 0:
if Time.get_ticks_msec() - spawnInWhen >= lifeTime:
+1 -1
View File
@@ -71,7 +71,7 @@ func _process(_delta):
for i in inventory:
inventory[i] = clamp(inventory[i], 0, inventoryMax[i])
func _physics_process(_delta: float) -> void:
animatree.set("parameters/blend_position", lerpf(animatree.get("parameters/blend_position"), lastDirection, 0.1))
animatree.set("parameters/blend_position", lerpf(animatree.get("parameters/blend_position"), lastDirection, 0.2))
if sprinting:
velocity *= 0.9
if velocity.length() <= 100: