From f7e6cfa3c3feced81907c0f94adec560f0d7028e Mon Sep 17 00:00:00 2001
From: Anthony Wilcox <35226681+antonwilc0x@users.noreply.github.com>
Date: Mon, 10 Jun 2019 21:10:28 -0400
Subject: [PATCH] Initial start on rewriting game scene script
---
README.md | 10 ++++++++
project/Nathan's Dress Up.csproj | 6 +++--
project/Nathan's Dress Up.sln | 22 ++++++++++++------
project/scn/Character.tscn | 5 ++--
project/scn/GameScn.tscn | 2 +-
project/src/GameScn.cs | 40 ++++++++++++++++++++++++++++++++
project/src/TitleScn.cs | 6 ++---
7 files changed, 75 insertions(+), 16 deletions(-)
create mode 100644 project/src/GameScn.cs
diff --git a/README.md b/README.md
index 4945c89..aa8266b 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,16 @@
Nathan's Dress Up is a open source dress up game. It's a remake of my original Flash game, ZC's Dress Up.
+## Prerequisites
+
+- [Godot](https://godotengine.org/download/windows) 3.1.1 or later, Mono version
+- .NET Build Tools
+ - [Mono SDK](https://www.mono-project.com/download/stable/)
+ - [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/?q=build+tools)
+- Visual Studio or MonoDevelop
+
+_Built and tested on Godot 3.1.1 from Windows 10 1903 with Visual Studio Build Tools 2017_
+
## Screenshot

\ No newline at end of file
diff --git a/project/Nathan's Dress Up.csproj b/project/Nathan's Dress Up.csproj
index 492f025..d46e241 100644
--- a/project/Nathan's Dress Up.csproj
+++ b/project/Nathan's Dress Up.csproj
@@ -1,4 +1,4 @@
-
+
Debug
@@ -50,6 +50,8 @@
+
+
@@ -57,4 +59,4 @@
-
+
\ No newline at end of file
diff --git a/project/Nathan's Dress Up.sln b/project/Nathan's Dress Up.sln
index 012da04..8b55c24 100644
--- a/project/Nathan's Dress Up.sln
+++ b/project/Nathan's Dress Up.sln
@@ -1,19 +1,27 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nathan's Dress Up", "Nathan's Dress Up.csproj", "{A84252BE-A1C7-410D-A602-3EFBEFD17D7D}"
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29001.49
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nathan's Dress Up", "Nathan's Dress Up.csproj", "{A84252BE-A1C7-410D-A602-3EFBEFD17D7D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- Tools|Any CPU = Tools|Any CPU
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ Tools|Any CPU = Tools|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Release|Any CPU.Build.0 = Release|Any CPU
- {A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Tools|Any CPU.ActiveCfg = Tools|Any CPU
- {A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Tools|Any CPU.Build.0 = Tools|Any CPU
+ {A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Tools|Any CPU.ActiveCfg = Release|Any CPU
+ {A84252BE-A1C7-410D-A602-3EFBEFD17D7D}.Tools|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {BAC5EB58-11A4-4789-8A8E-FDBB9973675A}
EndGlobalSection
EndGlobal
diff --git a/project/scn/Character.tscn b/project/scn/Character.tscn
index c4fc0f3..0d82960 100644
--- a/project/scn/Character.tscn
+++ b/project/scn/Character.tscn
@@ -57,7 +57,6 @@ animations = [ {
[node name="Tail" type="AnimatedSprite" parent="Base"]
position = Vector2( 54.4027, 184.439 )
frames = SubResource( 1 )
-frame = 8
playing = true
[node name="Nathan" type="Sprite" parent="Base"]
@@ -67,13 +66,13 @@ texture = ExtResource( 4 )
[node name="Eyes" type="AnimatedSprite" parent="Base"]
position = Vector2( 114.227, 63.9224 )
frames = SubResource( 2 )
-frame = 4
+frame = 6
playing = true
[node name="Mouth" type="AnimatedSprite" parent="Base"]
position = Vector2( 131.024, 67.4964 )
frames = SubResource( 3 )
-frame = 2
+frame = 4
playing = true
[node name="Undies" type="Sprite" parent="."]
diff --git a/project/scn/GameScn.tscn b/project/scn/GameScn.tscn
index baf89b2..1f7a6fe 100644
--- a/project/scn/GameScn.tscn
+++ b/project/scn/GameScn.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=8 format=2]
-[ext_resource path="res://src/GameScn.gd" type="Script" id=1]
+[ext_resource path="res://src/GameScn.cs" type="Script" id=1]
[ext_resource path="res://sprites/icrazy_frame.svg" type="Texture" id=2]
[ext_resource path="res://sprites/lights.png" type="Texture" id=3]
[ext_resource path="res://scn/Clothes.tscn" type="PackedScene" id=4]
diff --git a/project/src/GameScn.cs b/project/src/GameScn.cs
new file mode 100644
index 0000000..eab825b
--- /dev/null
+++ b/project/src/GameScn.cs
@@ -0,0 +1,40 @@
+using Godot;
+
+public enum ClothingType
+{
+ Top,
+ Bottom,
+ Accessory
+}
+
+public class GameScn : Node
+{
+ void ChangeClothes(string path, ClothingType clothingType)
+ {
+ var texture = ResourceLoader.Load(path);
+
+ switch (clothingType)
+ {
+ case ClothingType.Top:
+ var top = GetNode("Nathan/Accessory");
+ top.Texture = texture;
+ break;
+ case ClothingType.Bottom:
+ var bottom = GetNode("Nathan/Accessory");
+ bottom.Texture = texture;
+ break;
+ case ClothingType.Accessory:
+ var accessory = GetNode("Nathan/Accessory");
+ accessory.Texture = texture;
+ break;
+ }
+ }
+
+ public override void _Process(float delta)
+ {
+ // Change clothes
+ if (GetNode("Clothes/Wordrobe/Accessoires/AccsGrid/CanonCam").IsPressed())
+ ChangeClothes("res://sprites/camera.png", ClothingType.Accessory);
+
+ }
+}
diff --git a/project/src/TitleScn.cs b/project/src/TitleScn.cs
index 72d4f50..eb21a2c 100644
--- a/project/src/TitleScn.cs
+++ b/project/src/TitleScn.cs
@@ -3,15 +3,15 @@ using Godot;
public class TitleScn : Node {
- void _on_PlayBtn_pressed () {
+ void _on_PlayBtn_pressed() {
GetTree ().ChangeScene ("res://scn/GameScn.tscn");
}
- void _on_CreditsBtn_pressed () {
+ void _on_CreditsBtn_pressed() {
GetTree ().ChangeScene ("res://scn/CreditsScn.tscn");
}
- void _on_LicenseBtn_pressed () {
+ void _on_LicenseBtn_pressed() {
var licenseWin = GetNode ("WinDialogs/LicenseWin");
licenseWin.Show ();
}