1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-05-07 14:04:48 -04:00

Initial start on rewriting game scene script

This commit is contained in:
Anthony Wilcox 2019-06-10 21:10:28 -04:00
parent 57e148d3e2
commit f7e6cfa3c3
7 changed files with 75 additions and 16 deletions

View file

@ -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
![](screenshot.gif)

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -50,6 +50,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="src\ClothingType.cs" />
<Compile Include="src\GameScn.cs" />
<Compile Include="src\Soundtrack.cs" />
<Compile Include="src\TitleScn.cs" />
</ItemGroup>

View file

@ -1,6 +1,8 @@
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
@ -13,7 +15,13 @@ Global
{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

View file

@ -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="."]

View file

@ -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]

40
project/src/GameScn.cs Normal file
View file

@ -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<Texture>(path);
switch (clothingType)
{
case ClothingType.Top:
var top = GetNode<Sprite>("Nathan/Accessory");
top.Texture = texture;
break;
case ClothingType.Bottom:
var bottom = GetNode<Sprite>("Nathan/Accessory");
bottom.Texture = texture;
break;
case ClothingType.Accessory:
var accessory = GetNode<Sprite>("Nathan/Accessory");
accessory.Texture = texture;
break;
}
}
public override void _Process(float delta)
{
// Change clothes
if (GetNode<TextureButton>("Clothes/Wordrobe/Accessoires/AccsGrid/CanonCam").IsPressed())
ChangeClothes("res://sprites/camera.png", ClothingType.Accessory);
}
}

View file

@ -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<Control> ("WinDialogs/LicenseWin");
licenseWin.Show ();
}