2 Commits

Author SHA1 Message Date
45bf0f5e45 game loop improvement
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 8s
Create tag and build when new code gets to main / Export (push) Successful in 1m19s
2026-01-31 18:16:10 +01:00
f39dc0df86 changing viewport settings for itch
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 8s
Create tag and build when new code gets to main / Export (push) Successful in 1m16s
2026-01-31 15:29:56 +01:00
20 changed files with 322 additions and 53 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dwy3kklywl0ci"
path="res://.godot/imported/Perso 1.png-9a3fe614fc1ec0311763317776c3a444.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/characters/Perso 1.png"
dest_files=["res://.godot/imported/Perso 1.png-9a3fe614fc1ec0311763317776c3a444.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c726frtpkk1a8"
path="res://.godot/imported/Perso 2.png-153e431447e73fbc5fd3cb3d8e8b041f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/characters/Perso 2.png"
dest_files=["res://.godot/imported/Perso 2.png-153e431447e73fbc5fd3cb3d8e8b041f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

View File

@@ -40,6 +40,7 @@ BackgroundMusicPlayer="*uid://djyx7damwjgdg"
window/size/viewport_width=1920
window/size/viewport_height=1080
window/stretch/mode="canvas_items"
[editor_plugins]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="CharacterResource" format=3 uid="uid://c87odmn680x7"]
[ext_resource type="Texture2D" uid="uid://cudme4y8elyha" path="res://assets/sprites/sprites by judas la carotte/sprite2 happy.png" id="1_tppor"]
[ext_resource type="Texture2D" uid="uid://dwy3kklywl0ci" path="res://assets/characters/Perso 1.png" id="1_tppor"]
[ext_resource type="Script" uid="uid://bwam50qxikpw4" path="res://scenes/character/chara_resource.gd" id="2_cyb15"]
[ext_resource type="Script" uid="uid://cya40uohlvgbr" path="res://scenes/character/trait.gd" id="3_s53hh"]
[ext_resource type="Resource" uid="uid://cefwc4j3p7m3v" path="res://resources/traits/black.tres" id="4_tppor"]
@@ -12,10 +12,8 @@
script = ExtResource("2_cyb15")
name = "Duchex"
chara_sprite = ExtResource("1_tppor")
mask_eyes_position = Vector2(-65.16, -435.27)
mask_eyes_rotation = 0.029670597283903404
mask_mouth_position = Vector2(-20.035, -304.18)
mask_mouth_rotation = -0.17627825445142767
mask_eyes_position = Vector2(59.355, 227)
mask_mouth_position = Vector2(64.8, 432.04)
traits = Array[ExtResource("3_s53hh")]([ExtResource("4_tppor"), ExtResource("5_cyb15"), ExtResource("6_tppor"), ExtResource("7_03y2d")])
preferences = Dictionary[int, int]({
0: 0,

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="CharacterResource" format=3 uid="uid://wq3g1j3l4gl6"]
[ext_resource type="Texture2D" uid="uid://b60pu6ukbobb2" path="res://assets/sprites/sprites by judas la carotte/sprite1 happy small.png" id="1_g8bvo"]
[ext_resource type="Texture2D" uid="uid://c726frtpkk1a8" path="res://assets/characters/Perso 2.png" id="1_d1164"]
[ext_resource type="Script" uid="uid://bwam50qxikpw4" path="res://scenes/character/chara_resource.gd" id="2_g8bvo"]
[ext_resource type="Script" uid="uid://cya40uohlvgbr" path="res://scenes/character/trait.gd" id="3_dkw07"]
[ext_resource type="Resource" uid="uid://bc376om20da8m" path="res://resources/traits/royal.tres" id="8_d1164"]
@@ -12,9 +12,9 @@
[resource]
script = ExtResource("2_g8bvo")
name = "Queen"
chara_sprite = ExtResource("1_g8bvo")
mask_eyes_position = Vector2(-58.06, -232.2)
mask_mouth_position = Vector2(-27.795, -167.255)
chara_sprite = ExtResource("1_d1164")
mask_eyes_position = Vector2(13.285, 181.09)
mask_mouth_position = Vector2(26.595, 398.745)
traits = Array[ExtResource("3_dkw07")]([ExtResource("9_aywjr"), ExtResource("8_j0xhd"), ExtResource("10_tw1u2"), ExtResource("8_d1164"), ExtResource("11_utmh4")])
preferences = Dictionary[int, int]({
5: 2,

View File

@@ -48,7 +48,6 @@ func _engine_process(delta: float) -> void:
func come_in() -> void:
print("come ine")
animation_player.play("come_in")

View File

@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://dnt4l1eghm1gi" path="res://scenes/character/character.gd" id="1_cuyo6"]
[ext_resource type="Resource" uid="uid://wq3g1j3l4gl6" path="res://resources/characters/queen.tres" id="2_fgi2k"]
[ext_resource type="Texture2D" uid="uid://b60pu6ukbobb2" path="res://assets/sprites/sprites by judas la carotte/sprite1 happy small.png" id="3_f8hpl"]
[ext_resource type="Texture2D" uid="uid://c726frtpkk1a8" path="res://assets/characters/Perso 2.png" id="3_f8hpl"]
[ext_resource type="PackedScene" uid="uid://3jlukpb5hefb" path="res://scenes/mask/mask.tscn" id="3_mutn8"]
[sub_resource type="Animation" id="Animation_fgi2k"]
@@ -17,7 +17,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
"values": [Vector2(0.5, 0.5)]
}
tracks/1/type = "value"
tracks/1/imported = false
@@ -69,7 +69,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0, 1.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0.8, 0.8), Vector2(1, 1)]
"values": [Vector2(0.4, 0.4), Vector2(0.5, 0.5)]
}
tracks/1/type = "value"
tracks/1/imported = false
@@ -105,7 +105,7 @@ tracks/3/keys = {
"times": PackedFloat32Array(0, 1.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(1, 1, 1, 1)]
"values": [Color(0, 0, 0, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_7ex5l"]
@@ -121,7 +121,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0, 1.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(0, 0, 0, 1)]
"values": [Color(1, 1, 1, 1), Color(0, 0, 0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
@@ -156,6 +156,7 @@ _data = {
}
[node name="Character" type="Node2D" unique_id=138741531]
scale = Vector2(0.5, 0.5)
script = ExtResource("1_cuyo6")
chara_resource = ExtResource("2_fgi2k")
@@ -163,10 +164,10 @@ chara_resource = ExtResource("2_fgi2k")
texture = ExtResource("3_f8hpl")
[node name="MaskMouth" parent="." unique_id=1087336064 instance=ExtResource("3_mutn8")]
position = Vector2(-27.795, -167.255)
position = Vector2(26.595, 398.745)
[node name="MaskEyes" parent="." unique_id=428968220 instance=ExtResource("3_mutn8")]
position = Vector2(-58.06, -232.2)
position = Vector2(13.285, 181.09)
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=713965213]
libraries/ = SubResource("AnimationLibrary_7ex5l")

View File

@@ -33,6 +33,8 @@
[ext_resource type="Resource" uid="uid://ca2fcdibf0mdm" path="res://resources/guests/queen_unracist.tres" id="28_r1bmu"]
[ext_resource type="Resource" uid="uid://ctqdbo8xg3v88" path="res://resources/guests/duchex_cat.tres" id="29_6w6mm"]
[ext_resource type="Texture2D" uid="uid://c3bx6kf7frbwk" path="res://example/Random Upgrades/icons/all_icons/all_icons_1.tres" id="29_i7in8"]
[ext_resource type="Script" uid="uid://bb0od2qqdx3or" path="res://scenes/main/ready_bell.gd" id="33_tbnf8"]
[ext_resource type="PackedScene" uid="uid://cayrxqnypoytu" path="res://scenes/table/table.tscn" id="35_r1bmu"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_gkmcc"]
random_pitch = 1.122462
@@ -374,6 +376,7 @@ libraries/ = SubResource("AnimationLibrary_hxu8e")
[node name="ReadyBell" type="Area2D" parent="." unique_id=1350504622]
position = Vector2(0, 426)
script = ExtResource("33_tbnf8")
[node name="CollisionShape2D" type="CollisionShape2D" parent="ReadyBell" unique_id=403528288]
shape = SubResource("CircleShape2D_62atk")
@@ -381,6 +384,15 @@ shape = SubResource("CircleShape2D_62atk")
[node name="Sprite2D" type="Sprite2D" parent="ReadyBell" unique_id=1323765091]
texture = ExtResource("29_i7in8")
[node name="Table" parent="." unique_id=1315188460 instance=ExtResource("35_r1bmu")]
position = Vector2(2589, 56)
[node name="Table2" parent="." unique_id=141765359 instance=ExtResource("35_r1bmu")]
position = Vector2(2272, 285)
[node name="Table3" parent="." unique_id=569701756 instance=ExtResource("35_r1bmu")]
position = Vector2(3014, 285)
[connection signal="mouse_entered" from="MaskList" to="." method="_on_mask_list_mouse_entered"]
[connection signal="mouse_exited" from="MaskList" to="." method="_on_mask_list_mouse_exited"]
[connection signal="mouse_entered" from="GuestList" to="." method="_on_guest_list_mouse_entered"]
@@ -390,3 +402,8 @@ texture = ExtResource("29_i7in8")
[connection signal="mouse_entered" from="Camera2D/PanLeft" to="Camera2D" method="_on_pan_left_mouse_entered"]
[connection signal="mouse_exited" from="Camera2D/PanLeft" to="Camera2D" method="_on_pan_left_mouse_exited"]
[connection signal="input_event" from="ReadyBell" to="GameManager" method="_on_ready_bell_input_event"]
[connection signal="mouse_entered" from="ReadyBell" to="ReadyBell" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="ReadyBell" to="ReadyBell" method="_on_mouse_exited"]
[connection signal="seat_clicked" from="Table" to="GameManager" method="on_seat_clicked"]
[connection signal="seat_clicked" from="Table2" to="GameManager" method="on_seat_clicked"]
[connection signal="seat_clicked" from="Table3" to="GameManager" method="on_seat_clicked"]

19
scenes/main/ready_bell.gd Normal file
View File

@@ -0,0 +1,19 @@
extends Area2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_mouse_entered() -> void:
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_POINTING_HAND)
func _on_mouse_exited() -> void:
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)

View File

@@ -0,0 +1 @@
uid://bb0od2qqdx3or

View File

@@ -39,6 +39,11 @@ enum Levels {
var current_game_state = GameState.READY
var current_level = Levels.LVL1
var first_guest = true
var current_guest: MaskedChara
var selected_seat: Seat
@onready var camera_2d: Camera2D = $"../Camera2D"
func create_new_roster() -> void:
print("Create new roster")
@@ -61,31 +66,13 @@ func create_new_roster() -> void:
# Associate a single mask (for now) to the character
var mask: MaskResource = mask_roster.pick_random()
var all_masks: Array[MaskResource] = [mask]
var masked_chara = MaskedChara.new(chara, all_masks)
var face_mask = mask if mask.region == MaskResource.Region.EYES else null
var mouth_mask = mask if mask.region == MaskResource.Region.MOUTH else null
var masked_chara = MaskedChara.new(chara, face_mask, mouth_mask)
current_chara_roster.append(masked_chara)
print("Added %s to roster" % chara.name)
func on_ready_bell_pressed() -> void:
if(current_game_state != GameState.READY):
return
print("ready bell pressed")
if current_level == Levels.LVL1:
print("prepare_level_one")
current_chara_roster = [lvl1_guest_1, lvl1_guest_2]
elif current_level == Levels.LVL2:
print("prepare_level_two")
current_chara_roster = [lvl2_guest_1, lvl2_guest_2]
else:
create_new_roster()
current_game_state = GameState.GUEST_REVIEW
first_guest = true
review_next_guest()
func review_next_guest():
# See previous guest out
if not first_guest:
@@ -94,22 +81,17 @@ func review_next_guest():
await timer.timeout
# Check if we have more guests, if not we go to the ending
print(current_chara_roster)
var guest: MaskedChara = current_chara_roster.pop_front()
if guest == null:
current_guest = current_chara_roster.pop_front()
if current_guest == null:
current_game_state = GameState.FINISHED
compute_ending()
return
# Process next guest
print("Guest is %s" % guest.character.name)
character.chara_resource = guest.character
var eyes_mask_index = guest.masks.find_custom(func(mask: MaskResource): return mask.region == MaskResource.Region.EYES)
var mouth_mask_index = guest.masks.find_custom(func(mask: MaskResource): return mask.region == MaskResource.Region.MOUTH)
if eyes_mask_index != -1:
character.mask_eyes.mask_resource = guest.masks[eyes_mask_index]
if mouth_mask_index != -1:
character.mask_mouth.mask_resource = guest.masks[mouth_mask_index]
print("Guest is %s" % current_guest.character.name)
character.chara_resource = current_guest.character
character.mask_eyes.mask_resource = current_guest.face_mask
character.mask_mouth.mask_resource = current_guest.mouth_mask
first_guest = false
character.come_in()
@@ -133,3 +115,38 @@ func _on_ready_bell_input_event(viewport: Node, event: InputEvent, shape_idx: in
on_ready_bell_pressed()
else: # debug
review_next_guest()
func on_ready_bell_pressed() -> void:
if(current_game_state != GameState.READY):
return
print("ready bell pressed")
if current_level == Levels.LVL1:
print("prepare_level_one")
current_chara_roster = [lvl1_guest_1, lvl1_guest_2]
elif current_level == Levels.LVL2:
print("prepare_level_two")
current_chara_roster = [lvl2_guest_1, lvl2_guest_2]
else:
create_new_roster()
current_game_state = GameState.GUEST_REVIEW
first_guest = true
review_next_guest()
func on_seat_clicked(seat: Seat) -> void:
if current_guest == null and not current_game_state == GameState.GUEST_REVIEW:
return
selected_seat = seat
var camera_tween = get_tree().create_tween()
camera_tween.set_ease(Tween.EASE_IN_OUT)
camera_tween.set_trans(Tween.TRANS_CUBIC)
camera_tween.tween_property(camera_2d, "position", Vector2.ZERO, 1.0)
camera_tween.tween_callback(camera_tween_cb)
func camera_tween_cb() -> void:
selected_seat.set_guest(current_guest)
review_next_guest()

View File

@@ -2,12 +2,17 @@ extends Resource
class_name MaskedChara
@export var character: CharacterResource
@export var masks: Array[MaskResource]
@export var face_mask: MaskResource
@export var mouth_mask: MaskResource
# Make sure that every parameter has a default value.
# Otherwise, there will be problems with creating and editing
# your resource via the inspector.
func _init(p_character: CharacterResource = CharacterResource.new(), p_mask: Array[MaskResource] = []):
func _init(
p_character: CharacterResource = CharacterResource.new(),
p_mask_face: MaskResource = MaskResource.new(),
p_mask_mouth: MaskResource = MaskResource.new()):
character = p_character
masks = p_mask
face_mask = p_mask_face
mouth_mask = p_mask_mouth

67
scenes/seat/seat.gd Normal file
View File

@@ -0,0 +1,67 @@
@tool
extends Area2D
class_name Seat
signal seat_clicked(Seat)
@export var guest: MaskedChara:
set(new_resource):
guest = new_resource
_on_chara_resource_changed()
@onready var character: Character = $Character
@onready var empty: Sprite2D = $Empty
func _process(delta: float) -> void:
character.scale.x = 0.15
character.scale.y = 0.15
character.position.y = -135
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
guest = null
character.visible = false
empty.visible = true
func _on_chara_resource_changed() -> void:
if guest == null:
return
if character != null:
empty.visible = false
character.visible = true
character.chara_resource = guest.character
character.mask_eyes.mask_resource = guest.face_mask
character.mask_mouth.mask_resource = guest.mouth_mask
func set_guest(p_guest: MaskedChara) -> void:
if p_guest == null:
return
guest = p_guest
empty.visible = false
character.visible = true
character.chara_resource = guest.character
character.mask_eyes.mask_resource = guest.face_mask
character.mask_mouth.mask_resource = guest.mouth_mask
func _on_mouse_entered() -> void:
if guest != null:
return
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_POINTING_HAND)
func _on_mouse_exited() -> void:
if guest != null:
return
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)
func _on_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
if event is InputEventMouseButton and event.is_pressed() and guest == null:
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)
seat_clicked.emit(self)

1
scenes/seat/seat.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://cuojjiwxidmwu

25
scenes/seat/seat.tscn Normal file
View File

@@ -0,0 +1,25 @@
[gd_scene format=3 uid="uid://l0hl170iqkgx"]
[ext_resource type="Script" uid="uid://cuojjiwxidmwu" path="res://scenes/seat/seat.gd" id="1_pceab"]
[ext_resource type="Resource" uid="uid://ca2fcdibf0mdm" path="res://resources/guests/queen_unracist.tres" id="2_wnjs1"]
[ext_resource type="PackedScene" uid="uid://bvpyqyftqhy45" path="res://scenes/character/character.tscn" id="3_dxmy0"]
[ext_resource type="Texture2D" uid="uid://cftllq6l7xclt" path="res://icon.svg" id="4_wnjs1"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rofvo"]
size = Vector2(128, 128)
[node name="Seat" type="Area2D" unique_id=1604639021]
script = ExtResource("1_pceab")
guest = ExtResource("2_wnjs1")
[node name="Character" parent="." unique_id=138741531 instance=ExtResource("3_dxmy0")]
[node name="Empty" type="Sprite2D" parent="." unique_id=357649392]
texture = ExtResource("4_wnjs1")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1054126207]
shape = SubResource("RectangleShape2D_rofvo")
[connection signal="input_event" from="." to="." method="_on_input_event"]
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]

17
scenes/table/table.gd Normal file
View File

@@ -0,0 +1,17 @@
extends Node2D
class_name Table
signal seat_clicked(Seat)
@onready var seat_1: Seat = $Seat1
@onready var seat_2: Seat = $Seat2
@onready var seat_3: Seat = $Seat3
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func on_seat_clicked(seat: Seat) -> void:
seat_clicked.emit(seat)

View File

@@ -0,0 +1 @@
uid://r542aaur4vsc

20
scenes/table/table.tscn Normal file
View File

@@ -0,0 +1,20 @@
[gd_scene format=3 uid="uid://cayrxqnypoytu"]
[ext_resource type="Script" uid="uid://r542aaur4vsc" path="res://scenes/table/table.gd" id="1_ov72x"]
[ext_resource type="PackedScene" uid="uid://l0hl170iqkgx" path="res://scenes/seat/seat.tscn" id="1_qavd0"]
[node name="Table" type="Node2D" unique_id=1315188460]
script = ExtResource("1_ov72x")
[node name="Seat1" parent="." unique_id=1604639021 instance=ExtResource("1_qavd0")]
position = Vector2(-204, -87)
[node name="Seat2" parent="." unique_id=848918585 instance=ExtResource("1_qavd0")]
position = Vector2(-14, -117)
[node name="Seat3" parent="." unique_id=150555678 instance=ExtResource("1_qavd0")]
position = Vector2(173, -98)
[connection signal="seat_clicked" from="Seat1" to="." method="on_seat_clicked"]
[connection signal="seat_clicked" from="Seat2" to="." method="on_seat_clicked"]
[connection signal="seat_clicked" from="Seat3" to="." method="on_seat_clicked"]