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

@ -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="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="fish_chosen" from="Fishin" to="Stock ticker" method="_on_fishin_fish_chosen"]
[connection signal="win" from="Fishin" to="." method="_on_fishin_win"]

View file

@ -13,6 +13,7 @@ enum FishType {
}
signal win
signal fish_chosen(fish_sprite: Sprite2D, fish_name: String)
const IN_GAME_WAIT_TIME = 10
@ -107,17 +108,29 @@ func _on_texture_button_button_up() -> void:
# show fish
var fish_choice: FishType = randi_range(0,len(fishes))
# hehe
fish_choice = FishType.GAR
match fish_choice:
FishType.GAR: gar.visible = true
FishType.SALMON: salmon.visible = true
FishType.BASS: bass.visible = true
FishType.HUMUHUMUNUKUNUKUAPUA_A: 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
FishType.GAR:
gar.visible = true
fish_chosen.emit(gar.get_node("GarSprite"), "Gar :)")
FishType.SALMON:
salmon.visible = true
FishType.BASS:
bass.visible = true
FishType.HUMUHUMUNUKUNUKUAPUA_A:
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.wait_time = IN_GAME_WAIT_TIME

View file

@ -19,3 +19,12 @@ func _on_stonks_sell(amount: Variant) -> void:
# Scope creep!
func 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