Stable jam build with resource errors fixed.

This commit is contained in:
Henry 2026-03-05 19:02:14 +00:00
parent 7b47e847ae
commit 2db69a689b
57 changed files with 22 additions and 1232 deletions

View file

@ -1,6 +1,6 @@
extends Area2D
@onready var bullet = $Bullet/Sprite2D
#@onready var bullet = $Bullet/Sprite2D
@export var speed = -250
var shader_active = false
@ -12,8 +12,8 @@ var target = null
func start(pos):
position = pos
func _ready():
var target_node = get_parent().get_node("root/$EnemyShard")
#func _ready():
#var target_node = get_parent().get_node("root/$EnemyShard")
#var target = target_node.is_in_group("shards")
@ -21,18 +21,18 @@ func _process(delta):
if pause == true: return
position.y += speed * delta
if target:
var direction = (target.position - position).normalized()
position += direction * speed * delta
if position.distance_to(target.position) < 10:
stick_to_target(target)
#if target:
#var direction = (target.position - position).normalized()
#position += direction * speed * delta
#
#if position.distance_to(target.position) < 10:
#stick_to_target(target)
func stick_to_target(target):
target.add_child(bullet)
print("Sticking to target!")
position = Vector2.ZERO
#func stick_to_target(target):
#target.add_child(bullet)
#print("Sticking to target!")
#position = Vector2.ZERO
#
# Signal checks to see if the bullet leaves the viewport then removes bullet.
func _on_visible_on_screen_notifier_2d_screen_exited() -> void: