1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-06-26 00:24:44 -04:00

Initial source commit

This commit is contained in:
Anthony Wilcox 2019-11-08 14:59:36 -05:00
commit 7fb6faa9bb
266 changed files with 10178 additions and 0 deletions

15
project/src/Character.gd Normal file
View file

@ -0,0 +1,15 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
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

@ -0,0 +1,8 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
func _process(delta):
if Input.is_action_pressed("ui_pause"):
GameKit.is_game_paused(true)
$WinDialogs/PauseWin.show()

13
project/src/CreditsScn.gd Normal file
View file

@ -0,0 +1,13 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
func _ready():
$Version.text = GameKit.version
func _process(delta):
$Character/Undies.texture = UserSettings.Underwear
$Character/Bottom.texture = UserSettings.Bottoms
$Character/Top.texture = UserSettings.Tops
$Character/Accessory.texture = UserSettings.Accessory

29
project/src/GameKit.gd Normal file
View file

@ -0,0 +1,29 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
var version = "2.0"
func _ready():
randomize()
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")
func if_file_exists(file):
var fileCheck = File.new()
var fileExists = fileCheck.file_exists(file)
fileCheck

140
project/src/GameScn.gd Normal file
View file

@ -0,0 +1,140 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
enum ClothingLayer {
TOPS,
BOTTOMS,
UNDIES,
ACCESSORY,
}
# 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")
onready var undies = load("res://sprites/briefs.svg")
func change_bottoms(new_bottom):
bottoms = new_bottom
if new_bottom == null:
$Character/Bottom.texture = bottoms
UserSettings.Bottoms = bottoms
if undies == load("res://sprites/owo_censor.svg"):
change_undies(null)
$Character/Bottom.texture = bottoms
UserSettings.Bottoms = bottoms
func change_undies(new_undies):
undies = new_undies
$Character/Undies.texture = undies
UserSettings.Underwear = undies
func change_tops(new_top):
tops = new_top
if new_top == null:
$Character/Top.texture = tops
UserSettings.Tops = tops
$Character/Top.texture = tops
UserSettings.Tops = tops
func change_accessoires(new_accessory):
accessory = new_accessory
if new_accessory == null:
$Character/Accessory.texture = accessory
UserSettings.Accessory = accessory
$Character/Accessory.texture = accessory
UserSettings.Accessory = accessory
func change_clothings(new_clothes, clothing_type):
pass
# warning-ignore:unused_argument
func _process(delta):
# Change clothes
# ===========================================================
if $Wordrobe/Accessoires/AccsScroll/AccsGrid/CanonCam.is_pressed():
change_accessoires(load("res://sprites/camera.png"))
if $Wordrobe/Pants/PantsScroll/PantsGrid/Jeans.is_pressed():
change_bottoms(load("res://sprites/jeans.svg"))
if $Wordrobe/Pants/PantsScroll/PantsGrid/Sweats.is_pressed():
change_bottoms(load("res://sprites/sweat_pants.svg"))
if $Wordrobe/Pants/PantsScroll/PantsGrid/BlueSkirt.is_pressed():
change_bottoms(load("res://sprites/blue_skirt.svg"))
if $Wordrobe/Pants/PantsScroll/PantsGrid/FormalSkirt.is_pressed():
change_bottoms(load("res://sprites/formal_skirt.svg"))
if $Wordrobe/Pants/PantsScroll/PantsGrid/BeatUpJeans.is_pressed():
change_bottoms(load("res://sprites/beat_up_jeans.svg"))
if $Wordrobe/Underwear/UndiesScroll/UndiesGrid/Briefs.is_pressed():
change_undies(load("res://sprites/briefs.svg"))
if $Wordrobe/Underwear/UndiesScroll/UndiesGrid/ZBriefs.is_pressed():
change_undies(load("res://sprites/z_briefs.svg"))
if $Wordrobe/Underwear/UndiesScroll/UndiesGrid/Fundosi.is_pressed():
change_undies(load("res://sprites/fundosi.svg"))
if $Wordrobe/Underwear/UndiesScroll/UndiesGrid/OwOCensor.is_pressed():
change_bottoms(null)
change_undies(load("res://sprites/owo_censor.svg"))
if $Wordrobe/Pants/PantsScroll/PantsGrid/BlueCamoJeans.is_pressed():
change_bottoms(load("res://sprites/blue_camo_jeans.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/TrainHoodie.is_pressed():
change_tops(load("res://sprites/train_hoodie.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Sweatshirt.is_pressed():
change_tops(load("res://sprites/old_sweatshirt.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Raw.is_pressed():
change_tops(load("res://sprites/raw_shirt.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/ZShirt.is_pressed():
change_tops(load("res://sprites/z_shirt.png"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/WhatsNewShirt.is_pressed():
change_tops(load("res://sprites/whatsnew_shirt.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Retro.is_pressed():
change_tops(load("res://sprites/retro_shirt.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/KormShirt.is_pressed():
change_tops(load("res://sprites/korm_shirt.png"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/BikerJacket.is_pressed():
change_tops(load("res://sprites/biker_jacket.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Atomic.is_pressed():
change_tops(load("res://sprites/atomic_shirt.svg"))
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/NLJacket.is_pressed():
change_tops(load("res://sprites/nl_jacket.png"))
# Remove clothes
# ===========================================================
if $Wordrobe/Accessoires/AccsScroll/AccsGrid/RemoveAccessory.is_pressed():
change_accessoires(null)
if $Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/RemoveShirt.is_pressed():
change_tops(null)
if $Wordrobe/Pants/PantsScroll/PantsGrid/RemovePants.is_pressed():
change_bottoms(null)

View file

@ -0,0 +1,14 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
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

16
project/src/ItemDrag.gd Normal file
View file

@ -0,0 +1,16 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends TextureButton
var item_pos = null
func _on_outfit_gui_input(ev):
if ev is InputEventMouseButton:
if ev.button_index == BUTTON_LEFT:
if ev.pressed:
item_pos = get_global_mouse_position() - rect_global_position
else:
item_pos = null
if ev is InputEventMouseMotion and item_pos != null:
rect_global_position = get_global_mouse_position() - item_pos

34
project/src/PauseScn.gd Normal file
View file

@ -0,0 +1,34 @@
# Anthony Wilcox licenses this file to you under the MPL 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:
UserSettings.IsMusicPaused = true
else:
UserSettings.IsMusicPaused = false
func _on_ResumeBtn_pressed():
$PauseWin.hide()
GameKit.is_game_paused(false)

42
project/src/Soundtrack.gd Normal file
View file

@ -0,0 +1,42 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends AudioStreamPlayer
var playlist = []
var tracks = detect_music()
func _ready():
play_random_song()
connect("finished", self, "play_random_song")
func detect_music():
var files = []
var dir = Directory.new()
var music_dir = "res://music/";
dir.open(music_dir)
dir.list_dir_begin()
while true:
var file = dir.get_next()
if file == "":
break
elif not file.begins_with(".") and file.get_extension() == "ogg":
files.append(music_dir + file)
dir.list_dir_end()
return files
func play_random_song():
if tracks.size() > 0:
playlist = tracks
var rand_song = randi() % playlist.size()
print_debug(playlist)
# var audiostream = load(playlist[rand_song])
# stream = audiostream
# play()
print_debug(playlist[rand_song])
else:
print_debug("Music not found")

21
project/src/TitleScn.gd Normal file
View file

@ -0,0 +1,21 @@
# Anthony Wilcox licenses this file to you under the MPL 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")

View file

@ -0,0 +1,9 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
var Tops: Texture
var Bottoms: Texture
var Underwear: Texture
var Accessory: Texture
var IsMusicPaused: bool