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

Compare commits

...

3 commits

Author SHA1 Message Date
Tony Bark
9db6589717 Disable import and export on the web
- Removed Kenny Pixel as default font
2021-05-31 03:08:39 -04:00
Tony Bark
230af8d840 character_base code is now in an external script 2021-05-31 02:37:29 -04:00
Tony Bark
c3a79164a4 Changed license to Artistic-2.0
- Updated and simplified license headers.
2021-05-31 02:35:52 -04:00
19 changed files with 422 additions and 571 deletions

518
LICENSE
View file

@ -1,373 +1,201 @@
Mozilla Public License Version 2.0 The Artistic License 2.0
==================================
1. Definitions Copyright (c) 2000-2006, The Perl Foundation.
--------------
1.1. "Contributor" Everyone is permitted to copy and distribute verbatim copies
means each individual or legal entity that creates, contributes to of this license document, but changing it is not allowed.
the creation of, or owns Covered Software.
1.2. "Contributor Version" Preamble
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution" This license establishes the terms under which a given free software
means Covered Software of a particular Contributor. Package may be copied, modified, distributed, and/or redistributed.
The intent is that the Copyright Holder maintains some artistic
control over the development of that Package while still keeping the
Package available as open source and free software.
1.4. "Covered Software" You are always permitted to make arrangements wholly outside of this
means Source Code Form to which the initial Contributor has attached license directly with the Copyright Holder of a given Package. If the
the notice in Exhibit A, the Executable Form of such Source Code terms of this license do not permit the full use that you propose to
Form, and Modifications of such Source Code Form, in each case make of the Package, you should contact the Copyright Holder and seek
including portions thereof. a different licensing arrangement.
1.5. "Incompatible With Secondary Licenses" Definitions
means
(a) that the initial Contributor has attached the notice described "Copyright Holder" means the individual(s) or organization(s)
in Exhibit B to the Covered Software; or named in the copyright notice for the entire Package.
(b) that the Covered Software was made available under the terms of "Contributor" means any party that has contributed code or other
version 1.1 or earlier of the License, but not also under the material to the Package, in accordance with the Copyright Holder's
terms of a Secondary License. procedures.
1.6. "Executable Form" "You" and "your" means any person who would like to copy,
means any form of the work other than Source Code Form. distribute, or modify the Package.
1.7. "Larger Work" "Package" means the collection of files distributed by the
means a work that combines Covered Software with other material, in Copyright Holder, and derivatives of that collection and/or of
a separate file or files, that is not Covered Software. those files. A given Package may consist of either the Standard
Version, or a Modified Version.
1.8. "License" "Distribute" means providing a copy of the Package or making it
means this document. accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
1.9. "Licensable" "Distributor Fee" means any fee that you charge for Distributing
means having the right to grant, to the maximum extent possible, this Package or providing support for this Package to another
whether at the time of the initial grant or subsequently, any and party. It does not mean licensing fees.
all of the rights conveyed by this License.
1.10. "Modifications" "Standard Version" refers to the Package if it has not been
means any of the following: modified, or has been modified only in ways explicitly requested
by the Copyright Holder.
(a) any file in Source Code Form that results from an addition to, "Modified Version" means the Package, if it has been changed, and
deletion from, or modification of the contents of Covered such changes were not explicitly requested by the Copyright
Software; or Holder.
(b) any new file in Source Code Form that contains any Covered "Original License" means this Artistic License as Distributed with
Software. the Standard Version of the Package, in its current version or as
it may be modified by The Perl Foundation in the future.
1.11. "Patent Claims" of a Contributor "Source" form means the source code, documentation source, and
means any patent claim(s), including without limitation, method, configuration files for the Package.
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License" "Compiled" form means the compiled bytecode, object code, binary,
means either the GNU General Public License, Version 2.0, the GNU or any other form resulting from mechanical transformation or
Lesser General Public License, Version 2.1, the GNU Affero General translation of the Source form.
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your") Permission for Use and Modification Without Distribution
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions (1) You are permitted to use the Standard Version and create and use
-------------------------------- Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free, Permissions for Redistribution of the Standard Version
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark) (2) You may Distribute verbatim copies of the Source form of the
Licensable by such Contributor to use, reproduce, make available, Standard Version of this Package in any medium without restriction,
modify, display, perform, distribute, and otherwise exploit its either gratis or for a Distributor Fee, provided that you duplicate
Contributions, either on an unmodified basis, with Modifications, or all of the original copyright notices and associated disclaimers. At
as part of a Larger Work; and your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(b) under Patent Claims of such Contributor to make, use, sell, offer (3) You may apply any bug fixes, portability changes, and other
for sale, have made, import, and otherwise transfer either its modifications made available from the Copyright Holder. The resulting
Contributions or its Contributor Version. Package will still be considered the Standard Version, and as such
will be subject to the Original License.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution Distribution of Modified Versions of the Package as Source
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope (4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
The licenses granted in this Section 2 are the only rights granted under (a) make the Modified Version available to the Copyright Holder
this License. No additional rights or licenses will be implied from the of the Standard Version, under the Original License, so that the
distribution or licensing of Covered Software under this License. Copyright Holder may include your modifications in the Standard
Notwithstanding Section 2.1(b) above, no patent license is granted by a Version.
Contributor:
(b) ensure that installation of your Modified Version does not
(a) for any code that a Contributor has removed from Covered Software; prevent the user installing or running the Standard Version. In
or addition, the Modified Version must bear a name that is different
from the name of the Standard Version.
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its (c) allow anyone who receives a copy of the Modified Version to
Contributions with other software (except as part of its Contributor make the Source form of the Modified Version available to others
Version); or under
(c) under Patent Claims infringed by Covered Software in the absence of (i) the Original License or
its Contributions.
(ii) a license that permits the licensee to freely copy,
This License does not grant any rights in the trademarks, service marks, modify and redistribute the Modified Version using the same
or logos of any Contributor (except as may be necessary to comply with licensing terms that apply to the copy that the licensee
the notice requirements in Section 3.4). received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
2.4. Subsequent Licenses available in that license fees are prohibited but Distributor
Fees are allowed.
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if Distribution of Compiled Forms of the Standard Version
permitted under the terms of Section 3.3). or Modified Versions without the Source
2.5. Representation (5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
Each Contributor represents that the Contributor believes its get the Source of the Standard Version. Such instructions must be
Contributions are its original creation(s) or it has sufficient rights valid at the time of your distribution. If these instructions, at any
to grant the rights to its Contributions conveyed by this License. time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
2.6. Fair Use If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
This License is not intended to limit any rights You have under you do not forfeit any of your rights under this license.
applicable copyright doctrines of fair use, fair dealing, or other
equivalents. (6) You may Distribute a Modified Version in Compiled form without
the Source, provided that you comply with Section 4 with respect to
2.7. Conditions the Source of the Modified Version.
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1. Aggregating or Linking the Package
3. Responsibilities (7) You may aggregate the Package (either the Standard Version or
------------------- Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
3.1. Distribution of Source Form Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
All distribution of Covered Software in Source Code Form, including any apply to the use and Distribution of the Standard or Modified Versions
Modifications that You create or to which You contribute, must be under as included in the aggregation.
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this (8) You are permitted to link Modified and Standard Versions with
License, and how they can obtain a copy of this License. You may not other works, to embed the Package in a larger work of your own, or to
attempt to alter or restrict the recipients' rights in the Source Code build stand-alone binary or bytecode versions of applications that
Form. include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then: Items That are Not Considered Part of a Modified Version
(a) such Covered Software must also be made available in Source Code (9) Works (including, but not limited to, modules and scripts) that
Form, as described in Section 3.1, and You must inform recipients of merely extend or make use of the Package, do not, by themselves, cause
the Executable Form how they can obtain a copy of such Source Code the Package to be a Modified Version. In addition, such works are not
Form by reasonable means in a timely manner, at a charge no more considered parts of the Package itself, and are not subject to the
than the cost of distribution to the recipient; and terms of this license.
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the General Provisions
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License. (10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
3.3. Distribution of a Larger Work modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
You may create and distribute a Larger Work under terms of Your choice, license.
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered (11) If your Modified Version has been derived from a Modified
Software with a work governed by one or more Secondary Licenses, and the Version made by someone other than you, you are nevertheless required
Covered Software is not Incompatible With Secondary Licenses, this to ensure that your Modified Version complies with the requirements of
License permits You to additionally distribute such Covered Software this license.
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered (12) This license does not grant you the right to use any trademark,
Software under the terms of either this License or such Secondary service mark, tradename, or logo of the Copyright Holder.
License(s).
(13) This license includes the non-exclusive, worldwide,
3.4. Notices free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
You may not remove or alter the substance of any license notices patent claims licensable by the Copyright Holder that are necessarily
(including copyright notices, patent notices, disclaimers of warranty, infringed by the Package. If you institute patent litigation
or limitations of liability) contained within the Source Code Form of (including a cross-claim or counterclaim) against any party alleging
the Covered Software, except that You may alter any license notices to that the Package constitutes direct or contributory patent
the extent required to remedy known factual inaccuracies. infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.
3.5. Application of Additional Terms
(14) Disclaimer of Warranty:
You may choose to offer, and to charge a fee for, warranty, support, THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
indemnity or liability obligations to one or more recipients of Covered IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
Software. However, You may do so only on Your own behalf, and not on WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
behalf of any Contributor. You must make it absolutely clear that any NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
such warranty, support, indemnity, or liability obligation is offered by LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
You alone, and You hereby agree to indemnify every Contributor for any BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
liability incurred by such Contributor as a result of warranty, support, DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
indemnity or liability terms You offer. You may include additional ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View file

@ -5,14 +5,16 @@
![](screenshot.gif) ![](screenshot.gif)
Tony's Dress Up is a re-imagining of my first Flash game, ZC's Dress Up, developed back in 2007. I've included the Flash copies in the ``/archive`` directory. They can be played using [Ruffle](https://ruffle.rs/)'s demo page. Tony's Dress Up is a re-imagining of my first (and only) Flash game series, ZC's Dress Up , developed back in 2007. Both this and the originals are heavily inspired by The Sims 2: Body Shop in their own unique ways.
I've included the original Flash releases in the ``/archive`` directory. They can be played using [Ruffle](https://ruffle.rs/)'s demo page.
## Getting Started ## Getting Started
### Prerequisites ### Prerequisites
- Godot Engine 3.2 - Godot Engine 3.2 LTS or later
## Authors ## Authors
@ -24,7 +26,7 @@
## License ## License
The source and assets are licensed under the MPL 2.0 License and CC-BY, respectfully - see the [LICENSE](LICENSE) and [ASSET-LICENSE](ASSET-LICENSE) for more details. The source and assets are licensed under the Artistic-2.0 License and CC-BY, respectfully - see the [LICENSE](LICENSE) and [ASSET-LICENSE](ASSET-LICENSE) for more details.
The Flash games included are closed source, but considered abandonware. Feel free to share them on archives. The Flash games included are closed source, but considered abandonware. Feel free to share them on archives.

View file

@ -39,14 +39,9 @@ window/size/width=800
window/size/height=500 window/size/height=500
window/size/resizable=false window/size/resizable=false
window/energy_saving/keep_screen_on=false window/energy_saving/keep_screen_on=false
mouse_cursor/custom_image="res://sprites/clothes/cursor.png"
window/stretch/mode="2d" window/stretch/mode="2d"
window/stretch/aspect="keep" window/stretch/aspect="keep"
[gui]
theme/custom_font="res://fonts/kenny_pixel_25.tres"
[importer_defaults] [importer_defaults]
texture={ texture={

View file

@ -28,114 +28,9 @@
[ext_resource path="res://sprites/clothes/blank_top.png" type="Texture" id=26] [ext_resource path="res://sprites/clothes/blank_top.png" type="Texture" id=26]
[ext_resource path="res://sprites/character/character_base_head.svg" type="Texture" id=27] [ext_resource path="res://sprites/character/character_base_head.svg" type="Texture" id=27]
[ext_resource path="res://sprites/character/mouth/mouth11.png" type="Texture" id=28] [ext_resource path="res://sprites/character/mouth/mouth11.png" type="Texture" id=28]
[ext_resource path="res://scripts/character_base.gd" type="Script" id=29]
[sub_resource type="GDScript" id=1] [sub_resource type="SpriteFrames" id=1]
script/source = "# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node2D
const _TDU_VERSION = \"0.2\"
const _SAVE_FILE = \"user://character.tdu\"
onready var character = preload(\"res://resources/character.tres\")
onready var blank_accessory = preload(\"res://sprites/clothes/blank_top.png\")
onready var base_top = preload(\"res://sprites/character/character_base_top.svg\")
onready var base_bottom = preload(\"res://sprites/character/character_base_legs.svg\")
onready var accessory = $body/accessory
#onready var underwear = $Undies
onready var bottom = $body/legs
onready var top = $body/top
onready var eyes = $body/head/eyes
onready var mouth = $body/head/mouth
func _process(delta):
if character.accessory != null:
accessory.texture = character.accessory
# if character.underwear != null:
# underwear.texture = character.underwear
if character.bottom != null:
bottom.texture = character.bottom
if character.top != null:
top.texture = character.top
func save_game():
var data_file = {
\"version\": _TDU_VERSION,
\"game_ver\": GameData.version,
\"accessory\": \"res://sprites/clothes/blank_top.png\",
\"top\": \"res://sprites/clothes/blank_top.png\",
\"bottom\": \"res://sprites/character/character_base_legs.svg\",
}
data_file[\"accessory\"] = accessory.texture.resource_path
data_file[\"top\"] = top.texture.resource_path
data_file[\"bottom\"] = bottom.texture.resource_path
var file = File.new()
if file.open(_SAVE_FILE, File.WRITE) != 0:
print(\"Error opening file\")
return
var json_file = to_json(data_file)
file.store_line(json_file)
print_debug(json_file)
file.close()
func load_game():
var file = File.new()
if not file.file_exists(_SAVE_FILE):
print(\"File not found!\")
return
if file.open(_SAVE_FILE, File.READ) != 0:
print(\"Error opening file\")
return
var data = parse_json(file.get_line())
var top_texture = ImageTexture.new()
var accessory_texture = ImageTexture.new()
var bottom_texture = ImageTexture.new()
var top_image = Image.new()
var accessory_image = Image.new()
var bottom_image = Image.new()
top_image.load(data[\"top\"])
top_texture.create_from_image(top_image)
top.texture = top_texture
bottom_image.load(data[\"bottom\"])
top_texture.create_from_image(top_image)
bottom.texture = top_texture
accessory_image.load(data[\"accessory\"])
accessory_texture.create_from_image(top_image)
accessory.texture = accessory_texture
file.close()
func _on_clearBtn_pressed():
$Click.play()
character.accessory = blank_accessory
character.bottom = base_bottom
character.top = base_top
func _on_SaveBtn_pressed():
$Click.play()
GameEvents.emit_signal(\"indicate\")
save_game()
func _on_LoadBtn_pressed():
$Click.play()
GameEvents.emit_signal(\"indicate\")
load_game()
"
[sub_resource type="SpriteFrames" id=2]
animations = [ { animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 4 ) ], "frames": [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 4 ) ],
"loop": true, "loop": true,
@ -143,7 +38,7 @@ animations = [ {
"speed": 2.0 "speed": 2.0
} ] } ]
[sub_resource type="SpriteFrames" id=3] [sub_resource type="SpriteFrames" id=2]
animations = [ { animations = [ {
"frames": [ ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ) ], "frames": [ ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ) ],
"loop": true, "loop": true,
@ -151,7 +46,7 @@ animations = [ {
"speed": 2.0 "speed": 2.0
} ] } ]
[sub_resource type="SpriteFrames" id=4] [sub_resource type="SpriteFrames" id=3]
animations = [ { animations = [ {
"frames": [ ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 22 ), ExtResource( 28 ), ExtResource( 23 ) ], "frames": [ ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 22 ), ExtResource( 28 ), ExtResource( 23 ) ],
"loop": true, "loop": true,
@ -159,55 +54,97 @@ animations = [ {
"speed": 2.0 "speed": 2.0
} ] } ]
[node name="characterBase" type="Node2D"] [node name="CharacterBase" type="Node2D"]
position = Vector2( -19, -92 ) position = Vector2( -19, -92 )
script = SubResource( 1 ) script = ExtResource( 29 )
[node name="Click" type="AudioStreamPlayer" parent="."] [node name="Click" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 24 ) stream = ExtResource( 24 )
[node name="shadow" type="Sprite" parent="."] [node name="Shadow" type="Sprite" parent="."]
position = Vector2( 4.84271, 244.714 ) position = Vector2( 4.84271, 244.714 )
texture = ExtResource( 1 ) texture = ExtResource( 1 )
[node name="body" type="Node2D" parent="."] [node name="Body" type="Node2D" parent="."]
__meta__ = { __meta__ = {
"_edit_lock_": true "_edit_lock_": true
} }
[node name="tail" type="AnimatedSprite" parent="body"] [node name="Tail" type="AnimatedSprite" parent="Body"]
position = Vector2( -33.7592, 99.4079 ) position = Vector2( -33.7592, 99.4079 )
scale = Vector2( 0.927713, 1 ) scale = Vector2( 0.927713, 1 )
frames = SubResource( 2 ) frames = SubResource( 1 )
playing = true
[node name="legs" type="Sprite" parent="body"]
position = Vector2( 1.47027, 191.868 )
texture = ExtResource( 5 )
[node name="top" type="Sprite" parent="body"]
position = Vector2( 7, 78 )
texture = ExtResource( 25 )
[node name="head" type="Sprite" parent="body"]
position = Vector2( 10.6805, -25.1047 )
texture = ExtResource( 27 )
[node name="eyes" type="AnimatedSprite" parent="body/head"]
position = Vector2( 17.6857, 4.22147 )
frames = SubResource( 3 )
frame = 2 frame = 2
playing = true playing = true
[node name="mouth" type="AnimatedSprite" parent="body/head"] [node name="Legs" type="Sprite" parent="Body"]
position = Vector2( 38.1195, 8.68453 ) position = Vector2( 1.47027, 191.868 )
frames = SubResource( 4 ) texture = ExtResource( 5 )
frame = 5
[node name="Top" type="Sprite" parent="Body"]
position = Vector2( 7, 78 )
texture = ExtResource( 25 )
[node name="Head" type="Sprite" parent="Body"]
position = Vector2( 10.6805, -25.1047 )
texture = ExtResource( 27 )
[node name="Eyes" type="AnimatedSprite" parent="Body/Head"]
position = Vector2( 17.6857, 4.22147 )
frames = SubResource( 2 )
frame = 2
playing = true playing = true
[node name="accessory" type="Sprite" parent="body"] [node name="Mouth" type="AnimatedSprite" parent="Body/Head"]
position = Vector2( 38.1195, 8.68453 )
frames = SubResource( 3 )
frame = 10
playing = true
[node name="Accessory" type="Sprite" parent="Body"]
position = Vector2( 9.54095, 73.0832 ) position = Vector2( 9.54095, 73.0832 )
texture = ExtResource( 26 ) texture = ExtResource( 26 )
__meta__ = { __meta__ = {
"_edit_lock_": true "_edit_lock_": true
} }
[node name="Controls" type="CanvasLayer" parent="."]
[node name="Container" type="Control" parent="Controls"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -19.0
margin_top = -92.0
margin_right = -19.0
margin_bottom = -92.0
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": true
}
[node name="ExportWin" type="FileDialog" parent="Controls/Container"]
anchor_left = 0.215
anchor_top = 0.21
anchor_right = 0.785
anchor_bottom = 0.79
window_title = "Export"
access = 1
current_dir = "user://Users/tonytins/Projects/tonysdressup"
current_path = "user://Users/tonytins/Projects/tonysdressup/"
__meta__ = {
"_edit_use_anchors_": true
}
[node name="ImportWin" type="FileDialog" parent="Controls/Container"]
anchor_left = 0.215
anchor_top = 0.21
anchor_right = 0.785
anchor_bottom = 0.79
window_title = "Open a File"
mode = 0
access = 1
current_dir = "user://Users/tonytins/Projects/tonysdressup"
current_path = "user://Users/tonytins/Projects/tonysdressup/"
__meta__ = {
"_edit_use_anchors_": true
}

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=2] [gd_scene load_steps=15 format=2]
[ext_resource path="res://scenes/character_base.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/character_base.tscn" type="PackedScene" id=1]
[ext_resource path="res://sprites/world/background.svg" type="Texture" id=2] [ext_resource path="res://sprites/world/background.svg" type="Texture" id=2]
@ -9,6 +9,8 @@
[ext_resource path="res://sprites/symbols/file-upload.svg" type="Texture" id=7] [ext_resource path="res://sprites/symbols/file-upload.svg" type="Texture" id=7]
[ext_resource path="res://scripts/ui.gd" type="Script" id=8] [ext_resource path="res://scripts/ui.gd" type="Script" id=8]
[ext_resource path="res://sprites/symbols/file-download.svg" type="Texture" id=9] [ext_resource path="res://sprites/symbols/file-download.svg" type="Texture" id=9]
[ext_resource path="res://sprites/symbols/file-upload-disabled.svg" type="Texture" id=10]
[ext_resource path="res://sprites/symbols/file-download-disabled.svg" type="Texture" id=11]
[ext_resource path="res://sprites/symbols/spinner.svg" type="Texture" id=12] [ext_resource path="res://sprites/symbols/spinner.svg" type="Texture" id=12]
[ext_resource path="res://scripts/spinner.gd" type="Script" id=13] [ext_resource path="res://scripts/spinner.gd" type="Script" id=13]
[ext_resource path="res://scripts/game.gd" type="Script" id=14] [ext_resource path="res://scripts/game.gd" type="Script" id=14]
@ -35,11 +37,11 @@ position = Vector2( 35.118, -14.56 )
texture = ExtResource( 6 ) texture = ExtResource( 6 )
[node name="characterBase" parent="." instance=ExtResource( 1 )] [node name="characterBase" parent="." instance=ExtResource( 1 )]
position = Vector2( 133.807, 230.615 ) position = Vector2( 141.307, 225.012 )
[node name="Controls" type="CanvasLayer" parent="."] [node name="Controls" type="CanvasLayer" parent="."]
[node name="DressUp" type="Control" parent="Controls"] [node name="Container" type="Control" parent="Controls"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 8 ) script = ExtResource( 8 )
@ -49,14 +51,14 @@ __meta__ = {
} }
version = "1.10" version = "1.10"
[node name="wardrobe" parent="Controls/DressUp" instance=ExtResource( 4 )] [node name="Wardrobe" parent="Controls/Container" instance=ExtResource( 4 )]
anchor_left = 0.33875 anchor_left = 0.33875
anchor_top = 0.054 anchor_top = 0.054
anchor_right = 1.05 anchor_right = 1.05
anchor_bottom = 0.9 anchor_bottom = 0.9
margin_right = 6.10352e-05 margin_right = 6.10352e-05
[node name="Spinner" type="TextureRect" parent="Controls/DressUp"] [node name="Spinner" type="TextureRect" parent="Controls/Container"]
visible = false visible = false
anchor_left = 0.945785 anchor_left = 0.945785
anchor_top = 0.153026 anchor_top = 0.153026
@ -68,10 +70,10 @@ __meta__ = {
"_edit_use_anchors_": true "_edit_use_anchors_": true
} }
[node name="Timer" type="Timer" parent="Controls/DressUp/Spinner"] [node name="Timer" type="Timer" parent="Controls/Container/Spinner"]
wait_time = 2.0 wait_time = 2.0
[node name="CenterBtns" type="CenterContainer" parent="Controls/DressUp"] [node name="CenterBtns" type="CenterContainer" parent="Controls/Container"]
anchor_left = 0.35875 anchor_left = 0.35875
anchor_top = 0.792 anchor_top = 0.792
anchor_right = 0.99625 anchor_right = 0.99625
@ -80,37 +82,36 @@ __meta__ = {
"_edit_use_anchors_": true "_edit_use_anchors_": true
} }
[node name="ButtonCtr" type="HBoxContainer" parent="Controls/DressUp/CenterBtns"] [node name="ButtonCtr" type="HBoxContainer" parent="Controls/Container/CenterBtns"]
margin_left = 179.0 margin_left = 197.0
margin_top = 4.0 margin_top = 7.0
margin_right = 330.0 margin_right = 312.0
margin_bottom = 42.0 margin_bottom = 39.0
custom_constants/separation = 20 custom_constants/separation = 20
[node name="SaveBtn" type="Button" parent="Controls/DressUp/CenterBtns/ButtonCtr"] [node name="ExportBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_right = 37.0 margin_right = 25.0
margin_bottom = 38.0 margin_bottom = 32.0
hint_tooltip = "Save" hint_tooltip = "Export"
icon = ExtResource( 7 ) texture_normal = ExtResource( 7 )
flat = true texture_disabled = ExtResource( 10 )
[node name="LoadBtn" type="Button" parent="Controls/DressUp/CenterBtns/ButtonCtr"] [node name="ImportBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_left = 57.0 margin_left = 45.0
margin_right = 94.0 margin_right = 70.0
margin_bottom = 38.0 margin_bottom = 32.0
hint_tooltip = "Load" hint_tooltip = "Import"
icon = ExtResource( 9 ) texture_normal = ExtResource( 9 )
flat = true texture_disabled = ExtResource( 11 )
[node name="clearBtn" type="Button" parent="Controls/DressUp/CenterBtns/ButtonCtr"] [node name="ClearBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_left = 114.0 margin_left = 90.0
margin_right = 151.0 margin_right = 115.0
margin_bottom = 38.0 margin_bottom = 32.0
hint_tooltip = "Clear" hint_tooltip = "Clear"
icon = ExtResource( 3 ) texture_normal = ExtResource( 3 )
flat = true
[node name="versionLbl" type="Label" parent="Controls/DressUp"] [node name="versionLbl" type="Label" parent="Controls/Container"]
anchor_left = 0.88125 anchor_left = 0.88125
anchor_top = 0.944 anchor_top = 0.944
anchor_right = 0.9825 anchor_right = 0.9825
@ -122,7 +123,7 @@ __meta__ = {
"_edit_use_anchors_": true "_edit_use_anchors_": true
} }
[connection signal="timeout" from="Controls/DressUp/Spinner/Timer" to="Controls/DressUp/Spinner" method="_on_Timer_timeout"] [connection signal="timeout" from="Controls/Container/Spinner/Timer" to="Controls/Container/Spinner" method="_on_Timer_timeout"]
[connection signal="pressed" from="Controls/DressUp/CenterBtns/ButtonCtr/SaveBtn" to="characterBase" method="_on_SaveBtn_pressed"] [connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ExportBtn" to="characterBase" method="_on_SaveBtn_pressed"]
[connection signal="pressed" from="Controls/DressUp/CenterBtns/ButtonCtr/LoadBtn" to="characterBase" method="_on_LoadBtn_pressed"] [connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ImportBtn" to="characterBase" method="_on_LoadBtn_pressed"]
[connection signal="pressed" from="Controls/DressUp/CenterBtns/ButtonCtr/clearBtn" to="characterBase" method="_on_clearBtn_pressed"] [connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ClearBtn" to="characterBase" method="_on_clearBtn_pressed"]

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends Resource extends Resource

View file

@ -1,22 +0,0 @@
# This project is licensed under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node2D
onready var character = preload("res://resources/character.tres")
onready var accessory = $Accessory
onready var underwear = $Undies
onready var bottom = $Bottom
onready var top = $Top
func _process(delta):
if character.accessory != null:
accessory.texture = character.accessory
if character.underwear != null:
underwear.texture = character.underwear
if character.bottom != null:
bottom.texture = character.bottom
if character.top != null:
top.texture = character.top

View file

@ -1,3 +1,5 @@
# This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information.
extends Node extends Node
var version = "0.0.0" var version = "0.0.0"

View file

@ -1,3 +1,5 @@
# This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information.
extends Node extends Node
signal indicate signal indicate

110
scripts/character_base.gd Normal file
View file

@ -0,0 +1,110 @@
# This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information.
extends Node2D
const _TDU_VERSION = "0.2"
const _SAVE_FILE = "user://character.tdu"
onready var character = preload("res://resources/character.tres")
onready var blank_accessory = preload("res://sprites/clothes/blank_top.png")
onready var base_top = preload("res://sprites/character/character_base_top.svg")
onready var base_bottom = preload("res://sprites/character/character_base_legs.svg")
onready var export_win = $Controls/Container/ExportWin
onready var import_win = $Controls/Container/ImportWin
onready var unsupported_win = $Controls/Container/NotSupportedWin
onready var accessory = $Body/Accessory
#onready var underwear = $Undies
onready var bottom = $Body/Legs
onready var top = $Body/Top
# onready var eyes = $Body/Head/Eyes
# onready var mouth = $Body/Head/Mouth
func _process(delta):
if character.accessory != null:
accessory.texture = character.accessory
# if character.underwear != null:
# underwear.texture = character.underwear
if character.bottom != null:
bottom.texture = character.bottom
if character.top != null:
top.texture = character.top
func save_game():
var data_file = {
"version": _TDU_VERSION,
"game_ver": GameData.version,
"accessory": "res://sprites/clothes/blank_top.png",
"top": "res://sprites/clothes/blank_top.png",
"bottom": "res://sprites/character/character_base_legs.svg",
}
data_file["accessory"] = accessory.texture.resource_path
data_file["top"] = top.texture.resource_path
data_file["bottom"] = bottom.texture.resource_path
var file = File.new()
if file.open(_SAVE_FILE, File.WRITE) != 0:
print("Error opening file")
return
var json_file = to_json(data_file)
GameEvents.emit_signal("indicate")
file.store_line(json_file)
file.close()
func load_game():
var file = File.new()
if not file.file_exists(_SAVE_FILE):
print("File not found!")
return
if file.open(_SAVE_FILE, File.READ) != 0:
print("Error opening file")
return
var data = parse_json(file.get_as_text())
var top_texture = ImageTexture.new()
var accessory_texture = ImageTexture.new()
var bottom_texture = ImageTexture.new()
var top_image = Image.new()
var accessory_image = Image.new()
var bottom_image = Image.new()
GameEvents.emit_signal("indicate")
top_image.load(data["top"])
top_texture.create_from_image(top_image)
top.texture = top_texture
bottom_image.load(data["bottom"])
top_texture.create_from_image(top_image)
bottom.texture = top_texture
accessory_image.load(data["accessory"])
accessory_texture.create_from_image(top_image)
accessory.texture = accessory_texture
file.close()
func _on_clearBtn_pressed():
$Click.play()
character.accessory = blank_accessory
character.bottom = base_bottom
character.top = base_top
func _on_SaveBtn_pressed():
$Click.play()
save_game()
func _on_LoadBtn_pressed():
$Click.play()
load_game()

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends "res://scripts/clothing/clothing_base.gd" extends "res://scripts/clothing/clothing_base.gd"

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends "res://scripts/clothing/clothing_base.gd" extends "res://scripts/clothing/clothing_base.gd"

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends TextureButton extends TextureButton

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends "res://scripts/clothing/clothing_base.gd" extends "res://scripts/clothing/clothing_base.gd"

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends "res://scripts/clothing/clothing_base.gd" extends "res://scripts/clothing/clothing_base.gd"

View file

@ -1,16 +1,3 @@
# This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information.
extends Node2D extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View file

@ -1,3 +1,5 @@
# This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information.
extends TextureRect extends TextureRect
onready var timer = $Timer onready var timer = $Timer

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends Control extends Control
@ -9,7 +9,14 @@ onready var blank_accessory = preload("res://sprites/clothes/blank_top.png")
onready var base_top = preload("res://sprites/character/character_base_top.svg") onready var base_top = preload("res://sprites/character/character_base_top.svg")
onready var base_bottom = preload("res://sprites/character/character_base_legs.svg") onready var base_bottom = preload("res://sprites/character/character_base_legs.svg")
onready var export_btn = $CenterBtns/ButtonCtr/ExportBtn
onready var import_btn = $CenterBtns/ButtonCtr/ImportBtn
func _ready(): func _ready():
var verLabel = $versionLbl var verLabel = $versionLbl
verLabel.text = "v" + version verLabel.text = "v" + version
GameData.version = version GameData.version = version
if OS.get_name() == "HTML5":
export_btn.disabled == true
import_btn.disabled == true

View file

@ -1,4 +1,4 @@
# This project is licensed under the MPL license. # This project is licensed under the Artistic-2.0 license.
# See the LICENSE file in the project root for more information. # See the LICENSE file in the project root for more information.
extends TabContainer extends TabContainer