Adds Initial animations and enemy spawning

This commit is contained in:
2024-10-05 17:57:40 +02:00
parent 1cda262976
commit 1a4878f32e
29 changed files with 522 additions and 26 deletions

21
game.gd Normal file
View File

@@ -0,0 +1,21 @@
extends Node2D
const MAX_HEALTH = 100.0
const RECOVERY_RATE = 10.0
const BAD_PRESS_DAMAGE = 20.0
const INIT_COLOR = Color(1,0,0,0)
var health = MAX_HEALTH
func _process(delta: float) -> void:
health = minf(health + RECOVERY_RATE * delta ,MAX_HEALTH)
var new_color = Color(INIT_COLOR)
new_color.a = 1 - health / MAX_HEALTH
%DamageColorOverlay.color = new_color
func bad_press():
health = maxf(health - BAD_PRESS_DAMAGE, 0)
if(health == 0):
print_debug("GAME OVER")