diff --git a/godot/scenes/Boundary.gd b/godot/scenes/Boundary.gd index 6861257..cd54d2b 100644 --- a/godot/scenes/Boundary.gd +++ b/godot/scenes/Boundary.gd @@ -3,16 +3,20 @@ extends Node2D @export var width = 200. + # Called when the node enters the scene tree for the first time. func _ready(): - pass # Replace with function body. + pass # Replace with function body. + # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(_delta): pass + func get_most_left_position(): return global_position.x - width / 2 - + + func get_most_right_position(): return global_position.x + width / 2 diff --git a/godot/scenes/boot/bootsplash_scene.gd b/godot/scenes/boot/bootsplash_scene.gd index 58f0858..f8ef250 100644 --- a/godot/scenes/boot/bootsplash_scene.gd +++ b/godot/scenes/boot/bootsplash_scene.gd @@ -1,14 +1,15 @@ class_name BootsplashScene extends Control -@export var fade_duration:float = 1.0 -@export var stay_duration:float = 1.5 -@export var node:PackedScene -@export var next_scene:PackedScene -@export var interuptable:bool = true +@export var fade_duration: float = 1.0 +@export var stay_duration: float = 1.5 +@export var node: PackedScene +@export var next_scene: PackedScene +@export var interuptable: bool = true @onready var control = %NodeContainer -@onready var instance:Node2D = node.instantiate() +@onready var instance: Node2D = node.instantiate() + func _ready(): instance.modulate.a = 0.0 @@ -16,21 +17,28 @@ func _ready(): var tween = create_tween() tween.set_trans(Tween.TRANS_CUBIC) tween.set_ease(Tween.EASE_IN) - tween.tween_property(instance, "modulate:a", 1.0, fade_duration)\ - .from(0.0)\ - .finished.connect(_fade_out) - + tween.tween_property(instance, "modulate:a", 1.0, fade_duration).from(0.0).finished.connect( + _fade_out + ) + + func _process(_delta): if interuptable and Input.is_action_just_pressed("exit"): _change_scene() - + + func _fade_out(): var tween = create_tween() tween.set_trans(Tween.TRANS_CUBIC) tween.set_ease(Tween.EASE_IN) - tween.tween_property(instance, "modulate:a", 0.0, fade_duration)\ - .set_delay(stay_duration)\ - .finished.connect(_change_scene) + ( + tween + . tween_property(instance, "modulate:a", 0.0, fade_duration) + . set_delay(stay_duration) + . finished + . connect(_change_scene) + ) + func _change_scene(): get_tree().change_scene_to_packed(next_scene) diff --git a/godot/scenes/crowd/crowd.gd b/godot/scenes/crowd/crowd.gd index 04621ae..9c6a0a6 100644 --- a/godot/scenes/crowd/crowd.gd +++ b/godot/scenes/crowd/crowd.gd @@ -3,9 +3,9 @@ extends Node2D @export_range(1, 16, 1) var max_persons = 16 +var audience: Array[AudienceMember] = [] +var overall_mood: float = 0 -var audience : Array[AudienceMember] = [] -var overall_mood : float = 0 func _ready(): var counter = 0 @@ -20,6 +20,7 @@ func _ready(): if counter == max_persons: break + # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(_delta): overall_mood = 0 diff --git a/godot/scenes/crowd/crowd.tscn b/godot/scenes/crowd/crowd.tscn index 9cedd4e..5101ffb 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) @@ -131,3 +131,7 @@ z_index = 46 position = Vector2(237, 15) [node name="Chair" parent="Seats/Seat_16" instance=ExtResource("3_y4hpm")] + +[node name="CanvasModulate" type="CanvasModulate" parent="."] +show_behind_parent = true +color = Color(0.494118, 0.494118, 0.494118, 1) diff --git a/godot/scenes/stage.tscn b/godot/scenes/stage.tscn index 9afff0c..0a5cac7 100644 --- a/godot/scenes/stage.tscn +++ b/godot/scenes/stage.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=18 format=3 uid="uid://cicyfp5xjvvu4"] +[gd_scene load_steps=19 format=3 uid="uid://cicyfp5xjvvu4"] [ext_resource type="Texture2D" uid="uid://bg85if5rrrdmm" path="res://sprites/room/buehne.svg" id="1_32lst"] [ext_resource type="Script" path="res://scenes/Tim.gd" id="1_g3k2b"] [ext_resource type="Texture2D" uid="uid://kq63ictuirhc" path="res://sprites/tim_side.png" id="1_saxit"] [ext_resource type="Script" path="res://scenes/Boundary.gd" id="2_8p6ir"] [ext_resource type="PackedScene" uid="uid://r1i7ln2hpwq5" path="res://scenes/joke_button.tscn" id="3_0t41i"] +[ext_resource type="Texture2D" uid="uid://bmx2q0w1s046n" path="res://sprites/ui/spotlight.svg" id="3_8lu50"] [ext_resource type="Texture2D" uid="uid://b8tb4o75kjffn" path="res://sprites/tim_talk.svg" id="3_e1fvx"] [ext_resource type="Script" path="res://scenes/DisplayStamina.gd" id="6_88orn"] [ext_resource type="FontFile" uid="uid://le2vdo2626vw" path="res://fonts/Montserrat-Medium.ttf" id="6_pb3a7"] @@ -121,9 +122,18 @@ action = "joke_button_3" [node name="Joke Transmitter" type="Node2D" parent="Tim"] +[node name="Spotlight" type="PointLight2D" parent="Tim/Joke Transmitter"] +self_modulate = Color(1, 1, 1, 0) +show_behind_parent = true +z_index = -20 +position = Vector2(2.08165e-12, -500) +energy = 0.4 +texture = ExtResource("3_8lu50") + [node name="Area2D" type="Area2D" parent="Tim/Joke Transmitter"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Tim/Joke Transmitter/Area2D"] +position = Vector2(0, -176) shape = SubResource("RectangleShape2D_wmfel") [node name="AnimationPlayer" type="AnimationPlayer" parent="Tim"] diff --git a/godot/sprites/ui/spotlight.svg b/godot/sprites/ui/spotlight.svg new file mode 100644 index 0000000..ce64ad2 --- /dev/null +++ b/godot/sprites/ui/spotlight.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + diff --git a/godot/sprites/ui/spotlight.svg.import b/godot/sprites/ui/spotlight.svg.import new file mode 100644 index 0000000..b30741e --- /dev/null +++ b/godot/sprites/ui/spotlight.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bmx2q0w1s046n" +path="res://.godot/imported/spotlight.svg-f6d684577e7bd3fc0fb3e8fdd58e1327.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/ui/spotlight.svg" +dest_files=["res://.godot/imported/spotlight.svg-f6d684577e7bd3fc0fb3e8fdd58e1327.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false