15 lines
204 B
GDScript
15 lines
204 B
GDScript
extends CharacterBody2D
|
|
class_name Entity
|
|
|
|
signal death
|
|
|
|
var color := Color.WHITE
|
|
@export var speed = 100
|
|
var lives: int = 1
|
|
|
|
func hit() -> void:
|
|
lives -= 1
|
|
if lives <= 0:
|
|
death.emit()
|
|
queue_free()
|