From 677a7c518a5fc003cc8dd0a8ee3ec7d393b18373 Mon Sep 17 00:00:00 2001 From: Waldemar Tomme Date: Sat, 27 Jan 2024 20:25:10 +0100 Subject: [PATCH] Add hook stub for empty stamina --- godot/scenes/Tim.gd | 11 ++++++++++- godot/scenes/crowd/crowd.tscn | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/godot/scenes/Tim.gd b/godot/scenes/Tim.gd index 5254eba..77ec04b 100644 --- a/godot/scenes/Tim.gd +++ b/godot/scenes/Tim.gd @@ -27,10 +27,19 @@ func _process(delta): global_position = Vector2(boundary.get_most_left_position(), global_position.y) -func _on_joke_button_button_pressed(joke): +func _on_joke_button_button_pressed(joke: Joke): + stamina -= joke.required_stamina + for body in transmitter_area.get_overlapping_bodies(): var person = body.find_parent("Person") if not (person is AudienceMember): continue person.on_joke(joke) + + + if stamina <= 0: + _on_stamina_empty() + +func _on_stamina_empty(): + pass diff --git a/godot/scenes/crowd/crowd.tscn b/godot/scenes/crowd/crowd.tscn index d681e30..9f61b72 100644 --- a/godot/scenes/crowd/crowd.tscn +++ b/godot/scenes/crowd/crowd.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://scenes/crowd/crowd.gd" id="1_y7wyj"] [ext_resource type="Texture2D" uid="uid://b6p145ne8x013" path="res://sprites/room/table.svg" id="2_bax5s"] -[ext_resource type="PackedScene" uid="uid://bbehbuw5lvfkr" path="res://sprites/room/chair.tscn" id="3_y4hpm"] +[ext_resource type="PackedScene" path="res://sprites/room/chair.tscn" id="3_y4hpm"] [node name="Crowd" type="Node2D"] position = Vector2(240, 232)