diff --git a/concept/screenshot3.png b/concept/screenshot3.png new file mode 100644 index 0000000..c6cd219 Binary files /dev/null and b/concept/screenshot3.png differ diff --git a/concept/screenshot3.png.import b/concept/screenshot3.png.import new file mode 100644 index 0000000..eba2320 --- /dev/null +++ b/concept/screenshot3.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/screenshot3.png-7d2d1acfed1b1c62593af346ac061169.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://concept/screenshot3.png" +dest_files=[ "res://.import/screenshot3.png-7d2d1acfed1b1c62593af346ac061169.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/data/events.csv b/data/events.csv index ca61234..255ab8b 100644 --- a/data/events.csv +++ b/data/events.csv @@ -1,5 +1,5 @@ Event_Title;Event_Description;Relevant_Quality;Event_Duration;Cost_Per_Day -The Spirited Public Viewing Entertainer;Be the spirited highlight at our public viewing! Delight the audience with your spontaneous and fun-loving style to maintain the atmosphere and entertain the spectators.;Improvisation;5;25 +The Spirit Public Viewing;Be the highlight at our public viewing! Delight the audience with your spontaneous style to maintain the atmosphere and entertain the spectators.;Improvisation;5;25 VIP Attendant and Event Ambassador;You are the face of our event for VIPs. Be punctual, friendly, and ensure that our guests feel appreciated.;Reliability;3;20 Children's Darling and Enchanter;Enchant our youngest visitors with your charm and playful interaction. Make children laugh and give them unforgettable moments.;Charisma;4;22 Street Parade Star and Master of Spontaneity;Be a star in our lively street parade! With your improvisational skills, captivate the crowd and create exhilarating entertainment.;Improvisation;6;18 @@ -105,8 +105,8 @@ Smiling Balloon Release Event;Spread smiles at the Smiling Balloon Release Event Butterfly Garden Yoga Retreat;Find inner joy at the Butterfly Garden Yoga Retreat, where your charisma will create a serene and uplifting yoga experience amidst fluttering butterflies.;Charisma;5;22 Beaming Sunflower Bouquet Delivery;Delight recipients with a Beaming Sunflower Bouquet Delivery, where your charisma will bring happiness through the gift of vibrant sunflowers.;Charisma;3;19 Happy Feet Dance Class;Take part in the Happy Feet Dance Class, using your charisma to encourage joyful dancing and light-hearted fun with fellow participants.;Charisma;4;21 -Delightful Cupcake Decorating Workshop;Showcase your creativity and improvisation in the Delightful Cupcake Decorating Workshop, where you'll create joyful and delicious treats.;Improvisation;2;16 -Happy Retirement Celebration;Throw a Happy Retirement Celebration, showcasing your reliability in organizing a heartwarming event to honor someone's joyful transition to retirement.;Reliability;5;23 +Cupcake Decorating Workshop;Showcase your creativity and improvisation in the Delightful Cupcake Decorating Workshop, where you'll create joyful and delicious treats.;Improvisation;2;16 +Happy Retirement Celebration;Throw a Happy Retirement Celebration, showcasing your reliability in organizing a heartwarming event to honor someone's retirement.;Reliability;5;23 Playful Dolphin Water Park;Embark on a Playful Dolphin Water Park adventure, where your charisma will create delightful and interactive experiences with playful dolphins.;Charisma;4;20 Smiling Children's Puppet Show;Bring smiles to children at the Smiling Children's Puppet Show, entertaining them with cheerful and funny puppet performances using your charisma.;Charisma;3;18 Sunny Beach Volleyball Tournament;Compete in the Sunny Beach Volleyball Tournament, using your improvisation and teamwork to spread happiness through friendly competition.;Improvisation;4;20 @@ -172,7 +172,7 @@ Crazy Comedian Roast Night;Take the stage at the Crazy Comedian Roast Night, usi Whacky Pie Eating Contest;Compete in the Whacky Pie Eating Contest, using your improvisation and hearty appetite to devour pies in the silliest manner possible.;Improvisation;5;23 Amusing Clown Bowling Tournament;Join the Amusing Clown Bowling Tournament, where your charisma will entertain the crowd with funny and unusual bowling techniques.;Charisma;3;19 Funny Face Swap Booth;Run a Funny Face Swap Booth, using your creativity and charisma to create hilarious face swaps for visitors using special effects.;Charisma;4;22 -Silly Rubber Chicken Olympics;Participate in the Silly Rubber Chicken Olympics, where your reliability and precision will be tested in a series of wacky and entertaining challenges.;Reliability;2;16 +Silly Rubber Chicken Olympics;Participate in the Silly Rubber Chicken Olympics, where your reliability will be tested in a series of wacky and entertaining challenges.;Reliability;2;16 Comical Improv Theatre Workshop;Attend the Comical Improv Theatre Workshop, where your improvisation and comedic timing will be honed through humorous theater exercises.;Improvisation;3;18 Silly Banana Peel Slippery Slope;Slide down the Silly Banana Peel Slippery Slope, where your improvisation will come in handy to navigate the hilariously slippery slope.;Improvisation;4;20 Crazy Karaoke Lip Sync Battle;Compete in the Crazy Karaoke Lip Sync Battle, using your charisma and hilarious lip-syncing skills to entertain the audience.;Charisma;5;23 diff --git a/gfx/mascots.png b/gfx/mascots.png index f5eedd1..b2682fe 100644 Binary files a/gfx/mascots.png and b/gfx/mascots.png differ diff --git a/scenes/Benefits.tscn b/scenes/Benefits.tscn index 989f617..e7bfa1d 100644 --- a/scenes/Benefits.tscn +++ b/scenes/Benefits.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://gfx/theme.tres" type="Theme" id=1] [ext_resource path="res://fonts/mascot-management.ttf" type="DynamicFontData" id=2] @@ -10,6 +10,7 @@ [ext_resource path="res://sfx/gym.mp3" type="AudioStream" id=8] [ext_resource path="res://sfx/freshfruits.mp3" type="AudioStream" id=9] [ext_resource path="res://sfx/teambuilding.mp3" type="AudioStream" id=10] +[ext_resource path="res://gfx/progressbar_fg.png" type="Texture" id=11] [sub_resource type="StyleBoxFlat" id=3] bg_color = Color( 0.603922, 0.560784, 0.878431, 1 ) @@ -67,11 +68,23 @@ icon = ExtResource( 6 ) align = 0 script = ExtResource( 4 ) price = 100 -tooltip = "Start a party for your mascots. It will keep your mascots for more days." +tooltip = "Start a party for your mascots. It will stay your mascots for more days in your company." days = 1 type = "celebration" audio = ExtResource( 7 ) +[node name="Progess" type="TextureProgress" parent="Buttons/Celebration"] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -71.0 +margin_top = 13.0 +margin_right = 71.0 +margin_bottom = 14.0 +max_value = 1.0 +step = 0.01 +texture_progress = ExtResource( 11 ) +nine_patch_stretch = true + [node name="TeamBuilding" type="Button" parent="Buttons"] margin_left = 9.0 margin_top = 45.0 @@ -86,11 +99,23 @@ icon = ExtResource( 6 ) align = 0 script = ExtResource( 4 ) price = 200 -tooltip = "Shape your team into a strong unit. It will increase the reliabilty and keeps your mascots in company." +tooltip = "Shape your team into a strong unit. It will decrease permanent the risk for leaving and let stay the mascots for some days in your company." days = 1 type = "teambuilding" audio = ExtResource( 10 ) +[node name="Progess" type="TextureProgress" parent="Buttons/TeamBuilding"] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -71.0 +margin_top = 13.0 +margin_right = 71.0 +margin_bottom = 14.0 +max_value = 1.0 +step = 0.01 +texture_progress = ExtResource( 11 ) +nine_patch_stretch = true + [node name="FreshFruits" type="Button" parent="Buttons"] margin_left = 9.0 margin_top = 68.0 @@ -110,6 +135,18 @@ days = 5 type = "fruits" audio = ExtResource( 9 ) +[node name="Progess" type="TextureProgress" parent="Buttons/FreshFruits"] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -71.0 +margin_top = 13.0 +margin_right = 71.0 +margin_bottom = 14.0 +max_value = 1.0 +step = 0.01 +texture_progress = ExtResource( 11 ) +nine_patch_stretch = true + [node name="SportCourses" type="Button" parent="Buttons"] margin_left = 9.0 margin_top = 85.0 @@ -129,6 +166,18 @@ days = 10 type = "gym" audio = ExtResource( 8 ) +[node name="Progess" type="TextureProgress" parent="Buttons/SportCourses"] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -71.0 +margin_top = 13.0 +margin_right = 71.0 +margin_bottom = 14.0 +max_value = 1.0 +step = 0.01 +texture_progress = ExtResource( 11 ) +nine_patch_stretch = true + [node name="InfoPanel" type="MarginContainer" parent="."] margin_left = 159.0 margin_top = 28.0 diff --git a/scenes/Event.tscn b/scenes/Event.tscn index b9c6e5e..239d07a 100644 --- a/scenes/Event.tscn +++ b/scenes/Event.tscn @@ -43,18 +43,6 @@ rect_min_size = Vector2( 130, 0 ) [node name="spacer_top" type="Control" parent="VBoxContainer"] margin_right = 148.0 -[node name="state_label" type="Label" parent="VBoxContainer"] -visible = false -margin_top = 4.0 -margin_right = 148.0 -margin_bottom = 11.0 -rect_min_size = Vector2( 40, 0 ) -theme = SubResource( 2 ) -custom_colors/font_color = Color( 0.811765, 0.364706, 0.545098, 1 ) -text = "ACTIVE" -align = 1 -clip_text = true - [node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"] margin_top = 4.0 margin_right = 148.0 @@ -146,6 +134,22 @@ custom_fonts/font = SubResource( 11 ) text = "ACCEPT" icon_align = 1 +[node name="state_label" type="Label" parent="VBoxContainer/HBoxContainer"] +visible = false +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -74.0 +margin_top = -158.0 +margin_right = 74.0 +margin_bottom = -151.0 +rect_min_size = Vector2( 40, 0 ) +theme = SubResource( 2 ) +custom_colors/font_color = Color( 0.811765, 0.364706, 0.545098, 1 ) +custom_colors/font_color_shadow = Color( 1, 1, 1, 1 ) +text = "ACTIVE" +align = 2 +clip_text = true + [node name="spacer_bot2" type="Control" parent="VBoxContainer"] margin_top = 172.0 margin_right = 148.0 diff --git a/scenes/MainScene.tscn b/scenes/MainScene.tscn index 443b06a..6fe9f98 100644 --- a/scenes/MainScene.tscn +++ b/scenes/MainScene.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=20 format=2] +[gd_scene load_steps=21 format=2] [ext_resource path="res://scenes/Desk.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/Benefits.tscn" type="PackedScene" id=2] @@ -20,6 +20,10 @@ [ext_resource path="res://sfx/applause.mp3" type="AudioStream" id=35] [ext_resource path="res://gfx/sound_disabled_btn.png" type="Texture" id=36] +[sub_resource type="Gradient" id=1] +offsets = PoolRealArray( 0, 0.223762, 0.386139, 0.566337, 0.978218 ) +colors = PoolColorArray( 1, 0, 0.878906, 1, 0, 1, 0.214844, 1, 0.804972, 0.713656, 0.0125389, 1, 0.935547, 0.0965463, 0.715965, 1, 0.728516, 0, 1, 1 ) + [node name="MainScene" type="Node2D"] script = ExtResource( 3 ) __meta__ = { @@ -36,7 +40,7 @@ volume_db = -4.712 [node name="IntroPlayer" type="AudioStreamPlayer" parent="."] stream = ExtResource( 28 ) -volume_db = 4.0 +volume_db = -5.0 [node name="Bg" type="ColorRect" parent="."] anchor_right = 1.0 @@ -102,6 +106,23 @@ icon_align = 1 [node name="Gameover" parent="." instance=ExtResource( 21 )] visible = false +[node name="WonParticles" type="CPUParticles2D" parent="."] +position = Vector2( 123, 157 ) +emitting = false +amount = 600 +lifetime = 4.0 +explosiveness = 0.46 +randomness = 1.0 +emission_shape = 2 +emission_rect_extents = Vector2( 140, 1 ) +direction = Vector2( -1, 0 ) +spread = 79.95 +initial_velocity = 200.0 +initial_velocity_random = 0.35 +scale_amount = 2.0 +color_ramp = SubResource( 1 ) +hue_variation_random = 1.0 + [node name="Alert" parent="." instance=ExtResource( 26 )] visible = false anchor_left = 0.5 diff --git a/scenes/MascotDetails.tscn b/scenes/MascotDetails.tscn index 068c00f..ac29704 100644 --- a/scenes/MascotDetails.tscn +++ b/scenes/MascotDetails.tscn @@ -70,9 +70,9 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -37.5 +margin_left = -42.5 margin_top = -63.5 -margin_right = 53.5 +margin_right = 48.5 margin_bottom = -52.5 theme = ExtResource( 1 ) custom_colors/font_color = Color( 0.388235, 0.364706, 0.588235, 1 ) @@ -84,9 +84,9 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -37.5 +margin_left = -42.5 margin_top = -63.5 -margin_right = 53.5 +margin_right = 102.5 margin_bottom = -52.5 theme = ExtResource( 1 ) custom_colors/font_color = Color( 0.388235, 0.364706, 0.588235, 1 ) @@ -123,7 +123,7 @@ margin_bottom = 66.0 theme = ExtResource( 1 ) custom_colors/font_color = Color( 0.388235, 0.364706, 0.588235, 1 ) custom_fonts/font = SubResource( 2 ) -text = "Your mascot is not feeling well and unfortunately cannot work. It now needs a few days to get better. Cancelled orders will unfortunately lower customer satisfaction. Pay attention to the reliability of your employees to counteract illness." +text = "Your mascot is not feeling well and unfortunately cannot work. It now needs a few days to get better. Cancelled orders will lower customer satisfaction. Pay attention to the reliability of your employees to counteract illness." autowrap = true [node name="Train" type="Button" parent="."] diff --git a/scenes/Menu.tscn b/scenes/Menu.tscn index d5e1fba..9c433b0 100644 --- a/scenes/Menu.tscn +++ b/scenes/Menu.tscn @@ -334,7 +334,6 @@ position = Vector2( 121, 62 ) scale = Vector2( 3, 3 ) frames = SubResource( 16 ) animation = "walk" -frame = 1 speed_scale = 1.25 playing = true diff --git a/scenes/Polaroid.tscn b/scenes/Polaroid.tscn index e9eeb01..0fe4c13 100644 --- a/scenes/Polaroid.tscn +++ b/scenes/Polaroid.tscn @@ -123,9 +123,9 @@ position = Vector2( 49, 49 ) scale = Vector2( 2, 2 ) texture = ExtResource( 2 ) centered = false -hframes = 8 +hframes = 9 vframes = 5 -frame = 39 +frame = 44 [node name="AnimationPlayer" type="AnimationPlayer" parent="pic"] playback_speed = 2.05 @@ -237,7 +237,6 @@ margin_top = 3.0 margin_right = 58.0 margin_bottom = 11.0 mouse_filter = 1 -mouse_default_cursor_shape = 2 theme = SubResource( 2 ) custom_colors/font_color = Color( 0.388235, 0.364706, 0.588235, 1 ) text = "at work" @@ -248,7 +247,6 @@ margin_top = 11.0 margin_right = 36.0 margin_bottom = 18.0 mouse_filter = 1 -mouse_default_cursor_shape = 2 theme = SubResource( 2 ) custom_colors/font_color = Color( 0.388235, 0.364706, 0.588235, 1 ) text = "done jobs: " @@ -259,16 +257,24 @@ margin_top = 19.0 margin_right = 26.0 margin_bottom = 27.0 mouse_filter = 1 -mouse_default_cursor_shape = 2 theme = SubResource( 2 ) custom_colors/font_color = Color( 0.388235, 0.364706, 0.588235, 1 ) text = "salary:" +[node name="bg2" type="ColorRect" parent="Info"] +margin_left = 2.0 +margin_top = -20.0 +margin_right = 51.0 +margin_bottom = -16.0 +mouse_filter = 1 +mouse_default_cursor_shape = 2 +color = Color( 0.603922, 0.560784, 0.878431, 1 ) + [node name="ClientSatisfaction" type="TextureProgress" parent="Info"] anchor_left = 0.5 anchor_right = 0.5 margin_left = -25.0 -margin_top = -20.0 +margin_top = -19.0 margin_right = 22.0 margin_bottom = -17.0 max_value = 1.0 @@ -283,5 +289,21 @@ rect_min_size = Vector2( 65, 74 ) mouse_filter = 1 mouse_default_cursor_shape = 2 +[node name="salaryChanged" type="Label" parent="."] +visible = false +margin_left = 12.0 +margin_top = 60.0 +margin_right = 55.0 +margin_bottom = 68.0 +mouse_filter = 1 +mouse_default_cursor_shape = 2 +theme = SubResource( 2 ) +custom_colors/font_color = Color( 0.811765, 0.364706, 0.545098, 1 ) +text = "500$" +align = 2 +__meta__ = { +"_edit_lock_": true +} + [connection signal="mouse_entered" from="HoverArea" to="." method="onEntered"] [connection signal="mouse_exited" from="HoverArea" to="." method="onExited"] diff --git a/scripts/BenefitButton.gd b/scripts/BenefitButton.gd index d88ece6..5d65079 100644 --- a/scripts/BenefitButton.gd +++ b/scripts/BenefitButton.gd @@ -26,6 +26,9 @@ func updateUI(): if !model: return disabled = model.balance <= price or is_active() + + $Progess.visible = working_day != 0 + $Progess.value = 1.0 - (working_day / days as float) func onDayOver(): if is_active(): diff --git a/scripts/Benefits.gd b/scripts/Benefits.gd index f266d14..5e68807 100644 --- a/scripts/Benefits.gd +++ b/scripts/Benefits.gd @@ -10,7 +10,11 @@ func onOpen(): node.connect("clicked", self, "onBenefitClicked") node.connect("over", self, "onBenefitIsOver") node.model = model - + +func reset(): + for node in $Buttons.get_children(): + node.working_day = 0 + func _process(_delta): updateUI() diff --git a/scripts/EventScene.gd b/scripts/EventScene.gd index 699528a..d901707 100644 --- a/scripts/EventScene.gd +++ b/scripts/EventScene.gd @@ -11,7 +11,7 @@ func _ready(): find_node("title").text = event.title find_node("description").text = event.description - find_node("costs").text = str(event.costs, "/DAY") + find_node("costs").text = str(event.costs, "$/d") find_node("duration").text = str(event.duration, " DAYS") func onAccept(): diff --git a/scripts/GameModel.gd b/scripts/GameModel.gd index 8f504a0..6f8b3c0 100644 --- a/scripts/GameModel.gd +++ b/scripts/GameModel.gd @@ -22,14 +22,6 @@ func _init(dayTimer:Timer): createRandomEvents(10) increaseApplicantsPool(3) -func loadSavegame(resource:SaveGame): - balance = resource.balance - passedDays = resource.passedDays - dayDurationInSeconds = resource.dayDurationInSeconds - employees = resource.employees - openEvents = resource.openEvents - applicants = resource.applicants - func _reset(): balance = 100 passedDays = 0 diff --git a/scripts/Inventory.gd b/scripts/Inventory.gd index 659e557..f0c90fc 100644 --- a/scripts/Inventory.gd +++ b/scripts/Inventory.gd @@ -9,16 +9,23 @@ func onOpen(): onClose() updateUI() model.connect("employee_gone", self, "updateEmployeeView") + model.connect("day_passed", self, "uploadPolaroids") func onClose(): + model.disconnect("day_passed", self, "uploadPolaroids") model.disconnect("employee_gone", self, "updateEmployeeView") for polaroid in $HScroller.getItems(): + $HScroller.removeItem(polaroid) polaroid.disconnect("select", self, "onSelect") polaroid.queue_free() - $HScroller.removeItem(polaroid) -func updateEmployeeView(): +func uploadPolaroids(): + for polaroid in $HScroller.getItems(): + polaroid.playBalanceChanged(polaroid.mascot.getBalance()) + +func updateEmployeeView(mascot:Mascot): + print("!") onClose() updateUI() diff --git a/scripts/MainScene.gd b/scripts/MainScene.gd index f18a1e0..8539e73 100644 --- a/scripts/MainScene.gd +++ b/scripts/MainScene.gd @@ -43,17 +43,19 @@ func _ready(): func introFinished(): if !$"/root/Music".isSilent(): - $"/root/Music".dimmMusicTo(-10.0) + $"/root/Music".dimmMusicTo(-15.0) func onTryAgain(): model._reset() dayTimer.stop() $Areas/JobApplication.reset() + $Areas/Benefits.reset() onOpenJobApplication() func onDayPassed(): $DayoverPlayer.play() + $WonParticles.emitting = false model.onDayIsOver() $Desk.onDayPassed() $Areas/JobApplication.updateUI() @@ -68,9 +70,8 @@ func onDayPassed(): $Alert.showMessage("All clients love you. Keep your business as long as possible") if model.daysInFullSatisfaction == 11: - $ApplausePlayer.play() - $Alert.showMessage("Your company is loved for 10 days. You won the game!") - + onWon() + func _process(_delta): $Desk/Appbar/ClientSatisfaction/Background/Progess.value = model.getClientSatisfaction() $Desk/Appbar/Day/Background/Progess.value = model.getDayProgress() @@ -90,6 +91,12 @@ func onEmployeeIsInSabbat(mascot:Mascot): $Alert.showError(mascot.nickname + " is without salary in sabbat for " + str(mascot.currentEvent.duration) + " days.") $Areas/MascotDetails.updateUI() +func onWon(): + $WonParticles.emitting = true + $ApplausePlayer.play() + $Alert.showMessage("Your company is loved for 10 days. You won the game!", 10) + + func onOpenStatistics(): if activeButton == $Desk/BenefitsBtn: return @@ -146,3 +153,4 @@ func onMascotFire(): func onToggleMusic(): $"/root/Music".toggleMusic() + $IntroPlayer.volume_db = -100 diff --git a/scripts/Mascot.gd b/scripts/Mascot.gd index fd708aa..781b385 100644 --- a/scripts/Mascot.gd +++ b/scripts/Mascot.gd @@ -3,7 +3,7 @@ class_name Mascot signal eventDone(event) var RandomNames = load("res://scripts/random_names.gd").new() -var spriteIndex = randi() % 40 +var spriteIndex = randi() % 44 export var nickname:String = RandomNames.get_first_name() diff --git a/scripts/MascotDetails.gd b/scripts/MascotDetails.gd index 9e8e765..1ed60b5 100644 --- a/scripts/MascotDetails.gd +++ b/scripts/MascotDetails.gd @@ -87,7 +87,7 @@ func reloadEvents(): var eventScene = addEventScene(event) eventScene.find_node("AcceptBtn").visible = false eventScene.find_node("state_label").visible = true - eventScene.find_node("state_label").text = "TODO #" + str(c) + eventScene.find_node("state_label").text = "NEXT #" + str(c) c+=1 for event in model.openEvents: diff --git a/scripts/Menu.gd b/scripts/Menu.gd index 149e900..49ed160 100644 --- a/scripts/Menu.gd +++ b/scripts/Menu.gd @@ -1,6 +1,10 @@ extends Node2D -export var target_volume:=-10.0 +export var target_volume:=-25.0 + +var slientDB = -100 +var steps = 0 + func _ready(): Input.set_custom_mouse_cursor(load("res://gfx/hand.png"), Input.CURSOR_POINTING_HAND) @@ -17,16 +21,16 @@ func switchScene(animationName): func _process(_delta): var node = $Music if node.volume_db > target_volume: - node.volume_db = max($Music.volume_db-2, target_volume) + node.volume_db = max(node.volume_db-2, target_volume) else: - node.volume_db = min($Music.volume_db+2, target_volume) + node.volume_db = min(node.volume_db+2, target_volume) func dimmMusicTo(volume_db:float): target_volume = volume_db func toggleMusic(): - if target_volume == -100: target_volume = -10.0 - else: target_volume = -100 + if target_volume == slientDB: target_volume = -15.0 + else: target_volume = slientDB func isSilent() -> bool: - return $Music.volume_db == -100 + return $Music.volume_db == slientDB diff --git a/scripts/Polaroid.gd b/scripts/Polaroid.gd index bcf3d8d..3464e40 100644 --- a/scripts/Polaroid.gd +++ b/scripts/Polaroid.gd @@ -29,6 +29,30 @@ func _ready(): $StatsPanel/Charisma.value = mascot.charisma $StatsPanel/Reliable.value = mascot.reliable +func playBalanceChanged(value): + var label = $salaryChanged + label.text = str(value) + "$ " + label.visible = true + label.rect_position = Vector2(12, 60) + + var tween := create_tween() \ + .set_trans(Tween.TRANS_CUBIC) \ + .set_ease(Tween.EASE_OUT) \ + .set_parallel() + + var targetPosition + + if sign(value) == -1: + label.add_color_override("font_color", Color("cf5d8b")) + targetPosition = Vector2(label.rect_position.x, label.rect_position.y + 20) + + elif sign(value) == 1: + label.add_color_override("font_color", Color("b0d07e")) + targetPosition = Vector2(label.rect_position.x, label.rect_position.y - 30) + + tween.tween_property(label, "visible", false, 1) + tween.tween_property(label, "rect_position", targetPosition, 1) + func _process(_delta): if clickable and isOver: mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND else: mouse_default_cursor_shape = Control.CURSOR_ARROW @@ -70,12 +94,14 @@ func _process(_delta): elif mascot.in_training: $Info/state.text = "in training" $Info/state.set("custom_colors/font_color", Color("66aa5d")) + elif mascot.isInEvent(): if mascot.currentEvent.isSabbat(): $Info/state.text = "in sabbat" else: $Info/state.text = "at work" - $Info/state.set("custom_colors/font_color", Color("66aa5d")) + if isOver: $Info/state.set("custom_colors/font_color", Color("635d96")) + else: $Info/state.set("custom_colors/font_color", Color("66aa5d")) else: $Info/state.text = "is bored" $Info/state.set("custom_colors/font_color", Color("635d96"))