From c111513980487aae7ca80b5df04e60dc9169bde2 Mon Sep 17 00:00:00 2001 From: OddlyTimbot Date: Mon, 31 Mar 2025 21:07:37 -0400 Subject: [PATCH] bad guy movement, player death, ui with health, timer, coins, added a dictionary for bad guys --- .../assets/fonts/PixelOperator8-Bold.ttf | Bin 0 -> 18624 bytes .../fonts/PixelOperator8-Bold.ttf.import | 34 +++++++ .../assets/fonts/PixelOperator8.ttf | Bin 0 -> 19944 bytes .../assets/fonts/PixelOperator8.ttf.import | 34 +++++++ .../player/death/Player Death 64x64.png | Bin 0 -> 1584 bytes .../death/Player Death 64x64.png.import | 34 +++++++ februarygodotgame/scenes/game.tscn | 12 ++- februarygodotgame/scenes/level2.tscn | 41 ++++++-- februarygodotgame/scenes/level3.tscn | 94 +++++++++++------- februarygodotgame/scenes/player.tscn | 80 ++++++++++++++- februarygodotgame/scenes/slime.tscn | 14 +++ februarygodotgame/scenes/ui.tscn | 70 +++++++++++++ februarygodotgame/scripts/gamecontroller.gd | 31 +++++- februarygodotgame/scripts/player.gd | 12 ++- februarygodotgame/scripts/res/slimeStats.tres | 2 +- februarygodotgame/scripts/scene_manager.gd | 12 ++- februarygodotgame/scripts/slime.gd | 24 +++++ februarygodotgame/scripts/ui.gd | 24 +++++ 18 files changed, 466 insertions(+), 52 deletions(-) create mode 100644 februarygodotgame/assets/fonts/PixelOperator8-Bold.ttf create mode 100644 februarygodotgame/assets/fonts/PixelOperator8-Bold.ttf.import create mode 100644 februarygodotgame/assets/fonts/PixelOperator8.ttf create mode 100644 februarygodotgame/assets/fonts/PixelOperator8.ttf.import create mode 100644 februarygodotgame/assets/graphics/player/death/Player Death 64x64.png create mode 100644 februarygodotgame/assets/graphics/player/death/Player Death 64x64.png.import create mode 100644 februarygodotgame/scenes/ui.tscn create mode 100644 februarygodotgame/scripts/ui.gd diff --git a/februarygodotgame/assets/fonts/PixelOperator8-Bold.ttf b/februarygodotgame/assets/fonts/PixelOperator8-Bold.ttf new file mode 100644 index 0000000000000000000000000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9#m4$!)lQy%{v~6p1TRgOL5KH^cpZs?6y=%ke z%vJ6jIi~-@GakdSdrXjLOo9ul&W={YV8{ck2`i-Cz`ZV_1e^6jiLZ3g-6P*sO5qT^+F zzb|Z%dIVf4zLCbxEgFg5(L1-+*6N7WJP|E*M?~k5Fo3c{XI8yih|L32+-It7K}TNj zA?ChZUs{rlQmN)p7O?W%wX1OSnZVcXAR?k0VI}fsOM8Bwz&>a^KNweZ1CJj&w-~n` zXsW~lTq+DpNBc_DD({K!Yt;sd@Om-+idk7Xb#UH{=Le13eompX2x~$9Y-!IgB68~B zyi{J#W;{RWh$LfR<KYVZZqWO8bH?sI@P$~?|dU0L)`^qi#E7$tnRVqHt&p#k4+|J8itGi6`?;Vjl zpOKL{5zF>D;r#Dh{lkce6E%P!f8(`U{=)6N6z;@7-Yvdj;cGcfwZ+%9BX{>hB>MZV$nuSDQ@E3N7X|*9mX4Yo5s`dbL6(2DdxRLn z%dhdsUC5ucs-FKg7T?MM!rRCA4gfsfX#w9wcEVRIt6YF5ZGK9_ix~OK8l6As9B{qu zSlcEsg}29acP_^cDlB{(QsD0yIxjCjy#9St!_$@1_XNH)!Gj0000 void: player = load("res://scripts/res/playerStats.tres") @@ -34,9 +40,12 @@ func _ready() -> void: timer.start() func reset(): countdown = timers[currentLevel] + player.health = player.max_health + coinsCollected = 0 func secondCounter(): countdown -=1 + timerUpdateSignal.emit(countdown, timers[currentLevel]) if countdown <=0: print("YOU LOSE") levelCompleteSignal.emit(levels[currentLevel]) @@ -82,17 +91,31 @@ func coinCollected(body, coin): if body is Player: #increase coins collected count coinsCollected +=1 + coinUpdateSignal.emit(coinsCollected, totalCoinsAvailable) destroySignal.emit(coin) func playerDamage(body, badguy): if body is Player: print("GC knows player taking damage") print("Player health "+str(player.health)+" takes damage "+str(slime.meleeDamage)) - player.health -= slime.meleeDamage + player.health -= enemiesDict[badguy]["damage"] if player.health > 0: - playerHurtSignal.emit(player.health) + playerHurtSignal.emit(player.health, player.max_health) else: print("kill em") + playerKillSignal.emit() + print(enemiesDict[badguy]["health"]) - +func addBadGuy(enemy): + print("adding an enemy") + #use a dictionary + var enemyStats = { + "health": slime.health, + "damage": slime.meleeDamage + } + enemiesDict[enemy] = enemyStats + func numberOfBadguys(value): enemies = value +func deathComplete(): + print("GC knows death is complete") + levelCompleteSignal.emit(levels[currentLevel]) diff --git a/februarygodotgame/scripts/player.gd b/februarygodotgame/scripts/player.gd index d617d35..9a1b609 100644 --- a/februarygodotgame/scripts/player.gd +++ b/februarygodotgame/scripts/player.gd @@ -20,6 +20,8 @@ var isJumping = false var animPlaying = "idle" var living = true +signal deathCompleteSignal + func _physics_process(delta: float) -> void: if living and not animPlaying == "hurt": @@ -99,8 +101,14 @@ func hurtPlayer(health): print("Player takes damage, health remaining:: "+str(health)) animPlaying = "hurt" playerGraphic.play(animPlaying) - +func killPlayer(): + print("Kill the player") + living = false + animPlaying="death" + playerGraphic.play(animPlaying) func _on_animation_finished() -> void: if animPlaying=="hurt": - animPlaying=="idle" + animPlaying="idle" + if animPlaying=="death": + deathCompleteSignal.emit() diff --git a/februarygodotgame/scripts/res/slimeStats.tres b/februarygodotgame/scripts/res/slimeStats.tres index b5464bf..f20b820 100644 --- a/februarygodotgame/scripts/res/slimeStats.tres +++ b/februarygodotgame/scripts/res/slimeStats.tres @@ -7,5 +7,5 @@ script = ExtResource("1_ev6pb") max_health = 50 starting_health = 50 health = 50 -meleeDamage = 30 +meleeDamage = 5 rangeDamage = 0 diff --git a/februarygodotgame/scripts/scene_manager.gd b/februarygodotgame/scripts/scene_manager.gd index ca8d743..0e40d03 100644 --- a/februarygodotgame/scripts/scene_manager.gd +++ b/februarygodotgame/scripts/scene_manager.gd @@ -5,6 +5,7 @@ extends Node @onready var coins: Node2D = $"../coins" @onready var badguys: Node2D = $"../badguys" @onready var player: Player = $"../CharacterBody2D" +@onready var ui: Control = $"../CanvasLayer/ui" var bulletsFiredTotal = 0 var bulletsMadeTotal = 0 @@ -66,6 +67,7 @@ func buildLevel(): if obj is Slime: totalBadguys +=1 obj.playerDamageSignal.connect(Gamecontroller.playerDamage) + Gamecontroller.addBadGuy(obj) Gamecontroller.numberOfBadguys(totalBadguys) #wire up the triggers for obj in triggers.get_children(): @@ -77,6 +79,12 @@ func buildLevel(): Gamecontroller.destroySignal.connect(destroy) Gamecontroller.levelCompleteSignal.connect(loadLevel) Gamecontroller.playerHurtSignal.connect(playerHurt) + Gamecontroller.playerHurtSignal.connect(ui.healthUpdate) + Gamecontroller.playerKillSignal.connect(playerKill) + Gamecontroller.timerUpdateSignal.connect(ui.timerUpdate) + Gamecontroller.coinUpdateSignal.connect(ui.coinsUpdate) + #listen to player + player.deathCompleteSignal.connect(Gamecontroller.deathComplete) func loadLevel(level): get_tree().change_scene_to_file(level) @@ -84,5 +92,7 @@ func loadLevel(level): func _ready() -> void: buildLevel() Gamecontroller.reset() -func playerHurt(health): +func playerHurt(health, _maxHealth): player.hurtPlayer(health) +func playerKill(): + player.killPlayer() diff --git a/februarygodotgame/scripts/slime.gd b/februarygodotgame/scripts/slime.gd index b9faa9c..6c394db 100644 --- a/februarygodotgame/scripts/slime.gd +++ b/februarygodotgame/scripts/slime.gd @@ -1,7 +1,31 @@ class_name Slime extends Area2D signal playerDamageSignal +@onready var right_cast: RayCast2D = $rightCast +@onready var left_cast: RayCast2D = $leftCast +@onready var right_cast_floor: RayCast2D = $rightCastFloor +@onready var left_cast_floor: RayCast2D = $leftCastFloor +var speed = 100 +var direction = 1 + +func _process(delta: float) -> void: + if not right_cast_floor.is_colliding(): + direction = -1 + if not left_cast_floor.is_colliding(): + direction = 1 + + if right_cast.is_colliding(): + var body = right_cast.get_collider() + if not body is Player: + direction = -1 + if left_cast.is_colliding(): + var body = left_cast.get_collider() + if not body is Player: + direction = 1 + + position.x += direction * speed * delta + func _on_body_entered(body: Node2D) -> void: print("Bad guy contact") playerDamageSignal.emit(body, self) diff --git a/februarygodotgame/scripts/ui.gd b/februarygodotgame/scripts/ui.gd new file mode 100644 index 0000000..2306fab --- /dev/null +++ b/februarygodotgame/scripts/ui.gd @@ -0,0 +1,24 @@ +extends Control +@onready var timer: Label = $VBoxContainer/HBoxContainer/MarginContainer2/timer +@onready var coins: Label = $VBoxContainer/HBoxContainer/MarginContainer3/coins +@onready var health: Label = $VBoxContainer/HBoxContainer/MarginContainer/VBoxContainer/health +@onready var health_progress: ProgressBar = $VBoxContainer/HBoxContainer/MarginContainer/VBoxContainer/healthProgress + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + health.text="HEALTH" + timer.text="TIMER" + coins.text="COINS" + +func healthUpdate(currentHealth, maxHealth): + print( float(currentHealth) / maxHealth * 100) + health.text = "Health: "+str(currentHealth)+" of "+str(maxHealth) + health_progress.value = float(currentHealth) / maxHealth * 100 + +func timerUpdate(timeRemaining, _timeAvailable): + timer.text = "Time: "+str(timeRemaining) + +func coinsUpdate(coinsCollected, coinsAvailable): + print(coinsCollected, coinsAvailable) + coins.text = "Coins: "+str(coinsCollected)+" of "+str(coinsAvailable)