This commit is contained in:
Waldemar Tomme 2024-01-27 16:07:27 +01:00
parent 5c45ce6f01
commit ced61c6a45
2 changed files with 6 additions and 11 deletions

View File

@ -77,10 +77,6 @@ func _input(event):
elif Input.is_key_pressed(KEY_ENTER): elif Input.is_key_pressed(KEY_ENTER):
update_mood(-1.) update_mood(-1.)
func hear_joke():
var change = randf_range(-3., 3.)
update_mood(change)
func update_mood(change: float): func update_mood(change: float):
if mood > profile.happy_threshold and change > 0 and laughter_left <= 0: if mood > profile.happy_threshold and change > 0 and laughter_left <= 0:
laughter_left = laughter_duration laughter_left = laughter_duration

View File

@ -1,21 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://cl4fax7fbh2g7"] [gd_scene load_steps=5 format=3 uid="uid://cl4fax7fbh2g7"]
[ext_resource type="Script" path="res://scenes/crowd/person.gd" id="1_mx0i8"] [ext_resource type="Script" path="res://scenes/crowd/person.gd" id="1_mx0i8"]
[ext_resource type="Script" path="res://scenes/crowd/audience_profile.gd" id="2_bsodr"] [ext_resource type="Script" path="res://scenes/crowd/audience_profile.gd" id="2_bsodr"]
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_kbo53"]
size = Vector2(20, 30)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5rd5b"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_5rd5b"]
[node name="Person" type="Node2D" node_paths=PackedStringArray("head", "body", "profile")] [node name="Person" type="Sprite2D" node_paths=PackedStringArray("head", "profile")]
texture = SubResource("PlaceholderTexture2D_kbo53")
script = ExtResource("1_mx0i8") script = ExtResource("1_mx0i8")
head = NodePath("Head") head = NodePath("Head")
body = NodePath("Body")
profile = NodePath("Profile") profile = NodePath("Profile")
expression = 1 expression = 1
[node name="Body" type="Node2D" parent="."]
position = Vector2(0, 15)
scale = Vector2(0.3, 0.3)
[node name="Head" type="Node2D" parent="."] [node name="Head" type="Node2D" parent="."]
position = Vector2(0, -16) position = Vector2(0, -16)
scale = Vector2(0.3, 0.3) scale = Vector2(0.3, 0.3)