From 21f2af5395f4458d3e1fffd23bb707504dae4219 Mon Sep 17 00:00:00 2001 From: Multiplyster Date: Wed, 3 Dec 2025 20:06:34 -0500 Subject: [PATCH] Scaled chips and board --- assets/sprites/BoardTileMap.png | Bin 0 -> 430 bytes assets/sprites/BoardTileMap.png.import | 40 +++++++++++++++++++++++++ scenes/board_screen.tscn | 19 ++++++++---- scenes/red_chip.tscn | 4 ++- scenes/yellow_chip.tscn | 4 ++- scripts/BoardScreen.cs | 8 +++-- 6 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 assets/sprites/BoardTileMap.png create mode 100644 assets/sprites/BoardTileMap.png.import diff --git a/assets/sprites/BoardTileMap.png b/assets/sprites/BoardTileMap.png new file mode 100644 index 0000000000000000000000000000000000000000..43b9b77629919729c9b7a79c1aefa21c446a715c GIT binary patch literal 430 zcmV;f0a5;mP)f^DL8VEzxhWu>T{x);L_lhyV!sGT3{-6w0jY_K{URVSP_1j*?RCm_=LVAkOgE` z1{dJS-haAMgZOT}+=sp=@HQZ90gbo^eo53&i?|Qz2)qCQ0RR8cgz%yO000I_L_t&o Y05YDVQG$y=_5c6?07*qoM6N<$f{U!Zi~s-t literal 0 HcmV?d00001 diff --git a/assets/sprites/BoardTileMap.png.import b/assets/sprites/BoardTileMap.png.import new file mode 100644 index 0000000..4354b0a --- /dev/null +++ b/assets/sprites/BoardTileMap.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://8un28mol7qow" +path="res://.godot/imported/BoardTileMap.png-b52c6a70f2625846356fb1557a154ce5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/BoardTileMap.png" +dest_files=["res://.godot/imported/BoardTileMap.png-b52c6a70f2625846356fb1557a154ce5.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 diff --git a/scenes/board_screen.tscn b/scenes/board_screen.tscn index aac707f..caf0f92 100644 --- a/scenes/board_screen.tscn +++ b/scenes/board_screen.tscn @@ -9,7 +9,7 @@ [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_b3w8x"] -[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_glh1q"] +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_i2o8i"] texture = ExtResource("6_i2o8i") texture_region_size = Vector2i(26, 26) 0:0/0 = 0 @@ -17,13 +17,15 @@ texture_region_size = Vector2i(26, 26) 2:0/0 = 0 3:0/0 = 0 -[sub_resource type="TileSet" id="TileSet_u1oi2"] -sources/0 = SubResource("TileSetAtlasSource_glh1q") +[sub_resource type="TileSet" id="TileSet_glh1q"] +tile_size = Vector2i(26, 26) +sources/0 = SubResource("TileSetAtlasSource_i2o8i") [node name="BoardScreen" type="Node2D"] script = ExtResource("1_b3w8x") [node name="StaticBody2D" type="StaticBody2D" parent="."] +position = Vector2(0, 200) [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] shape = SubResource("WorldBoundaryShape2D_b3w8x") @@ -102,7 +104,7 @@ position = Vector2(-7, 6) scale = Vector2(0.25, 0.25) texture = ExtResource("5_i2o8i") -[node name="Label" type="Label" parent="Player2Card"] +[node name="Name" type="Label" parent="Player2Card"] offset_left = -531.0 offset_top = -240.0 offset_right = -429.0 @@ -121,5 +123,12 @@ theme_override_font_sizes/font_size = 8 text = "NOT READY" [node name="TileMap" type="TileMap" parent="."] -tile_set = SubResource("TileSet_u1oi2") +position = Vector2(39, 200) +scale = Vector2(3, 3) +tile_set = SubResource("TileSet_glh1q") format = 2 +layer_0/z_index = 100 +layer_0/tile_data = PackedInt32Array(-3, 0, 0, -2, 0, 0, -1, 0, 0, -65536, 0, 0, -65535, 0, 0, -65534, 0, 0, -4, 0, 0, -65540, 0, 0, -131076, 0, 0, -196612, 0, 0, -262148, 0, 0, -327684, 0, 0, -327683, 0, 0, -327682, 0, 0, -327681, 0, 0, -393216, 0, 0, -393215, 0, 0, -393214, 0, 0, -327678, 0, 0, -262142, 0, 0, -196606, 0, 0, -131070, 0, 0, -131071, 0, 0, -131072, 0, 0, -65537, 0, 0, -65538, 0, 0, -65539, 0, 0, -131075, 0, 0, -131074, 0, 0, -131073, 0, 0, -196608, 0, 0, -196607, 0, 0, -262143, 0, 0, -262144, 0, 0, -196609, 0, 0, -196610, 0, 0, -196611, 0, 0, -262147, 0, 0, -262146, 0, 0, -262145, 0, 0, -327680, 0, 0, -327679, 0, 0, -5, 196608, 536870912, -65541, 65536, 0, -131077, 65536, 0, -196613, 65536, 0, -262149, 65536, 0, -327685, 196608, 0, 65532, 196608, 1610612736, 2, 196608, 1879048192, -65533, 196608, 805306368, -393213, 196608, 268435456, -458750, 196608, 1342177280, -393219, 65536, 1073741824, -393218, 65536, 1073741824, -393217, 65536, 1073741824, -458752, 65536, 1073741824, -458751, 65536, 1073741824, -393220, 196608, 1073741824, -327677, 65536, 268435456, -262141, 65536, 268435456, -196605, 65536, 268435456, -131069, 65536, 268435456, 65533, 65536, 1879048192, 65534, 65536, 1879048192, 65535, 65536, 1879048192, 0, 65536, 1879048192, 1, 65536, 1879048192) + +[node name="Node2D" type="Node2D" parent="."] +position = Vector2(-536, -299) diff --git a/scenes/red_chip.tscn b/scenes/red_chip.tscn index 49ce980..fbf20c5 100644 --- a/scenes/red_chip.tscn +++ b/scenes/red_chip.tscn @@ -4,13 +4,15 @@ [ext_resource type="Script" uid="uid://dd5nu6037qsr0" path="res://scripts/red_chip.gd" id="1_tfypd"] [sub_resource type="CircleShape2D" id="CircleShape2D_tfypd"] -radius = 14.0 +radius = 13.017083 [node name="RedChip" type="RigidBody2D"] script = ExtResource("1_tfypd") [node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(3, 3) texture = ExtResource("1_qsflu") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] +scale = Vector2(3, 3) shape = SubResource("CircleShape2D_tfypd") diff --git a/scenes/yellow_chip.tscn b/scenes/yellow_chip.tscn index 2728681..42d36b4 100644 --- a/scenes/yellow_chip.tscn +++ b/scenes/yellow_chip.tscn @@ -4,13 +4,15 @@ [ext_resource type="Texture2D" uid="uid://qy30emdgrk7o" path="res://assets/sprites/YellowChip.png" id="1_eu0sq"] [sub_resource type="CircleShape2D" id="CircleShape2D_epi6l"] -radius = 14.0 +radius = 13.004272 [node name="YellowChip" type="RigidBody2D"] script = ExtResource("1_epi6l") [node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(3, 3) texture = ExtResource("1_eu0sq") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] +scale = Vector2(3, 3) shape = SubResource("CircleShape2D_epi6l") diff --git a/scripts/BoardScreen.cs b/scripts/BoardScreen.cs index 4a81eb4..104931c 100644 --- a/scripts/BoardScreen.cs +++ b/scripts/BoardScreen.cs @@ -4,10 +4,12 @@ using System; public partial class BoardScreen : Node2D { private const string RED_CHIP_PATH = "res://scenes/red_chip.tscn"; private const string YELLOW_CHIP_PATH = "res://scenes/yellow_chip.tscn"; + private const int CHIP_SCALE = 3; private const int CHIP_SIZE = 24; private const int CHIP_PADDING = 2; - private const int X_OFF = -(CHIP_SIZE + CHIP_PADDING) * 7 / 2; + private const int CHIP_X_OFF = -(CHIP_SIZE + CHIP_PADDING) * 7 / 2 + (CHIP_SIZE + CHIP_PADDING) / 2; private const int Y_OFF = 300; + private const int CARD_CENTER_X_DEFAULT = -536; private PackedScene redChip; private PackedScene ylwChip; @@ -84,8 +86,8 @@ public partial class BoardScreen : Node2D { } RigidBody2D newNode = redChip.Instantiate(); - newNode.Position = new Vector2(X_OFF + (CHIP_SIZE + CHIP_PADDING) * col, -(CHIP_SIZE + CHIP_PADDING) * 7); AddChild(newNode); + newNode.Position = new Vector2(CHIP_SCALE * (CHIP_X_OFF + (CHIP_SIZE + CHIP_PADDING) * col), -(CHIP_SIZE + CHIP_PADDING) * 7); chips[row, col] = newNode; } @@ -98,8 +100,8 @@ public partial class BoardScreen : Node2D { } RigidBody2D newNode = ylwChip.Instantiate(); - newNode.Position = new Vector2(X_OFF + (CHIP_SIZE + CHIP_PADDING) * col, -(CHIP_SIZE + CHIP_PADDING) * 7); AddChild(newNode); + newNode.Position = new Vector2(CHIP_SCALE * (CHIP_X_OFF + (CHIP_SIZE + CHIP_PADDING) * col), -(CHIP_SIZE + CHIP_PADDING) * 7); chips[row, col] = newNode; }