LD54_Box_Survival/circleProjectile.gd
Stephen Seo 7cb180c245 Work
Impl. enough for basic gameplay and has some particle effects.
2023-09-30 15:38:24 +09:00

25 lines
589 B
GDScript

extends RigidBody2D
const Player = preload("res://PlayerCharacterBody2D.gd")
const LIFETIME = 18.0
var timer = 0.0
# Called when the node enters the scene tree for the first time.
func _ready():
set_contact_monitor(true)
set_max_contacts_reported(4)
func on_collide():
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
timer += delta
if timer >= LIFETIME:
get_parent().remove_child(self)
for collider in get_colliding_bodies():
if collider is Player:
collider.damaged(self)
get_parent().remove_child(self)
break