mirror of
https://github.com/tonytins/dressupzack
synced 2025-06-25 16:14:43 -04:00
Switch to C# (#8)
I learned C# primarily for game development but held off switching to it on Godot 3 because it was still rough around edges - crashed way too many times. It seems to be working as it should as of 3.1.1 and that's why I'm rewriting all the GDScript portions in C# as much as possible. However, this does make it incompatible with the Steam version, as of this writing, until the Godot devs decide how they want to publish it in future updates.
This commit is contained in:
parent
25f2212d4d
commit
bb7d4c2d2c
30 changed files with 885 additions and 354 deletions
77
project/.editorconfig
Normal file
77
project/.editorconfig
Normal file
|
@ -0,0 +1,77 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{csproj,proj,projitems,shproj,fsproj,target,props}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{fs,fsx,fsi}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.cs]
|
||||
# New line preferences
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
|
||||
# Indentation preferences
|
||||
csharp_indent_block_contents = true
|
||||
csharp_indent_braces = false
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_labels = one_less_than_current
|
||||
|
||||
# only use var when it's obvious what the variable type is
|
||||
csharp_style_var_for_built_in_types = true : none
|
||||
csharp_style_var_when_type_is_apparent = true : none
|
||||
csharp_style_var_elsewhere = true : suggestion
|
||||
|
||||
# Code style defaults
|
||||
dotnet_sort_system_directives_first = true
|
||||
csharp_preserve_single_line_blocks = true
|
||||
csharp_preserve_single_line_statements = false
|
||||
|
||||
# Pattern matching
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true : suggestion
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true : suggestion
|
||||
csharp_style_inlined_variable_declaration = true : suggestion
|
||||
|
||||
# Null checking preferences
|
||||
csharp_style_throw_expression = true : warning
|
||||
csharp_style_conditional_delegate_call = true : warning
|
||||
|
||||
# Space preferences
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_after_comma = true
|
||||
csharp_space_after_dot = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
csharp_space_after_semicolon_in_for_statement = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_around_declaration_statements = do_not_ignore
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_before_comma = false
|
||||
csharp_space_before_dot = false
|
||||
csharp_space_before_open_square_brackets = false
|
||||
csharp_space_before_semicolon_in_for_statement = false
|
||||
csharp_space_between_empty_square_brackets = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = false
|
||||
csharp_space_between_square_brackets = false
|
|
@ -1,12 +0,0 @@
|
|||
extends Node
|
||||
|
||||
# export (String, FILE, "*.json") var item_file : String
|
||||
|
||||
func load_items(file_path) -> Dictionary:
|
||||
var file = File.new()
|
||||
assert file.file_exists(file_path)
|
||||
|
||||
file.open(file_path)
|
||||
var items = parse_json(file.get_as_text())
|
||||
assert items.size() > 0
|
||||
return items
|
76
project/Nathan's Dress Up.csproj
Normal file
76
project/Nathan's Dress Up.csproj
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?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>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{64EE4F89-7A23-452A-8772-9E7C07A71ED9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<OutputPath>.mono\temp\bin\$(Configuration)</OutputPath>
|
||||
<RootNamespace>NathansDressUp</RootNamespace>
|
||||
<AssemblyName>Nathan's Dress Up</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<BaseIntermediateOutputPath>.mono\temp\obj</BaseIntermediateOutputPath>
|
||||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Tools|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>DEBUG;TOOLS;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="GodotSharp">
|
||||
<HintPath>$(ProjectDir)\.mono\assemblies\GodotSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="GodotSharpEditor" Condition=" '$(Configuration)' == 'Tools' ">
|
||||
<HintPath>$(ProjectDir)\.mono\assemblies\GodotSharpEditor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyDynamicInfo.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>AssemblyDynamicInfo.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="src\GameScn.cs" />
|
||||
<Compile Include="src\PauseScn.cs" />
|
||||
<Compile Include="src\Soundtrack.cs" />
|
||||
<Compile Include="src\TitleScn.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Properties\AssemblyDynamicInfo.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>AssemblyDynamicInfo.cs</LastGenOutput>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="project.licenseheader" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
19
project/Nathan's Dress Up.sln
Normal file
19
project/Nathan's Dress Up.sln
Normal file
|
@ -0,0 +1,19 @@
|
|||
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", "{64EE4F89-7A23-452A-8772-9E7C07A71ED9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Tools|Any CPU = Tools|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{64EE4F89-7A23-452A-8772-9E7C07A71ED9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{64EE4F89-7A23-452A-8772-9E7C07A71ED9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{64EE4F89-7A23-452A-8772-9E7C07A71ED9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{64EE4F89-7A23-452A-8772-9E7C07A71ED9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{64EE4F89-7A23-452A-8772-9E7C07A71ED9}.Tools|Any CPU.ActiveCfg = Tools|Any CPU
|
||||
{64EE4F89-7A23-452A-8772-9E7C07A71ED9}.Tools|Any CPU.Build.0 = Tools|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
8
project/Properties/AssemblyDynamicInfo.cs
Normal file
8
project/Properties/AssemblyDynamicInfo.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// This code was generated by a tool. Any changes made manually will be lost
|
||||
// the next time this code is regenerated.
|
||||
using System.Reflection;
|
||||
[assembly: AssemblyVersion("0.0.1906.1104")]
|
||||
[assembly: AssemblyFileVersion("0.0.1906.1104")]
|
14
project/Properties/AssemblyDynamicInfo.tt
Normal file
14
project/Properties/AssemblyDynamicInfo.tt
Normal file
|
@ -0,0 +1,14 @@
|
|||
<#@ template debug="false" hostspecific="false" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#
|
||||
var now = DateTime.UtcNow;
|
||||
var version = $"0.0.{now.Year % 100:D2}{now.Month:D2}.{now.Day:D2}{now.Hour:D2}";
|
||||
#>
|
||||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// This code was generated by a tool. Any changes made manually will be lost
|
||||
// the next time this code is regenerated.
|
||||
using System.Reflection;
|
||||
[assembly: AssemblyVersion("<#= version #>")]
|
||||
[assembly: AssemblyFileVersion("<#= version #>")]
|
27
project/Properties/AssemblyInfo.cs
Normal file
27
project/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using System.Reflection;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle("Nathan's Dress Up")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
4
project/packages.config
Normal file
4
project/packages.config
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
|
||||
</packages>
|
|
@ -23,14 +23,6 @@ boot_splash/bg_color=Color( 0.8, 0.8, 0.4, 1 )
|
|||
config/icon="res://icon.png"
|
||||
name_sv="Nathans klä upp"
|
||||
|
||||
[autoload]
|
||||
|
||||
GameKit="*res://src/GameKit.gd"
|
||||
|
||||
[debug]
|
||||
|
||||
gdscript/completion/autocomplete_setters_and_getters=true
|
||||
|
||||
[debug]
|
||||
|
||||
gdscript/completion/autocomplete_setters_and_getters=true
|
||||
|
@ -62,3 +54,4 @@ quality/intended_usage/framebuffer_allocation.mobile=0
|
|||
quality/2d/use_pixel_snap=true
|
||||
vram_compression/import_etc=true
|
||||
environment/default_environment="res://default_env.tres"
|
||||
quality/dynamic_fonts/use_oversampling=false
|
||||
|
|
4
project/project.licenseheader
Normal file
4
project/project.licenseheader
Normal file
|
@ -0,0 +1,4 @@
|
|||
extensions: designer.cs generated.cs
|
||||
extensions: .cs .cpp .h
|
||||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
|
@ -67,7 +67,7 @@ texture = ExtResource( 4 )
|
|||
[node name="Eyes" type="AnimatedSprite" parent="Base"]
|
||||
position = Vector2( 114.227, 63.9224 )
|
||||
frames = SubResource( 2 )
|
||||
frame = 4
|
||||
frame = 13
|
||||
playing = true
|
||||
|
||||
[node name="Mouth" type="AnimatedSprite" parent="Base"]
|
||||
|
|
|
@ -39,7 +39,7 @@ custom_colors/font_color_bg = Color( 0.921569, 0.921569, 0.921569, 1 )
|
|||
custom_colors/font_color_fg = Color( 1, 1, 1, 1 )
|
||||
|
||||
[node name="Pants" type="Tabs" parent="Wordrobe"]
|
||||
visible = false
|
||||
editor/display_folded = true
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 31.0
|
||||
|
@ -76,9 +76,9 @@ margin_bottom = 112.0
|
|||
texture_normal = ExtResource( 6 )
|
||||
|
||||
[node name="RemovePants" type="Button" parent="Wordrobe/Pants/PantsGrid"]
|
||||
margin_top = 116.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 228.0
|
||||
margin_left = 440.0
|
||||
margin_right = 546.0
|
||||
margin_bottom = 112.0
|
||||
rect_min_size = Vector2( 0, 112 )
|
||||
custom_colors/font_color_disabled = Color( 0, 0, 0, 1 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
|
@ -88,6 +88,8 @@ icon = ExtResource( 7 )
|
|||
flat = true
|
||||
|
||||
[node name="Shirts" type="Tabs" parent="Wordrobe"]
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 31.0
|
||||
|
@ -204,7 +206,6 @@ margin_bottom = 112.0
|
|||
texture_normal = ExtResource( 20 )
|
||||
|
||||
[node name="Accessoires" type="Tabs" parent="Wordrobe"]
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://src/CreditsScn.gd" type="Script" id=1]
|
||||
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=2]
|
||||
[ext_resource path="res://scn/Character.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://src/Soundtrack.gd" type="Script" id=5]
|
||||
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=1]
|
||||
[ext_resource path="res://scn/Character.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://src/Soundtrack.cs" type="Script" id=4]
|
||||
|
||||
[node name="Credits" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
||||
margin_left = 33.0
|
||||
margin_top = 19.0
|
||||
margin_right = 320.0
|
||||
margin_bottom = 206.0
|
||||
theme = ExtResource( 2 )
|
||||
theme = ExtResource( 1 )
|
||||
bbcode_text = "Nathan's Dress Up is a remake of Zack's Dress Up, a flash game created from 2006 to 2009. The character use to be a blue fox named Zack but was changed to a blue fennec named Nathan."
|
||||
text = "Nathan's Dress Up is a remake of Zack's Dress Up, a flash game created from 2006 to 2009. The character use to be a blue fox named Zack but was changed to a blue fennec named Nathan."
|
||||
|
||||
|
@ -24,7 +22,7 @@ anchor_right = 0.5
|
|||
margin_left = -159.0
|
||||
margin_right = 160.0
|
||||
margin_bottom = 586.0
|
||||
theme = ExtResource( 2 )
|
||||
theme = ExtResource( 1 )
|
||||
bbcode_enabled = true
|
||||
bbcode_text = "[center]Created by
|
||||
Anthony Wilcox
|
||||
|
@ -55,17 +53,10 @@ Made with
|
|||
Godot Engine
|
||||
"
|
||||
|
||||
[node name="Character" parent="." instance=ExtResource( 3 )]
|
||||
[node name="Character" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 68.8273, 256.845 )
|
||||
|
||||
[node name="WinDialogs" parent="." instance=ExtResource( 4 )]
|
||||
[node name="WinDialogs" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="Version" type="Label" parent="."]
|
||||
margin_left = 950.908
|
||||
margin_top = 568.64
|
||||
margin_right = 990.908
|
||||
margin_bottom = 582.64
|
||||
text = "Version"
|
||||
script = ExtResource( 4 )
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
[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]
|
||||
[ext_resource path="res://src/Soundtrack.gd" type="Script" id=5]
|
||||
[ext_resource path="res://src/Soundtrack.cs" type="Script" id=5]
|
||||
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://scn/Character.tscn" type="PackedScene" id=7]
|
||||
|
||||
|
|
56
project/scn/LicenseWin.tscn
Normal file
56
project/scn/LicenseWin.tscn
Normal file
|
@ -0,0 +1,56 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=1]
|
||||
|
||||
[node name="LicenseWin" type="AcceptDialog"]
|
||||
editor/display_folded = true
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -202.0
|
||||
margin_top = -137.5
|
||||
margin_right = 202.0
|
||||
margin_bottom = 137.5
|
||||
theme = ExtResource( 1 )
|
||||
window_title = "KLIC"
|
||||
resizable = true
|
||||
|
||||
[node name="LicenseTxt" type="RichTextLabel" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -194.0
|
||||
margin_top = 8.0
|
||||
margin_right = 194.0
|
||||
margin_bottom = 239.0
|
||||
bbcode_enabled = true
|
||||
bbcode_text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
|
||||
|
||||
[center]##########################[/center]
|
||||
|
||||
Nathan's Dress Up (c) by Anthony Wilcox
|
||||
|
||||
Nathan's Dress Up is licensed under a Creative Commons
|
||||
Attribution-ShareAlike 4.0 International License.
|
||||
|
||||
You should have received a copy of the license along with this work.
|
||||
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."
|
||||
text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
|
||||
|
||||
##########################
|
||||
|
||||
Nathan's Dress Up (c) by Anthony Wilcox
|
||||
|
||||
Nathan's Dress Up is licensed under a Creative Commons
|
||||
Attribution-ShareAlike 4.0 International License.
|
||||
|
||||
You should have received a copy of the license along with this work.
|
||||
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."
|
|
@ -1,7 +1,7 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=1]
|
||||
[ext_resource path="res://src/PauseScn.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/PauseScn.cs" type="Script" id=2]
|
||||
|
||||
[node name="WinDialogs" type="Control"]
|
||||
anchor_left = 0.5
|
||||
|
@ -148,58 +148,6 @@ margin_right = 65.0
|
|||
margin_bottom = 24.0
|
||||
text = "KMUS"
|
||||
align = 1
|
||||
|
||||
[node name="LicenseWin" type="AcceptDialog" parent="."]
|
||||
editor/display_folded = true
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -202.0
|
||||
margin_top = -137.5
|
||||
margin_right = 202.0
|
||||
margin_bottom = 137.5
|
||||
window_title = "KLIC"
|
||||
resizable = true
|
||||
|
||||
[node name="LicenseTxt" type="RichTextLabel" parent="LicenseWin"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -194.0
|
||||
margin_top = 8.0
|
||||
margin_right = 194.0
|
||||
margin_bottom = 238.0
|
||||
bbcode_enabled = true
|
||||
bbcode_text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
|
||||
|
||||
[center]##########################[/center]
|
||||
|
||||
Nathan's Dress Up (c) by Anthony Wilcox
|
||||
|
||||
Nathan's Dress Up is licensed under a Creative Commons
|
||||
Attribution-ShareAlike 4.0 International License.
|
||||
|
||||
You should have received a copy of the license along with this work.
|
||||
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."
|
||||
text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
|
||||
|
||||
##########################
|
||||
|
||||
Nathan's Dress Up (c) by Anthony Wilcox
|
||||
|
||||
Nathan's Dress Up is licensed under a Creative Commons
|
||||
Attribution-ShareAlike 4.0 International License.
|
||||
|
||||
You should have received a copy of the license along with this work.
|
||||
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."
|
||||
[connection signal="pressed" from="PauseWin/PauseVbox/SettingsBtn" to="." method="_on_SettingsBtn_pressed"]
|
||||
[connection signal="pressed" from="PauseWin/PauseVbox/ResumeBtn" to="." method="_on_ResumeBtn_pressed"]
|
||||
[connection signal="pressed" from="PauseWin/PauseVbox/ExitBtn" to="." method="_on_ExitBtn_pressed"]
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://src/TitleScn.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/TitleScn.cs" type="Script" id=1]
|
||||
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=2]
|
||||
[ext_resource path="res://sprites/title.svg" type="Texture" id=3]
|
||||
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://scn/LicenseWin.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="Start" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
@ -50,56 +50,7 @@ margin_right = 136.0
|
|||
margin_bottom = 71.0
|
||||
text = "KLIC"
|
||||
|
||||
[node name="ModePanel" type="WindowDialog" parent="MenuRf"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -73.0
|
||||
margin_top = -46.0
|
||||
margin_right = 73.0
|
||||
margin_bottom = 46.0
|
||||
|
||||
[node name="PlayVbox" type="VBoxContainer" parent="MenuRf/ModePanel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 5.0
|
||||
margin_top = 5.0
|
||||
margin_right = -5.0
|
||||
margin_bottom = -5.0
|
||||
|
||||
[node name="ModeLbl" type="Label" parent="MenuRf/ModePanel/PlayVbox"]
|
||||
margin_right = 136.0
|
||||
margin_bottom = 14.0
|
||||
text = "KGMO"
|
||||
align = 1
|
||||
|
||||
[node name="ModernBtn" type="Button" parent="MenuRf/ModePanel/PlayVbox"]
|
||||
margin_top = 18.0
|
||||
margin_right = 136.0
|
||||
margin_bottom = 38.0
|
||||
text = "Modern"
|
||||
|
||||
[node name="ClassicBtn" type="Button" parent="MenuRf/ModePanel/PlayVbox"]
|
||||
margin_top = 42.0
|
||||
margin_right = 136.0
|
||||
margin_bottom = 62.0
|
||||
text = "KCLS"
|
||||
|
||||
[node name="WinDialogs" parent="." instance=ExtResource( 4 )]
|
||||
margin_left = 97.0
|
||||
margin_top = 37.0
|
||||
margin_right = 97.0
|
||||
margin_bottom = 37.0
|
||||
|
||||
[node name="Version" type="Label" parent="."]
|
||||
margin_left = 950.908
|
||||
margin_top = 568.64
|
||||
margin_right = 990.908
|
||||
margin_bottom = 582.64
|
||||
text = "Version"
|
||||
[node name="LicenseWin" parent="." instance=ExtResource( 4 )]
|
||||
[connection signal="pressed" from="MenuRf/StartVbox/PlayBtn" to="." method="_on_PlayBtn_pressed"]
|
||||
[connection signal="pressed" from="MenuRf/StartVbox/CreditsBtn" to="." method="_on_CreditsBtn_pressed"]
|
||||
[connection signal="pressed" from="MenuRf/StartVbox/LicenseBtn" to="." method="_on_LicenseBtn_pressed"]
|
||||
[connection signal="pressed" from="MenuRf/ModePanel/PlayVbox/ModernBtn" to="." method="_on_ModernBtn_pressed"]
|
||||
[connection signal="pressed" from="MenuRf/ModePanel/PlayVbox/ClassicBtn" to="." method="_on_ClassicBtn_pressed"]
|
||||
|
|
|
@ -4,5 +4,5 @@ extends Node
|
|||
|
||||
func _process(delta):
|
||||
if Input.is_action_pressed("ui_pause"):
|
||||
GameKit.is_game_paused(true)
|
||||
# GameKit.is_game_paused(true)
|
||||
$WinDialogs/PauseWin.show()
|
|
@ -1,4 +0,0 @@
|
|||
extends Node
|
||||
|
||||
func _ready():
|
||||
$Version.text = GameKit.version
|
|
@ -1,21 +0,0 @@
|
|||
# Anthony Wilcox licenses this file to you under the GPL license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends Node
|
||||
|
||||
var version = "2.0"
|
||||
|
||||
func is_game_paused(is_paused):
|
||||
if is_paused == true:
|
||||
get_tree().paused = true
|
||||
else:
|
||||
get_tree().paused = false
|
||||
|
||||
func switch_scenes(new_mode):
|
||||
if new_mode == "classic":
|
||||
get_tree().change_scene("res://scn/ClassicScn.tscn")
|
||||
elif new_mode == "credits":
|
||||
get_tree().change_scene("res://scn/CreditsScn.tscn")
|
||||
elif new_mode == "play":
|
||||
get_tree().change_scene("res://scn/GameScn.tscn")
|
||||
elif new_mode == "title":
|
||||
get_tree().change_scene("res://scn/TitleScn.tscn")
|
129
project/src/GameScn.cs
Normal file
129
project/src/GameScn.cs
Normal file
|
@ -0,0 +1,129 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using Godot;
|
||||
|
||||
public enum ClothingLayer
|
||||
{
|
||||
Shirts,
|
||||
Pants,
|
||||
Undies,
|
||||
Accessory
|
||||
}
|
||||
|
||||
public class GameScn : Node
|
||||
{
|
||||
|
||||
void ChangeClothes(string path, ClothingLayer clothingLayer)
|
||||
{
|
||||
var texture = ResourceLoader.Load<Texture>($"res://sprites/{path}");
|
||||
|
||||
switch (clothingLayer)
|
||||
{
|
||||
case ClothingLayer.Shirts:
|
||||
var top = GetNode<Sprite>("Nathan/Top");
|
||||
top.Texture = texture;
|
||||
break;
|
||||
case ClothingLayer.Pants:
|
||||
var bottom = GetNode<Sprite>("Nathan/Bottom");
|
||||
bottom.Texture = texture;
|
||||
break;
|
||||
case ClothingLayer.Undies:
|
||||
var undies = GetNode<Sprite>("Nathan/Undies");
|
||||
undies.Texture = texture;
|
||||
break;
|
||||
case ClothingLayer.Accessory:
|
||||
var accessory = GetNode<Sprite>("Nathan/Accessory");
|
||||
accessory.Texture = texture;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ChangeClothes(ClothingLayer clothingLayer)
|
||||
{
|
||||
var blankTopPath = "tops_placeholder.png";
|
||||
var blankBottomPath = "bottoms_placeholder.png";
|
||||
|
||||
switch (clothingLayer)
|
||||
{
|
||||
case ClothingLayer.Shirts:
|
||||
ChangeClothes(blankTopPath, ClothingLayer.Shirts);
|
||||
break;
|
||||
case ClothingLayer.Pants:
|
||||
ChangeClothes(blankBottomPath, ClothingLayer.Pants);
|
||||
break;
|
||||
case ClothingLayer.Accessory:
|
||||
ChangeClothes(blankTopPath, ClothingLayer.Accessory);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TextureButton ClothesButton(string path, ClothingLayer clothingType)
|
||||
{
|
||||
switch (clothingType)
|
||||
{
|
||||
case ClothingLayer.Accessory:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Accessoires/AccsGrid/{path}");
|
||||
case ClothingLayer.Undies:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Underwear/UndiesGrid/{path}");
|
||||
default:
|
||||
case ClothingLayer.Pants:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Pants/PantsGrid/{path}");
|
||||
case ClothingLayer.Shirts:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Shirts/ShirtsGrid/{path}");
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(float delta)
|
||||
{
|
||||
// Accessories
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("CanonCam", ClothingLayer.Accessory).Pressed)
|
||||
ChangeClothes("camera.png", ClothingLayer.Accessory);
|
||||
|
||||
//if (ClothesButton("RemoveAccessory", ClothingLayer.Accessory).Pressed)
|
||||
// ChangeClothes(ClothingLayer.Accessory);
|
||||
|
||||
// Pants
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("Jeans", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("jeans.svg", ClothingLayer.Pants);
|
||||
|
||||
if (ClothesButton("Sweats", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("sweat_pants.svg", ClothingLayer.Pants);
|
||||
|
||||
if (ClothesButton("BeatUpJeans", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("beat_up_jeans.svg", ClothingLayer.Pants);
|
||||
|
||||
if (ClothesButton("BlueCamoJeans", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("blue_camo_jeans.svg", ClothingLayer.Pants);
|
||||
|
||||
//if (ClothesButton("RemovePants", ClothingLayer.Pants).Pressed)
|
||||
// ChangeClothes(ClothingLayer.Pants);
|
||||
|
||||
// Underwear
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("Briefs", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("briefs.svg", ClothingLayer.Undies);
|
||||
|
||||
if (ClothesButton("ZBriefs", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("z_briefs.svg", ClothingLayer.Undies);
|
||||
|
||||
if (ClothesButton("Fundosi", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("fundosi.svg", ClothingLayer.Undies);
|
||||
|
||||
if (ClothesButton("OwOCensor", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("owo_censor.svg", ClothingLayer.Undies);
|
||||
|
||||
// Shirts
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("TrainHoodie", ClothingLayer.Shirts).Pressed)
|
||||
ChangeClothes("train_hoodie.svg", ClothingLayer.Shirts);
|
||||
|
||||
if (ClothesButton("Sweatshirt", ClothingLayer.Shirts).Pressed)
|
||||
ChangeClothes("old_sweatshirt.svg", ClothingLayer.Shirts);
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
# Anthony Wilcox licenses this file to you under the GPL license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends "res://src/GameKit.gd"
|
||||
|
||||
# Default clothing
|
||||
onready var bottoms = load("res://sprites/bottoms_placeholder.png")
|
||||
onready var tops = load("res://sprites/tops_placeholder.png")
|
||||
onready var accessory = load("res://sprites/tops_placeholder.png")
|
||||
# ZC's Dress Up was stylized to be cute, not adult.
|
||||
# Underwear cam be suggestive but never lewd.
|
||||
onready var undies = load("res://sprites/briefs.svg")
|
||||
|
||||
func change_bottoms(new_bottom):
|
||||
bottoms = new_bottom
|
||||
|
||||
if new_bottom == null:
|
||||
$Nathan/Bottom.texture = bottoms
|
||||
|
||||
if undies == load("res://sprites/owo_censor.svg"):
|
||||
change_undies(null)
|
||||
|
||||
$Nathan/Bottom.texture = bottoms
|
||||
|
||||
func change_undies(new_undies):
|
||||
undies = new_undies
|
||||
$Nathan/Undies.texture = undies
|
||||
|
||||
func change_tops(new_top):
|
||||
tops = new_top
|
||||
|
||||
if new_top == null:
|
||||
$Nathan/Top.texture = tops
|
||||
|
||||
$Nathan/Top.texture = tops
|
||||
|
||||
func change_accessoires(new_accessory):
|
||||
accessory = new_accessory
|
||||
|
||||
if new_accessory == null:
|
||||
$Nathan/Accessory.texture = accessory
|
||||
|
||||
$Nathan/Accessory.texture = accessory
|
||||
|
||||
# warning-ignore:unused_argument
|
||||
func _process(delta):
|
||||
|
||||
# Change clothes
|
||||
# ===========================================================
|
||||
|
||||
if $Clothes/Wordrobe/Accessoires/AccsGrid/CanonCam.is_pressed():
|
||||
change_accessoires(load("res://sprites/camera.png"))
|
||||
|
||||
if $Clothes/Wordrobe/Pants/PantsGrid/Jeans.is_pressed():
|
||||
change_bottoms(load("res://sprites/jeans.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Pants/PantsGrid/Sweats.is_pressed():
|
||||
change_bottoms(load("res://sprites/sweat_pants.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Pants/PantsGrid/BeatUpJeans.is_pressed():
|
||||
change_bottoms(load("res://sprites/beat_up_jeans.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Underwear/UndiesGrid/Briefs.is_pressed():
|
||||
change_undies(load("res://sprites/briefs.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Underwear/UndiesGrid/ZBriefs.is_pressed():
|
||||
change_undies(load("res://sprites/z_briefs.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Underwear/UndiesGrid/Fundosi.is_pressed():
|
||||
change_undies(load("res://sprites/fundosi.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Underwear/UndiesGrid/OwOCensor.is_pressed():
|
||||
change_bottoms(null)
|
||||
change_undies(load("res://sprites/owo_censor.svg"))
|
||||
|
||||
|
||||
if $Clothes/Wordrobe/Pants/PantsGrid/BlueCamoJeans.is_pressed():
|
||||
change_bottoms(load("res://sprites/blue_camo_jeans.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Shirts/ShirtsGrid/TrainHoodie.is_pressed():
|
||||
change_tops(load("res://sprites/train_hoodie.svg"))
|
||||
|
||||
if $Clothes/Wordrobe/Shirts/ShirtsGrid/Sweatshirt.is_pressed():
|
||||
change_tops(load("res://sprites/old_sweatshirt.svg"))
|
||||
|
||||
# Remove clothes
|
||||
# ===========================================================
|
||||
|
||||
if $Clothes/Wordrobe/Accessoires/AccsGrid/RemoveAccessory.is_pressed():
|
||||
change_accessoires(null)
|
||||
|
||||
if $Clothes/Wordrobe/Shirts/ShirtsGrid/RemoveShirt.is_pressed():
|
||||
change_tops(null)
|
||||
|
||||
if $Clothes/Wordrobe/Pants/PantsGrid/RemovePants.is_pressed():
|
||||
change_bottoms(null)
|
43
project/src/PauseScn.cs
Normal file
43
project/src/PauseScn.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using Godot;
|
||||
|
||||
public class PauseScn : Control
|
||||
{
|
||||
void IsGamePaused(bool isPaused)
|
||||
{
|
||||
if (isPaused)
|
||||
GetTree().Paused = true;
|
||||
else
|
||||
GetTree().Paused = false;
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void _Process(float delta)
|
||||
{
|
||||
if (Input.IsActionPressed("ui_pause"))
|
||||
{
|
||||
GetNode<Popup>("PauseWin").Show();
|
||||
IsGamePaused(true);
|
||||
}
|
||||
}
|
||||
|
||||
void _on_ExitBtn_pressed()
|
||||
{
|
||||
IsGamePaused(false);
|
||||
GetTree().ChangeScene("res://scn/TitleScn.tscn");
|
||||
}
|
||||
|
||||
void _on_SettingsBtn_pressed()
|
||||
{
|
||||
GetNode<Popup>("SettingsWin").Show();
|
||||
}
|
||||
|
||||
void _on_ResumeBtn_pressed()
|
||||
{
|
||||
GetNode<Popup>("PauseWin").Hide();
|
||||
IsGamePaused(false);
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
# Anthony Wilcox licenses this file to you under the GPL license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends Node
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("ui_pause"):
|
||||
$PauseWin.show()
|
||||
GameKit.is_game_paused(true)
|
||||
|
||||
func _on_ExitBtn_pressed():
|
||||
GameKit.is_game_paused(false)
|
||||
GameKit.switch_scenes("title")
|
||||
|
||||
func _on_SettingsBtn_pressed():
|
||||
$SettingsWin.show()
|
||||
|
||||
func _on_CreditsBtn_pressed():
|
||||
GameKit.switch_scenes("credits")
|
||||
|
||||
func _on_LicenseBtn_pressed():
|
||||
$LicenseWin.show()
|
||||
|
||||
func _on_CloseAbtBtn_pressed():
|
||||
$AboutWin.hide()
|
||||
|
||||
func _on_MusicBtn_toggled(button_pressed):
|
||||
if button_pressed == true:
|
||||
$Music.playing = true
|
||||
else:
|
||||
$Music.playing = false
|
||||
|
||||
func _on_ResumeBtn_pressed():
|
||||
$PauseWin.hide()
|
||||
GameKit.is_game_paused(false)
|
27
project/src/Soundtrack.cs
Normal file
27
project/src/Soundtrack.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using Godot;
|
||||
|
||||
public class Soundtrack : AudioStreamPlayer
|
||||
{
|
||||
public override void _Ready () {
|
||||
//Connect ("finished", this, "PlayRandomSong");
|
||||
//PlayRandomSong();
|
||||
}
|
||||
|
||||
void PlayRandomSong () {
|
||||
var rand = new RandomNumberGenerator();
|
||||
rand.Randomize ();
|
||||
|
||||
var tracks = new string[] {
|
||||
"reminiscing",
|
||||
"together_again",
|
||||
"at_the_lake",
|
||||
"mushrooms",
|
||||
};
|
||||
var index = rand.RandiRange(0, tracks.Length);
|
||||
var audiostream = ResourceLoader.Load<AudioStream>($"res://music/{tracks[index]}.ogg");
|
||||
Stream = audiostream;
|
||||
Play();
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
# Anthony Wilcox licenses this file to you under the GPL license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends AudioStreamPlayer
|
||||
|
||||
const tracks = [
|
||||
'reminiscing',
|
||||
'together_again',
|
||||
'at_the_lake',
|
||||
'mushrooms',
|
||||
]
|
||||
|
||||
func _ready():
|
||||
connect("finished", self, "play_random_song")
|
||||
play_random_song()
|
||||
|
||||
func play_random_song():
|
||||
randomize()
|
||||
|
||||
var rand_db = randi() % tracks.size()
|
||||
var audiostream = load('res://music/' + tracks[rand_db] + '.ogg')
|
||||
stream = audiostream
|
||||
play()
|
18
project/src/TitleScn.cs
Normal file
18
project/src/TitleScn.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using Godot;
|
||||
|
||||
public class TitleScn : Node {
|
||||
|
||||
void _on_PlayBtn_pressed() {
|
||||
GetTree().ChangeScene("res://scn/GameScn.tscn");
|
||||
}
|
||||
|
||||
void _on_CreditsBtn_pressed() {
|
||||
GetTree().ChangeScene("res://scn/CreditsScn.tscn");
|
||||
}
|
||||
void _on_LicenseBtn_pressed()
|
||||
{
|
||||
GetNode<Popup>("LicenseWin").Show();
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
# Anthony Wilcox licenses this file to you under the GPL license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends Node
|
||||
|
||||
func _ready():
|
||||
$Version.text = GameKit.version
|
||||
|
||||
func _on_ClassicBtn_pressed():
|
||||
GameKit.switch_scenes("classic")
|
||||
|
||||
func _on_ModernBtn_pressed():
|
||||
GameKit.switch_scenes("play")
|
||||
|
||||
func _on_CreditsBtn_pressed():
|
||||
GameKit.switch_scenes("credits")
|
||||
|
||||
func _on_LicenseBtn_pressed():
|
||||
$WinDialogs/LicenseWin.show()
|
||||
|
||||
func _on_PlayBtn_pressed():
|
||||
GameKit.switch_scenes("play")
|
Loading…
Add table
Add a link
Reference in a new issue