Proof of concept (specialized generalized fish)

This commit is contained in:
Zoey Kitt 2024-11-17 13:06:44 -06:00
parent 49da4da8a2
commit 1b7ea447c0
4 changed files with 33 additions and 10 deletions

View file

@ -44,7 +44,7 @@ func _on_fishin_win() -> void:
$Clippette.visible = true $Clippette.visible = true
$Clippette.start_dialogue() $Clippette.start_dialogue()
$"Score window (real)".visible = true $"Score window (real)".visible = true
func _on_score_window_donezo() -> void: func _on_score_window_donezo() -> void:
for child in get_children(): for child in get_children():

View file

@ -343,4 +343,5 @@ scale = Vector2(1, 1)
[connection signal="donezo" from="Score window (real)/Score window" to="." method="_on_score_window_donezo"] [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="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="sell" from="Stock ticker" to="Score window (real)/Score window" method="_on_stock_ticker_sell"]
[connection signal="fish_chosen" from="Fishin" to="Stock ticker" method="_on_fishin_fish_chosen"]
[connection signal="win" from="Fishin" to="." method="_on_fishin_win"] [connection signal="win" from="Fishin" to="." method="_on_fishin_win"]

View file

@ -13,6 +13,7 @@ enum FishType {
} }
signal win signal win
signal fish_chosen(fish_sprite: Sprite2D, fish_name: String)
const IN_GAME_WAIT_TIME = 10 const IN_GAME_WAIT_TIME = 10
@ -107,17 +108,29 @@ func _on_texture_button_button_up() -> void:
# show fish # show fish
var fish_choice: FishType = randi_range(0,len(fishes)) var fish_choice: FishType = randi_range(0,len(fishes))
# hehe
fish_choice = FishType.GAR
match fish_choice: match fish_choice:
FishType.GAR: gar.visible = true FishType.GAR:
FishType.SALMON: salmon.visible = true gar.visible = true
FishType.BASS: bass.visible = true fish_chosen.emit(gar.get_node("GarSprite"), "Gar :)")
FishType.HUMUHUMUNUKUNUKUAPUA_A: humuhumunukunukuapua_a.visible = true FishType.SALMON:
FishType.CATFSIH: catfsih.visible = true salmon.visible = true
FishType.DOGFISH: dogfish.visible = true FishType.BASS:
FishType.ANGLERFISH: anglerfish.visible = true bass.visible = true
FishType.MOBY_DICK: moby_dick.visible = true FishType.HUMUHUMUNUKUNUKUAPUA_A:
FishType.LEAPING_SMACKEREL: leaping_smackerel.visible = true humuhumunukunukuapua_a.visible = true
FishType.CATFSIH:
catfsih.visible = true
FishType.DOGFISH:
dogfish.visible = true
FishType.ANGLERFISH:
anglerfish.visible = true
FishType.MOBY_DICK:
moby_dick.visible = true
FishType.LEAPING_SMACKEREL:
leaping_smackerel.visible = true
in_game_timer.stop() in_game_timer.stop()
in_game_timer.wait_time = IN_GAME_WAIT_TIME in_game_timer.wait_time = IN_GAME_WAIT_TIME

View file

@ -19,3 +19,12 @@ func _on_stonks_sell(amount: Variant) -> void:
# Scope creep! # Scope creep!
func start(): func start():
$Timer.start() $Timer.start()
func set_icon(sprite: Sprite2D):
$Node2D/Sprite2D.texture = sprite.texture
func _on_fishin_fish_chosen(fish_sprite: Sprite2D, fish_name: String) -> void:
$Sprite2D.texture = fish_sprite.texture
$Label.text = fish_name