mirror of
https://github.com/tonytins/dressupzack
synced 2025-06-25 08:04:43 -04:00
Moved entire project to root
- Removed assets and publishing directories
This commit is contained in:
parent
4b37f6be3b
commit
8f6ab4592d
395 changed files with 0 additions and 823 deletions
15
scripts/Character.gd
Normal file
15
scripts/Character.gd
Normal 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
|
8
scripts/ClassicScn.gd
Normal file
8
scripts/ClassicScn.gd
Normal 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()
|
23
scripts/CreditsScn.gd
Normal file
23
scripts/CreditsScn.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Anthony Wilcox licenses this file to you under the MPL license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends Node2D
|
||||
|
||||
onready var undies = $Character/Undies
|
||||
onready var bottoms = $Character/Bottom
|
||||
onready var tops = $Character/Top
|
||||
onready var accesories = $Character/Accessory
|
||||
|
||||
func _process(delta):
|
||||
|
||||
if undies.texture != null:
|
||||
undies.texture = UserSettings.Underwear
|
||||
|
||||
if bottoms.texture != null:
|
||||
bottoms.texture = UserSettings.Bottoms
|
||||
|
||||
if tops.texture != null:
|
||||
tops.texture = UserSettings.Tops
|
||||
|
||||
if accesories.texture != null:
|
||||
accesories.texture = UserSettings.Accessory
|
||||
|
29
scripts/GameKit.gd
Normal file
29
scripts/GameKit.gd
Normal 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://scenes/ClassicScn.tscn")
|
||||
elif new_mode == "credits":
|
||||
get_tree().change_scene("res://scenes/CreditsScn.tscn")
|
||||
elif new_mode == "play":
|
||||
get_tree().change_scene("res://scenes/GameScn.tscn")
|
||||
elif new_mode == "title":
|
||||
get_tree().change_scene("res://scenes/TitleScn.tscn")
|
||||
|
||||
func if_file_exists(file):
|
||||
var fileCheck = File.new()
|
||||
var fileExists = fileCheck.file_exists(file)
|
||||
fileCheck
|
154
scripts/GameScn.gd
Normal file
154
scripts/GameScn.gd
Normal file
|
@ -0,0 +1,154 @@
|
|||
# Anthony Wilcox licenses this file to you under the MPL license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends Node2D
|
||||
|
||||
enum ClothingLayer {
|
||||
TOPS,
|
||||
BOTTOMS,
|
||||
UNDIES,
|
||||
ACCESSORY,
|
||||
}
|
||||
|
||||
# Default clothing
|
||||
onready var bottoms_placeholder = load("res://sprites/clothes/bottoms_placeholder.png")
|
||||
onready var tops_placeholder = load("res://sprites/clothes/tops_placeholder.png")
|
||||
onready var accessories_placeholder = load("res://sprites/clothes/tops_placeholder.png")
|
||||
|
||||
onready var bottoms = $Character/Bottom
|
||||
onready var tops = $Character/Top
|
||||
onready var accessory = $Character/Accessory
|
||||
|
||||
var UndiesBtn = load("res://scenes/Clothing.tscenes")
|
||||
#
|
||||
#func _init():
|
||||
# init_underwear()
|
||||
|
||||
func change_bottoms(new_bottom):
|
||||
bottoms_placeholder = new_bottom
|
||||
|
||||
if new_bottom == null:
|
||||
bottoms.texture = bottoms_placeholder
|
||||
UserSettings.Bottoms = bottoms_placeholder
|
||||
|
||||
# if undies == load("res://sprites/clothes/owo_censor.svg"):
|
||||
# change_undies(null)
|
||||
|
||||
bottoms.texture = bottoms_placeholder
|
||||
UserSettings.Bottoms = bottoms_placeholder
|
||||
|
||||
func change_undies(new_undies):
|
||||
$Character/Undies.texture = new_undies
|
||||
UserSettings.Underwear = new_undies
|
||||
|
||||
func change_tops(new_top):
|
||||
tops_placeholder = new_top
|
||||
|
||||
if new_top == null:
|
||||
tops.texture = tops_placeholder
|
||||
UserSettings.Tops = tops_placeholder
|
||||
|
||||
tops.texture = tops_placeholder
|
||||
UserSettings.Tops = tops_placeholder
|
||||
|
||||
func change_accessoires(new_accessory):
|
||||
accessories_placeholder = new_accessory
|
||||
|
||||
if new_accessory == null:
|
||||
accessory.texture = accessories_placeholder
|
||||
UserSettings.Accessory = accessories_placeholder
|
||||
|
||||
accessory.texture = accessories_placeholder
|
||||
UserSettings.Accessory = accessories_placeholder
|
||||
|
||||
#func init_underwear():
|
||||
# var undiesFile = File.new()
|
||||
# undiesFile.open("res://undies.json", undiesFile.READ)
|
||||
# var undiesJson = parse_json(undiesFile.get_as_text())
|
||||
#
|
||||
# for object in undiesJson:
|
||||
# var underwear = UndiesBtn.instance()
|
||||
#
|
||||
# underwear.texture = load(object.sprite)
|
||||
#
|
||||
|
||||
func _process(delta):
|
||||
|
||||
# Change clothes
|
||||
# ===========================================================
|
||||
|
||||
if $UI/Base/Wordrobe/Accessoires/AccsScroll/AccsGrid/CanonCam.is_pressed():
|
||||
change_accessoires(load("res://sprites/clothes/camera.png"))
|
||||
|
||||
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/Jeans.is_pressed():
|
||||
change_bottoms(load("res://sprites/clothes/jeans.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/Sweats.is_pressed():
|
||||
change_bottoms(load("res://sprites/clothes/sweat_pants.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/BlueSkirt.is_pressed():
|
||||
change_bottoms(load("res://sprites/clothes/blue_skirt.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/FormalSkirt.is_pressed():
|
||||
change_bottoms(load("res://sprites/clothes/formal_skirt.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/BeatUpJeans.is_pressed():
|
||||
change_bottoms(load("res://sprites/clothes/beat_up_jeans.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/Briefs.is_pressed():
|
||||
change_undies(load("res://sprites/clothes/briefs.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/ZBriefs.is_pressed():
|
||||
change_undies(load("res://sprites/clothes/z_briefs.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/Fundosi.is_pressed():
|
||||
change_undies(load("res://sprites/clothes/fundosi.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/OwOCensor.is_pressed():
|
||||
change_bottoms(null)
|
||||
change_undies(load("res://sprites/clothes/owo_censor.svg"))
|
||||
|
||||
|
||||
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/BlueCamoJeans.is_pressed():
|
||||
change_bottoms(load("res://sprites/clothes/blue_camo_jeans.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/TrainHoodie.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/train_hoodie.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Sweatshirt.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/old_sweatshirt.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Raw.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/raw_shirt.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/ZShirt.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/z_shirt.png"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/WhatsNewShirt.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/whatsnew_shirt.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Retro.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/retro_shirt.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/KormShirt.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/korm_shirt.png"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/BikerJacket.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/biker_jacket.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Atomic.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/atomic_shirt.svg"))
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/NLJacket.is_pressed():
|
||||
change_tops(load("res://sprites/clothes/nl_jacket.png"))
|
||||
|
||||
# Remove clothes
|
||||
# ===========================================================
|
||||
|
||||
if $UI/Base/Wordrobe/Accessoires/AccsScroll/AccsGrid/RemoveAccessory.is_pressed():
|
||||
change_accessoires(null)
|
||||
|
||||
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/RemoveShirt.is_pressed():
|
||||
change_tops(null)
|
||||
|
||||
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/RemovePants.is_pressed():
|
||||
change_bottoms(null)
|
14
scripts/ImportItems.gd
Normal file
14
scripts/ImportItems.gd
Normal 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
scripts/ItemDrag.gd
Normal file
16
scripts/ItemDrag.gd
Normal 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
scripts/PauseScn.gd
Normal file
34
scripts/PauseScn.gd
Normal 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
scripts/Soundtrack.gd
Normal file
42
scripts/Soundtrack.gd
Normal 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
scripts/TitleScn.gd
Normal file
21
scripts/TitleScn.gd
Normal 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 Control
|
||||
|
||||
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")
|
9
scripts/UserSettings.gd
Normal file
9
scripts/UserSettings.gd
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue