diff --git a/project/Nathan's Dress Up.csproj b/project/Nathan's Dress Up.csproj index d46e241..bce4e24 100644 --- a/project/Nathan's Dress Up.csproj +++ b/project/Nathan's Dress Up.csproj @@ -1,4 +1,4 @@ - + Debug @@ -50,7 +50,6 @@ - diff --git a/project/scn/Character.tscn b/project/scn/Character.tscn index 0d82960..c62df3d 100644 --- a/project/scn/Character.tscn +++ b/project/scn/Character.tscn @@ -57,6 +57,7 @@ animations = [ { [node name="Tail" type="AnimatedSprite" parent="Base"] position = Vector2( 54.4027, 184.439 ) frames = SubResource( 1 ) +frame = 5 playing = true [node name="Nathan" type="Sprite" parent="Base"] @@ -66,13 +67,13 @@ texture = ExtResource( 4 ) [node name="Eyes" type="AnimatedSprite" parent="Base"] position = Vector2( 114.227, 63.9224 ) frames = SubResource( 2 ) -frame = 6 +frame = 1 playing = true [node name="Mouth" type="AnimatedSprite" parent="Base"] position = Vector2( 131.024, 67.4964 ) frames = SubResource( 3 ) -frame = 4 +frame = 23 playing = true [node name="Undies" type="Sprite" parent="."] diff --git a/project/src/GameScn.cs b/project/src/GameScn.cs index eab825b..9cf36fe 100644 --- a/project/src/GameScn.cs +++ b/project/src/GameScn.cs @@ -2,8 +2,9 @@ using Godot; public enum ClothingType { - Top, - Bottom, + Shirts, + Pants, + Undies, Accessory } @@ -11,18 +12,22 @@ public class GameScn : Node { void ChangeClothes(string path, ClothingType clothingType) { - var texture = ResourceLoader.Load(path); + var texture = ResourceLoader.Load($"res://{path}"); switch (clothingType) { - case ClothingType.Top: - var top = GetNode("Nathan/Accessory"); + case ClothingType.Shirts: + var top = GetNode("Nathan/Top"); top.Texture = texture; break; - case ClothingType.Bottom: - var bottom = GetNode("Nathan/Accessory"); + case ClothingType.Pants: + var bottom = GetNode("Nathan/Bottom"); bottom.Texture = texture; break; + case ClothingType.Undies: + var undies = GetNode("Nathan/Undies"); + undies.Texture = texture; + break; case ClothingType.Accessory: var accessory = GetNode("Nathan/Accessory"); accessory.Texture = texture; @@ -30,11 +35,26 @@ public class GameScn : Node } } + TextureButton ClothingButton(string path, ClothingType clothingType) + { + switch (clothingType) + { + case ClothingType.Accessory: + return GetNode($"Clothes/Wordrobe/AccsGrid/{path}"); + case ClothingType.Undies: + return GetNode($"Clothes/Wordrobe/UndiesGrid/{path}"); + default: + case ClothingType.Pants: + return GetNode($"Clothes/Wordrobe/PantsGrid/{path}"); + case ClothingType.Shirts: + return GetNode($"Clothes/Wordrobe/ShirtsGrid/{path}"); + } + } + public override void _Process(float delta) { // Change clothes - if (GetNode("Clothes/Wordrobe/Accessoires/AccsGrid/CanonCam").IsPressed()) - ChangeClothes("res://sprites/camera.png", ClothingType.Accessory); - + if (ClothingButton("CanonCam", ClothingType.Accessory).IsPressed()) + ChangeClothes("sprites/camera.png", ClothingType.Accessory); } }