Implementing scene sequencing for game
This commit is contained in:
parent
02a89aa068
commit
822336ab56
4 changed files with 24 additions and 9 deletions
|
|
@ -95,7 +95,12 @@ func destroy_painting():
|
||||||
DisplayServer.tts_speak("Oh nooooooo! Took too long!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
DisplayServer.tts_speak("Oh nooooooo! Took too long!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
||||||
DisplayServer.tts_speak("Try to make it up on the next painting!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
DisplayServer.tts_speak("Try to make it up on the next painting!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
||||||
desk.numpad.reminder_timer.stop()
|
desk.numpad.reminder_timer.stop()
|
||||||
next_painting(current_painting)
|
if current_painting <= paintings_total - 1:
|
||||||
|
next_painting((current_painting))
|
||||||
|
print("The next painting is valued at $" + str(starting_price) + " (should be $" + str(paintings[current_painting]) + ")")
|
||||||
|
(print(str(state)))
|
||||||
|
else:
|
||||||
|
end_auction()
|
||||||
|
|
||||||
func sell_painting():
|
func sell_painting():
|
||||||
total_sales = total_sales + current_bid
|
total_sales = total_sales + current_bid
|
||||||
|
|
@ -116,9 +121,11 @@ func end_auction():
|
||||||
if total_sales >= target_sales:
|
if total_sales >= target_sales:
|
||||||
#add context specific score text?
|
#add context specific score text?
|
||||||
DisplayServer.tts_speak("Congratulations! The auction house will run another day.", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
DisplayServer.tts_speak("Congratulations! The auction house will run another day.", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
||||||
|
emit_signal("won")
|
||||||
else:
|
else:
|
||||||
#add context specific score text?
|
#add context specific score text?
|
||||||
DisplayServer.tts_speak("You have failed. We must find a new auctioneer.", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
DisplayServer.tts_speak("You have failed. We must find a new auctioneer.", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch)
|
||||||
|
emit_signal("lost")
|
||||||
|
|
||||||
# OTHER THINGS TO ADD:
|
# OTHER THINGS TO ADD:
|
||||||
# UI elements for score
|
# UI elements for score
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,12 @@ extends Node2D
|
||||||
signal restart_game
|
signal restart_game
|
||||||
|
|
||||||
var input_received = false
|
var input_received = false
|
||||||
|
var timer_elapsed = false
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
win()
|
win()
|
||||||
|
await $Timer.timeout
|
||||||
|
timer_elapsed = true
|
||||||
|
|
||||||
func win():
|
func win():
|
||||||
$MorshoReactManager/MorshoHappy.visible = true
|
$MorshoReactManager/MorshoHappy.visible = true
|
||||||
|
|
@ -20,9 +23,10 @@ func lose():
|
||||||
%WinLossAudioPlayer.play()
|
%WinLossAudioPlayer.play()
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if input_received:
|
if timer_elapsed == true:
|
||||||
return
|
if input_received:
|
||||||
|
return
|
||||||
|
|
||||||
if event is InputEventKey or event is InputEventMouseButton:
|
if event is InputEventKey or event is InputEventMouseButton:
|
||||||
input_received = true
|
input_received = true
|
||||||
emit_signal("restart_game")
|
emit_signal("restart_game")
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
[ext_resource type="Script" uid="uid://cp71ivjeuuaaf" path="res://score_screen.gd" id="1_cyy7t"]
|
[ext_resource type="Script" uid="uid://cp71ivjeuuaaf" path="res://score_screen.gd" id="1_cyy7t"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cabsfveh1oc6i" path="res://assets/menus/final score/morshu-happy-large.png" id="1_juxjb"]
|
[ext_resource type="Texture2D" uid="uid://cabsfveh1oc6i" path="res://assets/menus/final score/morshu-happy-large.png" id="1_juxjb"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d24dlalqmr6r0" path="res://assets/menus/final score/morshu-anger-large.png" id="2_3r2db"]
|
[ext_resource type="Texture2D" uid="uid://d24dlalqmr6r0" path="res://assets/menus/final score/morshu-anger-large.png" id="2_3r2db"]
|
||||||
[ext_resource type="Script" path="res://hotline_miami.gd" id="4_joumd"]
|
[ext_resource type="Script" uid="uid://bmn6cds78753q" path="res://hotline_miami.gd" id="4_joumd"]
|
||||||
|
|
||||||
[node name="ScoreScreen" type="Node2D"]
|
[node name="ScoreScreen" type="Node2D"]
|
||||||
script = ExtResource("1_cyy7t")
|
script = ExtResource("1_cyy7t")
|
||||||
|
|
@ -35,7 +35,7 @@ offset_right = 545.0
|
||||||
offset_bottom = 175.0
|
offset_bottom = 175.0
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
theme = ExtResource("1_3r2db")
|
theme = ExtResource("1_3r2db")
|
||||||
text = "placeholder"
|
text = "Press any key to restart"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
vertical_alignment = 1
|
vertical_alignment = 1
|
||||||
|
|
||||||
|
|
@ -56,3 +56,8 @@ texture = ExtResource("2_3r2db")
|
||||||
|
|
||||||
[node name="WinLossAudioPlayer" type="AudioStreamPlayer" parent="."]
|
[node name="WinLossAudioPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="."]
|
||||||
|
wait_time = 3.0
|
||||||
|
one_shot = true
|
||||||
|
autostart = true
|
||||||
|
|
|
||||||
|
|
@ -43,4 +43,3 @@ func _handle_reminder_timer_timeout() -> void:
|
||||||
if game_manager.state == game_manager.bidding_state.ASKING or game_manager.state == game_manager.bidding_state.BID:
|
if game_manager.state == game_manager.bidding_state.ASKING or game_manager.state == game_manager.bidding_state.BID:
|
||||||
game_manager.state = game_manager.bidding_state.CLOSED
|
game_manager.state = game_manager.bidding_state.CLOSED
|
||||||
game_manager.destroy_painting()
|
game_manager.destroy_painting()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue