number keys for weapons; charger enemy is invulnerable

This commit is contained in:
Michael Campbell 2026-03-19 01:44:53 -04:00
parent 1d1d201520
commit ae7d507a4c
5 changed files with 27 additions and 9 deletions

View file

@ -23,6 +23,7 @@ func _start_charge() -> void:
enemy.velocity = global_position.direction_to(Player.instance.global_position)
enemy.velocity *= CHARGE_SPEED
enemy.set_rotation_to_velocity()
enemy.invulnerable = true
func _end_charge() -> void:
charge_clock = 0.
@ -30,6 +31,7 @@ func _end_charge() -> void:
enemy.default_movement = true
enemy.set_collision_mask_value(4, true)
enemy.invulnerable = false
%KnockUpArea.monitoring = false
%Meshes.position = Vector3.ZERO

View file

@ -7,6 +7,7 @@ const FRAME_IDXS := 10
@export var max_speed := 8.
@export var health := 10.
@export var knockback_mul := 1.
@export var invulnerable := false
var frame_idx := 0
var frame_count := 0
@ -57,6 +58,7 @@ func _process(delta: float) -> void:
func hit(proj: Node3D, damage: float) -> bool:
if invulnerable: return true
health -= damage
if health <= 0:
queue_free()