diff --git a/assets/table.glb b/assets/table.glb new file mode 100644 index 0000000..8ce17f6 Binary files /dev/null and b/assets/table.glb differ diff --git a/assets/table.glb.import b/assets/table.glb.import new file mode 100644 index 0000000..bb49bb1 --- /dev/null +++ b/assets/table.glb.import @@ -0,0 +1,37 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://dj1wye7o27vil" +path="res://.godot/imported/table.glb-b76c89928fa0b392c4b8b9edb34d536f.scn" + +[deps] + +source_file="res://assets/table.glb" +dest_files=["res://.godot/imported/table.glb-b76c89928fa0b392c4b8b9edb34d536f.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/assets/table_wood.jpg b/assets/table_wood.jpg new file mode 100644 index 0000000..8f2a0b6 Binary files /dev/null and b/assets/table_wood.jpg differ diff --git a/assets/table_wood.jpg.import b/assets/table_wood.jpg.import new file mode 100644 index 0000000..7793eb5 --- /dev/null +++ b/assets/table_wood.jpg.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dqbp4ak87m6aj" +path.s3tc="res://.godot/imported/table_wood.jpg-17623750d4fd908c8ada78f7e9dbf884.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "20455f34ed3e232ea90fab7f36b7388a" +} + +[deps] + +source_file="res://assets/table_wood.jpg" +dest_files=["res://.godot/imported/table_wood.jpg-17623750d4fd908c8ada78f7e9dbf884.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +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=0 diff --git a/cards/card_manager.gd b/cards/card_manager.gd index c06eb90..170f56d 100644 --- a/cards/card_manager.gd +++ b/cards/card_manager.gd @@ -1,7 +1,6 @@ extends Node @export var full_deck: Dictionary[int, Card] -@export var card_textures: Dictionary[int, Texture] @export var card_fallback_texture: Texture enum CardStyle { @@ -45,6 +44,8 @@ func _get_card_name(card_id: int) -> String: var color: String var suffix: String + print("looking up card with id " + str(card_id)) + if card_id < 13: color = "blue" elif card_id < 26: diff --git a/cards/playing_card.gd b/cards/playing_card.gd index e0372a6..49674ca 100644 --- a/cards/playing_card.gd +++ b/cards/playing_card.gd @@ -19,7 +19,7 @@ func move_to(new_x_position: float) -> void: _get_new_tween().tween_property(self, "position:x", new_x_position, move_duration) func select() -> void: - _get_new_tween().tween_property(self, "position:y", 0.36, move_duration) + _get_new_tween().tween_property(self, "position:y", 0.13, move_duration) func unselect() -> void: _get_new_tween().tween_property(self, "position:y", 0.0, move_duration) diff --git a/cards/playing_card.glb b/cards/playing_card.glb index 8aaf9e9..7be9c6e 100644 Binary files a/cards/playing_card.glb and b/cards/playing_card.glb differ diff --git a/cards/playing_card.tscn b/cards/playing_card.tscn index 9358ddd..f532ce3 100644 --- a/cards/playing_card.tscn +++ b/cards/playing_card.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" uid="uid://c2odugkbbppxn" path="res://cards/playing_card.gd" id="1_t6o5d"] [ext_resource type="PackedScene" uid="uid://dxiv47be5dsll" path="res://cards/playing_card.glb" id="2_enav7"] [ext_resource type="Texture2D" uid="uid://i0wpcxpk7g2c" path="res://cards/textures/front_test.webp" id="3_jeoeb"] -[ext_resource type="Texture2D" uid="uid://cih4y1hskimrs" path="res://cards/textures/back_test.webp" id="4_exvuq"] +[ext_resource type="Texture2D" uid="uid://rdmwhsujk7c0" path="res://cards/textures/back_temp.webp" id="4_t6o5d"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nwj5s"] resource_local_to_scene = true @@ -12,13 +12,12 @@ resource_local_to_scene = true albedo_color = Color(0, 0, 0, 1) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_auvip"] -albedo_texture = ExtResource("4_exvuq") +albedo_texture = ExtResource("4_t6o5d") [sub_resource type="BoxShape3D" id="BoxShape3D_t6o5d"] -size = Vector3(2.38, 3.7, 0.05) +size = Vector3(0.275146, 0.427734, 0.0175781) [node name="PlayingCard" type="Area3D" node_paths=PackedStringArray("card_mesh")] -transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) collision_layer = 8 collision_mask = 0 script = ExtResource("1_t6o5d") diff --git a/cards/textures/back_temp.webp b/cards/textures/back_temp.webp new file mode 100644 index 0000000..37f5255 Binary files /dev/null and b/cards/textures/back_temp.webp differ diff --git a/cards/textures/back_temp.webp.import b/cards/textures/back_temp.webp.import new file mode 100644 index 0000000..8a95464 --- /dev/null +++ b/cards/textures/back_temp.webp.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://rdmwhsujk7c0" +path.s3tc="res://.godot/imported/back_temp.webp-8df29acfa79ff82f0ef6131269144180.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://cards/textures/back_temp.webp" +dest_files=["res://.godot/imported/back_temp.webp-8df29acfa79ff82f0ef6131269144180.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +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=0 diff --git a/elements/player_hand.gd b/elements/player_hand.gd index 480f6b8..cd85535 100644 --- a/elements/player_hand.gd +++ b/elements/player_hand.gd @@ -1,13 +1,11 @@ class_name PlayerHand extends Node3D -@export var card_width: float = 2.35 - ## Distance cards will be apart when there is a small amount of them -@export var card_distance_max: float = 0.8 +var card_distance_max: float = 0.18 ## Distance cards will be apart when there is a large amount of them -@export var card_distance_min: float = 0.32 +var card_distance_min: float = 0.09 ## How many test cards to add @export_range(0, 20) var test_card_count: int = 0 @@ -19,13 +17,13 @@ var _selected_card: PlayingCard = null signal card_selected(card_id: int) signal card_played(card_id: int) -#func _ready() -> void: - #_arrange_cards() - #var test_array: Array[int] - #for i in range(20): - #test_array.append(randi_range(0, 59)) - # - #add_cards(test_array) +func _ready() -> void: + _arrange_cards() + var test_array: Array[int] + for i in range(20): + test_array.append(randi_range(0, 59)) + + add_cards(test_array, "") func add_card(card: PlayingCard) -> void: self.add_child(card) diff --git a/game.tscn b/game.tscn index d4a2c12..e3c9541 100644 --- a/game.tscn +++ b/game.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=8 format=3 uid="uid://gqrdpjslr4np"] +[gd_scene load_steps=9 format=3 uid="uid://gqrdpjslr4np"] [ext_resource type="Script" uid="uid://p5gvnyhjqe6o" path="res://components/web_client_tcp.gd" id="1_feb5d"] [ext_resource type="Script" uid="uid://c0cqkatyo4uj1" path="res://components/client_interface.gd" id="2_e2o6t"] [ext_resource type="Script" uid="uid://utt8atbh7b2a" path="res://game_client.gd" id="3_feb5d"] [ext_resource type="Script" uid="uid://bipfa366flrfa" path="res://environment_manager.gd" id="4_7jktm"] [ext_resource type="PackedScene" uid="uid://jlovgr2iojrg" path="res://elements/player_hand.tscn" id="4_fc0e3"] +[ext_resource type="PackedScene" uid="uid://dj1wye7o27vil" path="res://assets/table.glb" id="7_eow3j"] [sub_resource type="SystemFont" id="SystemFont_80nbo"] font_names = PackedStringArray("IBM Plex Mono") @@ -201,7 +202,8 @@ own_player_hand = NodePath("PlayerHand") player_hand_scene = ExtResource("4_fc0e3") [node name="Camera3D" type="Camera3D" parent="EnvironmentManager"] -transform = Transform3D(1, 0, 0, 0, 0.997882, 0.0650548, 0, -0.0650548, 0.997882, 0, 0.171315, 1.65638) +transform = Transform3D(1, 0, 0, 0, 0.93358, 0.358368, 0, -0.358368, 0.93358, 0, 1.298, 3.663) +fov = 69.0 [node name="DirectionalLight3D" type="DirectionalLight3D" parent="EnvironmentManager"] transform = Transform3D(0.970511, 0, 0.241058, -0.137972, 0.820002, 0.555482, -0.197668, -0.572361, 0.795821, 2.41581, 2.80426, 0) @@ -210,7 +212,9 @@ transform = Transform3D(0.970511, 0, 0.241058, -0.137972, 0.820002, 0.555482, -0 environment = SubResource("Environment_fc0e3") [node name="PlayerHand" parent="EnvironmentManager" instance=ExtResource("4_fc0e3")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.91793) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 2.6) + +[node name="Table" parent="EnvironmentManager" instance=ExtResource("7_eow3j")] [connection signal="client_joined_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_client_joined_lobby"] [connection signal="client_joined_lobby" from="WebClientTCP" to="HBoxContainer/GameUI" method="_on_web_client_tcp_client_joined_lobby"]