added attacks
This commit is contained in:
14
scripts/entity.gd
Normal file
14
scripts/entity.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user