Implement logging system: add GameLogger class for managing log messages, integrate logging in HUDLayer and ShrodingersMine for enhanced gameplay feedback.

This commit is contained in:
2026-04-03 00:38:27 +01:00
parent 94be1f104f
commit b325b35c88
5 changed files with 61 additions and 2 deletions
+2
View File
@@ -10,6 +10,8 @@ class ShrodingersMine < Trap
return false if entity == :character # shrodingers mine is safe for the player, so don't destroy it or cause a blast if the player steps on it
if rand < 0.7 # 70% chance to be a landmine, 30% chance to be a dud
$bus.emit(:blast, @x, @y, 50, 50, :safe) # blast radius of 50 and damage of 50, and always safe for the player
else
$bus.emit(:log, "You hear a click, but nothing happens. It was a dud!")
end
true # to destroy the trap
end