mirror of
https://github.com/tonytins/dressupzack
synced 2025-08-14 12:44:44 -04:00
Change clothes with if statements
Migrating over changing clothes from bindings over to if statements using is_pressed(). This should make it a lot more easier to maintaing because the bindings started to feel like overkill and cluttered up the code when they were only tasked to do one thing. - DJ shorts has been redone - Camera was renamed to CanonCam - Renamed ModernScn to GameScn - Removed RefRect
This commit is contained in:
parent
2ac38db54d
commit
023f6ec90e
9 changed files with 269 additions and 90 deletions
|
@ -10,6 +10,20 @@ onready var accessory = load("res://sprites/tops_placeholder.png")
|
|||
# Underwear cam be suggestive but never lewd.
|
||||
onready var undies = load("res://sprites/briefs.svg")
|
||||
|
||||
func _process(delta):
|
||||
|
||||
if $Wordrobe/Accessoires/AccessoiresGrid/CanonCam.is_pressed() == true:
|
||||
change_accessoires(load("res://sprites/camera.png"))
|
||||
|
||||
if $Wordrobe/Pants/PantsGrid/Jeans.is_pressed() == true:
|
||||
change_bottoms(load("res://sprites/jeans.svg"))
|
||||
|
||||
if $Wordrobe/Pants/PantsGrid/Sweats.is_pressed() == true:
|
||||
change_bottoms(load("res://sprites/sweat_pants.svg"))
|
||||
|
||||
if $Wordrobe/Pants/PantsGrid/DJShorts.is_pressed() == true:
|
||||
change_bottoms(load("res://sprites/dj_shorts.svg"))
|
||||
|
||||
func change_bottoms(new_bottom):
|
||||
bottoms = new_bottom
|
||||
|
||||
|
@ -51,10 +65,10 @@ func _on_Remove_Accessory_pressed():
|
|||
change_accessoires(null)
|
||||
|
||||
func _on_DJ_Shorts_pressed():
|
||||
change_bottoms(load("res://sprites/dj_shorts.png"))
|
||||
change_bottoms(load("res://sprites/dj_shorts.svg"))
|
||||
|
||||
func _on_ZBriefs_pressed():
|
||||
change_undies(load("res://sprites/z_briefs.png"))
|
||||
change_undies(load("res://sprites/z_briefs.svg"))
|
||||
|
||||
func _on_Briefs_pressed():
|
||||
change_undies(load("res://sprites/briefs.svg"))
|
||||
|
|
|
@ -12,6 +12,6 @@ func switch_scenes(new_mode):
|
|||
if new_mode == "classic":
|
||||
get_tree().change_scene("res://scn/ClassicScn.tscn")
|
||||
elif new_mode == "modern":
|
||||
get_tree().change_scene("res://scn/ModernScn.tscn")
|
||||
get_tree().change_scene("res://scn/GameScn.tscn")
|
||||
elif new_mode == "title":
|
||||
get_tree().change_scene("res://scn/TitleScn.tscn")
|
|
@ -5,7 +5,7 @@ const tracks = [
|
|||
'together_again',
|
||||
'at_the_lake',
|
||||
]
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
|
||||
func _ready():
|
||||
connect("finished", self, "play_random_song")
|
||||
play_random_song()
|
||||
|
@ -15,8 +15,5 @@ func play_random_song():
|
|||
|
||||
var rand_db = randi() % tracks.size()
|
||||
var audiostream = load('res://music/' + tracks[rand_db] + '.ogg')
|
||||
set_stream(audiostream)
|
||||
play()
|
||||
|
||||
|
||||
|
||||
stream = audiostream
|
||||
play()
|
Loading…
Add table
Add a link
Reference in a new issue