Compare commits
2 Commits
de0c6a959d
...
v0.1.23
| Author | SHA1 | Date | |
|---|---|---|---|
| a4cf579c8e | |||
| 6c50970d7e |
BIN
assets/characters/Perso 4.png
Normal file
BIN
assets/characters/Perso 4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
40
assets/characters/Perso 4.png.import
Normal file
40
assets/characters/Perso 4.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dmmhwqsi3im3w"
|
||||
path="res://.godot/imported/Perso 4.png-e989af224594ede122096ea4cc4a8672.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/characters/Perso 4.png"
|
||||
dest_files=["res://.godot/imported/Perso 4.png-e989af224594ede122096ea4cc4a8672.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
|
||||
@@ -4,6 +4,7 @@
|
||||
[ext_resource type="Script" uid="uid://bwam50qxikpw4" path="res://scenes/character/chara_resource.gd" id="2_cyb15"]
|
||||
[ext_resource type="Resource" uid="uid://b6614fqoymxur" path="res://resources/traits/silent.tres" id="3_q0kni"]
|
||||
[ext_resource type="Script" uid="uid://cya40uohlvgbr" path="res://scenes/character/trait.gd" id="3_s53hh"]
|
||||
[ext_resource type="Resource" uid="uid://c4kpcm4tplsgg" path="res://resources/traits/alone.tres" id="4_s53hh"]
|
||||
[ext_resource type="Resource" uid="uid://lhskiwag15k" path="res://resources/traits/talkative.tres" id="4_w5qmk"]
|
||||
[ext_resource type="Resource" uid="uid://ct4iy75ai7lmy" path="res://resources/traits/enby.tres" id="6_cyb15"]
|
||||
[ext_resource type="Resource" uid="uid://cb8jguybr1tlj" path="res://resources/traits/white.tres" id="7_s53hh"]
|
||||
@@ -19,6 +20,7 @@ mask_mouth_position = Vector2(76.505, 203.355)
|
||||
mask_mouth_rotation = -0.05235987755982989
|
||||
traits = Array[ExtResource("3_s53hh")]([ExtResource("4_w5qmk"), ExtResource("6_cyb15"), ExtResource("7_s53hh"), ExtResource("8_p10lp")])
|
||||
preferences = Dictionary[ExtResource("3_s53hh"), int]({
|
||||
ExtResource("3_q0kni"): 0
|
||||
ExtResource("3_q0kni"): 0,
|
||||
ExtResource("4_s53hh"): 4
|
||||
})
|
||||
metadata/_custom_type_script = "uid://bwam50qxikpw4"
|
||||
|
||||
@@ -4,7 +4,12 @@
|
||||
[ext_resource type="Script" uid="uid://bwam50qxikpw4" path="res://scenes/character/chara_resource.gd" id="2_ce0p8"]
|
||||
[ext_resource type="Script" uid="uid://cya40uohlvgbr" path="res://scenes/character/trait.gd" id="3_n21sh"]
|
||||
[ext_resource type="Resource" uid="uid://lhskiwag15k" path="res://resources/traits/talkative.tres" id="3_tvmgq"]
|
||||
[ext_resource type="Resource" uid="uid://c4kpcm4tplsgg" path="res://resources/traits/alone.tres" id="4_tl7uu"]
|
||||
[ext_resource type="Resource" uid="uid://bvophatys2o1o" path="res://resources/traits/old.tres" id="5_n21sh"]
|
||||
[ext_resource type="Resource" uid="uid://b6614fqoymxur" path="res://resources/traits/silent.tres" id="5_tl7uu"]
|
||||
[ext_resource type="Resource" uid="uid://cefwc4j3p7m3v" path="res://resources/traits/black.tres" id="7_12asi"]
|
||||
[ext_resource type="Resource" uid="uid://bmx28vnfhcs8b" path="res://resources/traits/man.tres" id="8_ce0p8"]
|
||||
[ext_resource type="Resource" uid="uid://blu5de2dhiu46" path="res://resources/traits/young.tres" id="9_ce0p8"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_ce0p8")
|
||||
@@ -13,8 +18,10 @@ chara_sprite = ExtResource("1_d1fpd")
|
||||
mask_eyes_position = Vector2(-23.295, -0.335)
|
||||
mask_eyes_rotation = -0.03490658503988659
|
||||
mask_mouth_position = Vector2(-1.83, 2.27)
|
||||
traits = Array[ExtResource("3_n21sh")]([ExtResource("5_tl7uu")])
|
||||
traits = Array[ExtResource("3_n21sh")]([ExtResource("5_tl7uu"), ExtResource("7_12asi"), ExtResource("8_ce0p8"), ExtResource("9_ce0p8")])
|
||||
preferences = Dictionary[ExtResource("3_n21sh"), int]({
|
||||
ExtResource("3_tvmgq"): 0
|
||||
ExtResource("3_tvmgq"): 0,
|
||||
ExtResource("4_tl7uu"): 0,
|
||||
ExtResource("5_n21sh"): 4
|
||||
})
|
||||
metadata/_custom_type_script = "uid://bwam50qxikpw4"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_resource type="Resource" script_class="CharacterResource" format=3 uid="uid://da2ptl3f7h0ot"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c57s3oksagauh" path="res://assets/sprites/sprites by judas la carotte/sprite3 happy small.png" id="1_k1rnw"]
|
||||
[ext_resource type="Resource" uid="uid://c4kpcm4tplsgg" path="res://resources/traits/alone.tres" id="3_ic6rb"]
|
||||
[ext_resource type="Script" uid="uid://bwam50qxikpw4" path="res://scenes/character/chara_resource.gd" id="3_vvog1"]
|
||||
[ext_resource type="Script" uid="uid://cya40uohlvgbr" path="res://scenes/character/trait.gd" id="4_0s3fj"]
|
||||
|
||||
@@ -12,4 +13,7 @@ mask_eyes_position = Vector2(-21.75, -274.015)
|
||||
mask_eyes_rotation = 0.06981317007977318
|
||||
mask_mouth_position = Vector2(-7.63, -186.87)
|
||||
mask_mouth_rotation = -0.1884955592153878
|
||||
preferences = Dictionary[ExtResource("4_0s3fj"), int]({
|
||||
ExtResource("3_ic6rb"): 1
|
||||
})
|
||||
metadata/_custom_type_script = "uid://bwam50qxikpw4"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[ext_resource type="Resource" uid="uid://lhskiwag15k" path="res://resources/traits/talkative.tres" id="3_y3hrs"]
|
||||
[ext_resource type="Resource" uid="uid://b6614fqoymxur" path="res://resources/traits/silent.tres" id="4_hdamc"]
|
||||
[ext_resource type="Resource" uid="uid://ct4iy75ai7lmy" path="res://resources/traits/enby.tres" id="5_wjlcp"]
|
||||
[ext_resource type="Resource" uid="uid://c4kpcm4tplsgg" path="res://resources/traits/alone.tres" id="6_hdamc"]
|
||||
[ext_resource type="Resource" uid="uid://bvophatys2o1o" path="res://resources/traits/old.tres" id="8_j0xhd"]
|
||||
[ext_resource type="Resource" uid="uid://cb8jguybr1tlj" path="res://resources/traits/white.tres" id="9_aywjr"]
|
||||
[ext_resource type="Resource" uid="uid://dmd7gilnmcefr" path="res://resources/traits/woman.tres" id="10_tw1u2"]
|
||||
@@ -17,11 +18,12 @@ chara_sprite = ExtResource("1_d1164")
|
||||
mask_eyes_position = Vector2(48, 187.345)
|
||||
mask_eyes_rotation = 0.05235987755982989
|
||||
mask_mouth_position = Vector2(31.595, 176.245)
|
||||
mask_mouth_rotation = 0.017453292519943295
|
||||
mask_mouth_rotation = 0.01745329251994329
|
||||
traits = Array[ExtResource("3_dkw07")]([ExtResource("3_y3hrs"), ExtResource("9_aywjr"), ExtResource("10_tw1u2"), ExtResource("8_j0xhd")])
|
||||
preferences = Dictionary[ExtResource("3_dkw07"), int]({
|
||||
ExtResource("3_y3hrs"): 4,
|
||||
ExtResource("4_hdamc"): 0,
|
||||
ExtResource("5_wjlcp"): 3
|
||||
ExtResource("5_wjlcp"): 3,
|
||||
ExtResource("6_hdamc"): 4
|
||||
})
|
||||
metadata/_custom_type_script = "uid://bwam50qxikpw4"
|
||||
|
||||
11
resources/traits/alone.tres
Normal file
11
resources/traits/alone.tres
Normal file
@@ -0,0 +1,11 @@
|
||||
[gd_resource type="Resource" script_class="Trait" format=3 uid="uid://c4kpcm4tplsgg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cya40uohlvgbr" path="res://scenes/character/trait.gd" id="1_w8hps"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_w8hps")
|
||||
name = "alone"
|
||||
stimulis = Array[int]([0, 1, 2])
|
||||
category = 5
|
||||
tag = 14
|
||||
metadata/_custom_type_script = "uid://cya40uohlvgbr"
|
||||
@@ -27,17 +27,6 @@ func _ready() -> void:
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
_engine_process(delta)
|
||||
else:
|
||||
_game_process(delta)
|
||||
|
||||
|
||||
func _game_process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _engine_process(delta: float) -> void:
|
||||
if chara_resource == null:
|
||||
return
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://bvpyqyftqhy45"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dnt4l1eghm1gi" path="res://scenes/character/character.gd" id="1_cuyo6"]
|
||||
[ext_resource type="Resource" uid="uid://gy4ygqrjj5ys" path="res://resources/characters/duke.tres" id="2_fgi2k"]
|
||||
[ext_resource type="Texture2D" uid="uid://spbjfmmk8o0s" path="res://assets/characters/Perso 3.png" id="3_f8hpl"]
|
||||
[ext_resource type="Resource" uid="uid://c87odmn680x7" path="res://resources/characters/duchex.tres" id="2_fgi2k"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwy3kklywl0ci" path="res://assets/characters/Perso 1.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"]
|
||||
@@ -164,11 +164,12 @@ chara_resource = ExtResource("2_fgi2k")
|
||||
texture = ExtResource("3_f8hpl")
|
||||
|
||||
[node name="MaskMouth" parent="." unique_id=1087336064 instance=ExtResource("3_mutn8")]
|
||||
position = Vector2(-1.83, 2.27)
|
||||
position = Vector2(76.505, 203.355)
|
||||
rotation = -0.05235988
|
||||
|
||||
[node name="MaskEyes" parent="." unique_id=428968220 instance=ExtResource("3_mutn8")]
|
||||
position = Vector2(-23.295, -0.335)
|
||||
rotation = -0.034906585
|
||||
position = Vector2(61.445, 168.635)
|
||||
rotation = -0.06981317
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=713965213]
|
||||
libraries/ = SubResource("AnimationLibrary_7ex5l")
|
||||
|
||||
@@ -330,10 +330,22 @@ tracks/0/keys = {
|
||||
"update": 0,
|
||||
"values": [Vector2(131, 317.00003)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_62f45"]
|
||||
resource_name = "idle"
|
||||
length = 0.3
|
||||
length = 4.0
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
@@ -342,10 +354,22 @@ tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.16666667),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(131, 317.00003), Vector2(131, 478)]
|
||||
"values": [Vector2(131, 317.00003), Vector2(131, 478), Vector2(131, 317.00003)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [true, false]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_6g32y"]
|
||||
@@ -388,6 +412,7 @@ lvl2_guest_1 = ExtResource("27_62f45")
|
||||
lvl2_guest_2 = ExtResource("30_6g32y")
|
||||
lvl3_guest_1 = ExtResource("33_f4j1x")
|
||||
lvl3_guest_2 = ExtResource("29_62f45")
|
||||
lvl3_guest_3 = ExtResource("27_6w6mm")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="." unique_id=1166192115]
|
||||
limit_left = -960
|
||||
@@ -429,7 +454,6 @@ scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("35_62f45")
|
||||
|
||||
[node name="MaskList" parent="." unique_id=437192154 instance=ExtResource("25_6llfj")]
|
||||
visible = false
|
||||
position = Vector2(409, 523)
|
||||
rotation = 0.1675516
|
||||
scale = Vector2(0.99999994, 0.99999994)
|
||||
@@ -461,6 +485,7 @@ scale = Vector2(0.3, 0.3)
|
||||
texture = ExtResource("37_6g32y")
|
||||
|
||||
[node name="RingBell" type="Sprite2D" parent="." unique_id=1001478580]
|
||||
visible = false
|
||||
position = Vector2(131, 317.00003)
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture = ExtResource("39_62f45")
|
||||
|
||||
@@ -26,6 +26,7 @@ class_name GameManager
|
||||
@export_group("Level 3")
|
||||
@export var lvl3_guest_1: MaskedChara
|
||||
@export var lvl3_guest_2: MaskedChara
|
||||
@export var lvl3_guest_3: MaskedChara
|
||||
|
||||
@export_category("Random levels")
|
||||
@export var current_level: Levels = Levels.LVL1
|
||||
@@ -52,12 +53,11 @@ var roster_size: int = 2
|
||||
|
||||
@onready var camera_2d: Camera2D = $"../Camera2D"
|
||||
@onready var ring_bell: Sprite2D = $"../RingBell"
|
||||
@onready var bell_anim_player: AnimationPlayer = $"../RingBell/AnimationPlayer"
|
||||
|
||||
|
||||
func create_new_roster() -> void:
|
||||
print("Create new roster")
|
||||
current_chara_roster = []
|
||||
print(character_roster.size())
|
||||
var roster_for_this_round = character_roster.duplicate()
|
||||
var max_number_of_people = min(roster_size, character_roster.size())
|
||||
for i in range(max_number_of_people):
|
||||
@@ -72,8 +72,6 @@ func create_new_roster() -> void:
|
||||
var masked_chara = MaskedChara.new(chara, face_mask, mouth_mask)
|
||||
|
||||
current_chara_roster.append(masked_chara)
|
||||
print("Added %s to roster" % chara.name)
|
||||
print(character_roster.size())
|
||||
|
||||
func review_next_guest():
|
||||
# See previous guest out
|
||||
@@ -90,7 +88,6 @@ func review_next_guest():
|
||||
return
|
||||
|
||||
# Process next guest
|
||||
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
|
||||
@@ -115,7 +112,7 @@ func ending_tween_cb():
|
||||
# Progress levels
|
||||
current_game_state = GameState.READY
|
||||
ring_bell.visible = true
|
||||
mask_list.visible = false
|
||||
bell_anim_player.play("idle")
|
||||
if current_level == Levels.LVL1:
|
||||
current_level = Levels.LVL2
|
||||
elif current_level == Levels.LVL2:
|
||||
@@ -144,18 +141,21 @@ func on_ready_bell_pressed() -> void:
|
||||
if(current_game_state != GameState.READY):
|
||||
return
|
||||
|
||||
for table in tables:
|
||||
table.initialize()
|
||||
|
||||
if current_level == Levels.LVL1:
|
||||
current_chara_roster = [lvl1_guest_1, lvl1_guest_2]
|
||||
elif current_level == Levels.LVL2:
|
||||
current_chara_roster = [lvl2_guest_1, lvl2_guest_2]
|
||||
elif current_level == Levels.LVL3:
|
||||
current_chara_roster = [lvl3_guest_1, lvl3_guest_2]
|
||||
current_chara_roster = [lvl3_guest_1, lvl3_guest_2, lvl3_guest_3]
|
||||
else:
|
||||
create_new_roster()
|
||||
|
||||
current_game_state = GameState.GUEST_REVIEW
|
||||
bell_anim_player.stop()
|
||||
ring_bell.visible = false
|
||||
mask_list.visible = true
|
||||
first_guest = true
|
||||
review_next_guest()
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ class_name MaskedChara
|
||||
@export var face_mask: MaskResource
|
||||
@export var mouth_mask: MaskResource
|
||||
|
||||
const ALONE_TRAIT = preload("uid://c4kpcm4tplsgg")
|
||||
|
||||
var pref_score_map: Dictionary[CharacterResource.Preference, float] = {
|
||||
CharacterResource.Preference.LOVE: 2.0,
|
||||
CharacterResource.Preference.APPROVE: 1.0,
|
||||
@@ -26,10 +28,12 @@ func compute_score(other_guests: Array[MaskedChara]) -> float:
|
||||
var overall_score = 0.0
|
||||
var preferences = character.preferences
|
||||
|
||||
var is_alone = true
|
||||
for guest in other_guests:
|
||||
if guest == null:
|
||||
continue
|
||||
|
||||
|
||||
is_alone = false
|
||||
var guest_mouth_mask = guest.mouth_mask
|
||||
var guest_traits = guest.character.traits
|
||||
|
||||
@@ -47,10 +51,18 @@ func compute_score(other_guests: Array[MaskedChara]) -> float:
|
||||
var preference = character.preferences.get(guest_trait) if guest_trait in character.preferences else CharacterResource.Preference.DONT_CARE
|
||||
var score_multiplier = pref_score_map.get(preference) if preference in pref_score_map else 0.0
|
||||
guest_appreciation += trait_strength*score_multiplier
|
||||
|
||||
print("%s guest appreciation %s" % [character.name, guest_appreciation])
|
||||
|
||||
overall_score += guest_appreciation
|
||||
|
||||
print("%s score: %s" % [character.name, overall_score])
|
||||
if is_alone:
|
||||
var alone_pref = character.preferences.get(ALONE_TRAIT) if ALONE_TRAIT in character.preferences else CharacterResource.Preference.DONT_CARE
|
||||
var alone_score = pref_score_map.get(alone_pref) if alone_pref in pref_score_map else 0.0
|
||||
var alone_strength = 0.0
|
||||
for stimuli in ALONE_TRAIT.stimulis:
|
||||
var strength = stimuli
|
||||
if face_mask != null and stimuli == face_mask.stimuli:
|
||||
strength *= face_mask.stimuli_multiplier
|
||||
alone_strength += strength
|
||||
overall_score = alone_score*alone_strength
|
||||
|
||||
return overall_score
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://3jlukpb5hefb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cfo3mk5f2q3ej" path="res://scenes/mask/mask.gd" id="1_61b51"]
|
||||
[ext_resource type="Resource" uid="uid://divy6byhpwgs2" path="res://resources/masks/truthy.tres" id="2_0pm64"]
|
||||
[ext_resource type="Texture2D" uid="uid://02al0mfbvjc1" path="res://assets/masks/Bouche 2.png" id="3_htpgb"]
|
||||
[ext_resource type="Resource" uid="uid://pdiaprcknftw" path="res://resources/masks/mute.tres" id="2_0pm64"]
|
||||
[ext_resource type="Texture2D" uid="uid://bfnvs01ynm55q" path="res://assets/masks/Bouche 3.png" id="3_htpgb"]
|
||||
|
||||
[node name="Mask" type="Node2D" unique_id=428968220]
|
||||
script = ExtResource("1_61b51")
|
||||
|
||||
@@ -28,6 +28,8 @@ func _ready() -> void:
|
||||
|
||||
func _on_chara_resource_changed() -> void:
|
||||
if guest == null:
|
||||
empty.visible = true
|
||||
character.visible = false
|
||||
return
|
||||
|
||||
if character != null:
|
||||
@@ -40,6 +42,9 @@ func _on_chara_resource_changed() -> void:
|
||||
|
||||
func set_guest(p_guest: MaskedChara) -> void:
|
||||
if p_guest == null:
|
||||
guest = null
|
||||
empty.visible = true
|
||||
character.visible = false
|
||||
return
|
||||
|
||||
guest = p_guest
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[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://c25kg6um2k1dy" path="res://resources/guests/duchex_mute.tres" id="2_i14o5"]
|
||||
[ext_resource type="PackedScene" uid="uid://bvpyqyftqhy45" path="res://scenes/character/character.tscn" id="3_dxmy0"]
|
||||
[ext_resource type="Resource" uid="uid://c87odmn680x7" path="res://resources/characters/duchex.tres" id="4_ipxud"]
|
||||
[ext_resource type="Texture2D" uid="uid://cftllq6l7xclt" path="res://icon.svg" id="4_wnjs1"]
|
||||
@@ -11,13 +10,11 @@ size = Vector2(128, 128)
|
||||
|
||||
[node name="Seat" type="Area2D" unique_id=1604639021]
|
||||
script = ExtResource("1_pceab")
|
||||
guest = ExtResource("2_i14o5")
|
||||
|
||||
[node name="Character" parent="." unique_id=138741531 instance=ExtResource("3_dxmy0")]
|
||||
chara_resource = ExtResource("4_ipxud")
|
||||
|
||||
[node name="Empty" type="Sprite2D" parent="." unique_id=357649392]
|
||||
visible = false
|
||||
texture = ExtResource("4_wnjs1")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1054126207]
|
||||
|
||||
@@ -7,23 +7,42 @@ signal seat_clicked(Seat)
|
||||
@onready var seat_2: Seat = $Seat2
|
||||
@onready var seat_3: Seat = $Seat3
|
||||
|
||||
@onready var table: Sprite2D = $Table
|
||||
@onready var table_defeat: Sprite2D = $TableDefeat
|
||||
@onready var table_victory: Sprite2D = $TableVictory
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
initialize()
|
||||
|
||||
|
||||
func on_seat_clicked(seat: Seat) -> void:
|
||||
seat_clicked.emit(seat)
|
||||
|
||||
|
||||
func initialize() -> void:
|
||||
table.visible = true
|
||||
table_defeat.visible = false
|
||||
table_victory.visible = false
|
||||
|
||||
seat_1.set_guest(null)
|
||||
seat_2.set_guest(null)
|
||||
seat_3.set_guest(null)
|
||||
|
||||
|
||||
func compute_score() -> float:
|
||||
if seat_1.guest == null and seat_2.guest == null and seat_2.guest == null:
|
||||
return 0.0
|
||||
|
||||
var score_guest1 = seat_1.guest.compute_score([seat_2.guest, seat_3.guest]) if seat_1.guest != null else 0.0
|
||||
var score_guest2 = seat_2.guest.compute_score([seat_1.guest, seat_3.guest]) if seat_2.guest != null else 0.0
|
||||
var score_guest3 = seat_3.guest.compute_score([seat_1.guest, seat_2.guest]) if seat_3.guest != null else 0.0
|
||||
|
||||
var table_score = score_guest1 + score_guest2 + score_guest3
|
||||
|
||||
print("%s score: %s" % [name, table_score])
|
||||
table.visible = false
|
||||
table_defeat.visible = table_score < 0
|
||||
table_victory.visible = table_score >= 0
|
||||
|
||||
return table_score
|
||||
|
||||
|
||||
@@ -11,15 +11,12 @@ script = ExtResource("1_ov72x")
|
||||
|
||||
[node name="Seat1" parent="." unique_id=1604639021 instance=ExtResource("1_qavd0")]
|
||||
position = Vector2(-204, -87)
|
||||
guest = null
|
||||
|
||||
[node name="Seat2" parent="." unique_id=848918585 instance=ExtResource("1_qavd0")]
|
||||
position = Vector2(-14, -117)
|
||||
guest = null
|
||||
|
||||
[node name="Seat3" parent="." unique_id=150555678 instance=ExtResource("1_qavd0")]
|
||||
position = Vector2(173, -98)
|
||||
guest = null
|
||||
|
||||
[node name="Table" type="Sprite2D" parent="." unique_id=466061690]
|
||||
position = Vector2(0, 100)
|
||||
|
||||
Reference in New Issue
Block a user