diff options
Diffstat (limited to 'scenes')
-rw-r--r-- | scenes/main.gd | 21 | ||||
-rw-r--r-- | scenes/main.tscn | 1 | ||||
-rw-r--r-- | scenes/microgames/fishin/fishin.gd | 3 | ||||
-rw-r--r-- | scenes/score_window/score_window.gd | 7 |
4 files changed, 29 insertions, 3 deletions
diff --git a/scenes/main.gd b/scenes/main.gd index 7ab90d5..c249270 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -38,8 +38,27 @@ func _on_microgame_win(window: MicrogameWindow): func _on_fishin_win() -> void: - $Fishin.visible = false + $Fishin.queue_free() $"Stock ticker".start() $"Microgame spawn timer".start() $Clippette.visible = true $"Score window (real)".visible = true + + +func _on_score_window_donezo() -> void: + for child in get_children(): + if child is Window: + child.queue_free() + $"Microgame spawn timer".stop() + $"Stock ticker".queue_free() + get_window().position = Vector2i(10000, 10000) + + var new_window = Window.new() + new_window.size = Vector2i(1280, 720) + new_window.initial_position = Window.WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_MOUSE_FOCUS + new_window.unresizable = true + new_window.borderless = true + var gameover_scene = preload("res://scenes/gameover.tscn") + var gameover_scene_instance = gameover_scene.instantiate() + new_window.add_child(gameover_scene_instance) + add_child(new_window) diff --git a/scenes/main.tscn b/scenes/main.tscn index 04ad445..1c105ff 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -339,6 +339,7 @@ $00000000000000000000" position = Vector2(0, 0) [connection signal="timeout" from="Microgame spawn timer" to="." method="_on_microgame_spawn_timer_timeout"] +[connection signal="donezo" from="Score window (real)/Score window" to="." method="_on_score_window_donezo"] [connection signal="buy" from="Stock ticker" to="Score window (real)/Score window" method="_on_stock_ticker_buy"] [connection signal="sell" from="Stock ticker" to="Score window (real)/Score window" method="_on_stock_ticker_sell"] [connection signal="win" from="Fishin" to="." method="_on_fishin_win"] diff --git a/scenes/microgames/fishin/fishin.gd b/scenes/microgames/fishin/fishin.gd index d556b75..8e12c03 100644 --- a/scenes/microgames/fishin/fishin.gd +++ b/scenes/microgames/fishin/fishin.gd @@ -95,7 +95,8 @@ func _on_start_game_timeout() -> void: mash.visible = true mouse.visible = true - num_clicks = randi_range(5,21) + #num_clicks = randi_range(5,21) + num_clicks = 5 # playtesting is hard #num_clicks = 21 get_window().title = "MASH MASH MASH MASH MASH" diff --git a/scenes/score_window/score_window.gd b/scenes/score_window/score_window.gd index f4159af..410d67d 100644 --- a/scenes/score_window/score_window.gd +++ b/scenes/score_window/score_window.gd @@ -1,10 +1,12 @@ extends Node2D +signal donezo + var net_worth: Big # Called when the node enters the scene tree for the first time. func _ready() -> void: - net_worth = Big.new(1000) + net_worth = Big.new(10) var window = get_window() window.position = Vector2(450, 360) @@ -14,6 +16,9 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: $Score.text = "Net worth: \n$%s" % net_worth.toString() + + if net_worth.isLessThan(Big.new(0)): + donezo.emit() func _on_stock_ticker_buy(amount: Variant) -> void: |