From 341c91742cca27a8d801fedf9c5781f3f8269ed7 Mon Sep 17 00:00:00 2001 From: Tabby <41929769+tabby-cat-nya@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:11:27 +1000 Subject: [PATCH] cool progress --- game.tscn | 5 +++-- gameManager.gd | 20 ++++++++++++++++++ 0014.wav => music/0014.wav | Bin 0014.wav.import => music/0014.wav.import | 6 +++--- ...ttle Mode - Mario Kart DS OST Extended.mp3 | Bin ...de - Mario Kart DS OST Extended.mp3.import | 6 +++--- ...io Kart Race Start - Sound Effect (HD).mp3 | Bin ... Race Start - Sound Effect (HD).mp3.import | 6 +++--- player.gd | 4 ++-- project.godot | 4 ++++ scorecard.tscn | 1 + shiny.gd | 4 ++-- shiny.tscn | 2 +- twitch.gd | 10 +++++++++ 14 files changed, 52 insertions(+), 16 deletions(-) rename 0014.wav => music/0014.wav (100%) rename 0014.wav.import => music/0014.wav.import (58%) rename Battle Mode - Mario Kart DS OST Extended.mp3 => music/Battle Mode - Mario Kart DS OST Extended.mp3 (100%) rename Battle Mode - Mario Kart DS OST Extended.mp3.import => music/Battle Mode - Mario Kart DS OST Extended.mp3.import (60%) rename Mario Kart Race Start - Sound Effect (HD).mp3 => music/Mario Kart Race Start - Sound Effect (HD).mp3 (100%) rename Mario Kart Race Start - Sound Effect (HD).mp3.import => music/Mario Kart Race Start - Sound Effect (HD).mp3.import (60%) diff --git a/game.tscn b/game.tscn index a7623b7..9f2363c 100644 --- a/game.tscn +++ b/game.tscn @@ -3,8 +3,8 @@ [ext_resource type="Texture2D" uid="uid://i348o6hqw2dn" path="res://sprites/44389.png" id="1_e2o6t"] [ext_resource type="Script" uid="uid://5qnvkmmtxsw2" path="res://gameManager.gd" id="1_feb5d"] [ext_resource type="AudioStream" uid="uid://cyyivtye4ngmt" path="res://music/90. Multiplayer Results - Win.mp3" id="3_eow3j"] -[ext_resource type="AudioStream" uid="uid://ck06glyqpqy3n" path="res://Battle Mode - Mario Kart DS OST Extended.mp3" id="3_feb5d"] -[ext_resource type="AudioStream" uid="uid://igps611ecoc" path="res://0014.wav" id="4_fc0e3"] +[ext_resource type="AudioStream" uid="uid://ck06glyqpqy3n" path="res://music/Battle Mode - Mario Kart DS OST Extended.mp3" id="3_feb5d"] +[ext_resource type="AudioStream" uid="uid://igps611ecoc" path="res://music/0014.wav" id="4_fc0e3"] [ext_resource type="AudioStream" uid="uid://xnhjht3k7qvd" path="res://music/intro.mp3" id="5_7jktm"] [ext_resource type="AudioStream" uid="uid://b7v7bcgp3iu8u" path="res://music/85. Battle Flyover.mp3" id="7_j5wjh"] @@ -49,6 +49,7 @@ radius = 3.0 [node name="Game" type="Node2D" node_paths=PackedStringArray("player_spawns_nodes", "starting_shine_nodes", "shine_nodes", "scorecard_container", "elim_timer_label", "game_timer_label", "chime_player", "music_player", "win_player", "flyover_player", "intro_player", "start_button")] script = ExtResource("1_feb5d") +autoplay_mode = true max_shinies = 100 player_spawns_nodes = NodePath("PlayerSpawns") starting_shine_nodes = NodePath("StartingShineLocations") diff --git a/gameManager.gd b/gameManager.gd index 0c0b74b..ee673b6 100644 --- a/gameManager.gd +++ b/gameManager.gd @@ -8,11 +8,15 @@ enum State { } @export var shyguy_mode : bool +@export var autoplay_mode : bool = false @export var max_shinies : int = 9 var player_spawns : Array[Node] var starting_shine_spawns : Array[Node] static var shine_spawns : Array[Node] var players : Array[Player] +var autoplay_timer : float = 20 +var autoreset_timer : float = 20 +var bets_closed : bool = false @export_group("Node References") @export var player_spawns_nodes : Node2D @@ -80,9 +84,20 @@ func spawn_new_shiny(): func _process(delta: float) -> void: + if (state == State.prep and autoplay_mode): + autoplay_timer -= delta + if autoplay_timer <= 0 and not bets_closed: + bets_closed = true + autoplay_timer == 0 + _on_start_button_pressed() + if (state == State.end and autoplay_mode): + autoreset_timer -= delta + if autoreset_timer <= 0: + _on_reset_button_pressed() if(state == State.game): elim_timer -= delta game_timer += delta + shiny_spawn_timer -= delta if(shiny_spawn_timer<=0 and shiny_count < max_shinies): spawn_new_shiny() @@ -118,10 +133,15 @@ func check_win_con(): if gamers == 1: music_player.stop() win_player.play() + state = State.end func update_ui(): elim_timer_label.text = format_time(elim_timer, false) game_timer_label.text = format_time(game_timer, true) + if (state == State.prep and autoplay_mode and not bets_closed): + elim_timer_label.text = "Bets close: " + format_time(autoplay_timer, false) + if (state == State.end and autoplay_mode): + elim_timer_label.text = "New round: " + format_time(autoreset_timer, false) order_scoreboard() func order_scoreboard(): diff --git a/0014.wav b/music/0014.wav similarity index 100% rename from 0014.wav rename to music/0014.wav diff --git a/0014.wav.import b/music/0014.wav.import similarity index 58% rename from 0014.wav.import rename to music/0014.wav.import index bae91df..1b02394 100644 --- a/0014.wav.import +++ b/music/0014.wav.import @@ -3,12 +3,12 @@ importer="wav" type="AudioStreamWAV" uid="uid://igps611ecoc" -path="res://.godot/imported/0014.wav-fa68a7bd2db71d351ca25159fbf8c79f.sample" +path="res://.godot/imported/0014.wav-0fd55b830d58ece581b8aa6ac1e07fea.sample" [deps] -source_file="res://0014.wav" -dest_files=["res://.godot/imported/0014.wav-fa68a7bd2db71d351ca25159fbf8c79f.sample"] +source_file="res://music/0014.wav" +dest_files=["res://.godot/imported/0014.wav-0fd55b830d58ece581b8aa6ac1e07fea.sample"] [params] diff --git a/Battle Mode - Mario Kart DS OST Extended.mp3 b/music/Battle Mode - Mario Kart DS OST Extended.mp3 similarity index 100% rename from Battle Mode - Mario Kart DS OST Extended.mp3 rename to music/Battle Mode - Mario Kart DS OST Extended.mp3 diff --git a/Battle Mode - Mario Kart DS OST Extended.mp3.import b/music/Battle Mode - Mario Kart DS OST Extended.mp3.import similarity index 60% rename from Battle Mode - Mario Kart DS OST Extended.mp3.import rename to music/Battle Mode - Mario Kart DS OST Extended.mp3.import index d242376..461c097 100644 --- a/Battle Mode - Mario Kart DS OST Extended.mp3.import +++ b/music/Battle Mode - Mario Kart DS OST Extended.mp3.import @@ -3,12 +3,12 @@ importer="mp3" type="AudioStreamMP3" uid="uid://ck06glyqpqy3n" -path="res://.godot/imported/Battle Mode - Mario Kart DS OST Extended.mp3-d412b39a20f551844107975154365a25.mp3str" +path="res://.godot/imported/Battle Mode - Mario Kart DS OST Extended.mp3-77a53cf8ed45bcf5942977388e0a7c97.mp3str" [deps] -source_file="res://Battle Mode - Mario Kart DS OST Extended.mp3" -dest_files=["res://.godot/imported/Battle Mode - Mario Kart DS OST Extended.mp3-d412b39a20f551844107975154365a25.mp3str"] +source_file="res://music/Battle Mode - Mario Kart DS OST Extended.mp3" +dest_files=["res://.godot/imported/Battle Mode - Mario Kart DS OST Extended.mp3-77a53cf8ed45bcf5942977388e0a7c97.mp3str"] [params] diff --git a/Mario Kart Race Start - Sound Effect (HD).mp3 b/music/Mario Kart Race Start - Sound Effect (HD).mp3 similarity index 100% rename from Mario Kart Race Start - Sound Effect (HD).mp3 rename to music/Mario Kart Race Start - Sound Effect (HD).mp3 diff --git a/Mario Kart Race Start - Sound Effect (HD).mp3.import b/music/Mario Kart Race Start - Sound Effect (HD).mp3.import similarity index 60% rename from Mario Kart Race Start - Sound Effect (HD).mp3.import rename to music/Mario Kart Race Start - Sound Effect (HD).mp3.import index 6c09129..43172b2 100644 --- a/Mario Kart Race Start - Sound Effect (HD).mp3.import +++ b/music/Mario Kart Race Start - Sound Effect (HD).mp3.import @@ -3,12 +3,12 @@ importer="mp3" type="AudioStreamMP3" uid="uid://c27abe2dhhok1" -path="res://.godot/imported/Mario Kart Race Start - Sound Effect (HD).mp3-d1ec96e7e84451715534300088c258b8.mp3str" +path="res://.godot/imported/Mario Kart Race Start - Sound Effect (HD).mp3-cfd3d79913d1ddd7e5aba77e191310a3.mp3str" [deps] -source_file="res://Mario Kart Race Start - Sound Effect (HD).mp3" -dest_files=["res://.godot/imported/Mario Kart Race Start - Sound Effect (HD).mp3-d1ec96e7e84451715534300088c258b8.mp3str"] +source_file="res://music/Mario Kart Race Start - Sound Effect (HD).mp3" +dest_files=["res://.godot/imported/Mario Kart Race Start - Sound Effect (HD).mp3-cfd3d79913d1ddd7e5aba77e191310a3.mp3str"] [params] diff --git a/player.gd b/player.gd index acff293..787d11c 100644 --- a/player.gd +++ b/player.gd @@ -28,7 +28,7 @@ func respawn_shiny(): var shiny = load("res://shiny.tscn").instantiate() var ranPos = randi_range(0,GM.shine_spawns.size()-1) shiny.position = GM.shine_spawns[ranPos].position - get_tree().get_root().add_child(shiny) + get_tree().get_root().get_node("Game").add_child(shiny) func _process(delta: float) -> void: scorecard.score = score @@ -47,7 +47,7 @@ func _process(delta: float) -> void: func _on_body_entered(body: Node) -> void: #print("mew") if body.is_in_group("player") : - print("playersHit") + #print("playersHit") if(score > 0): #score -= 1 #respawn_shiny() diff --git a/project.godot b/project.godot index 4152dd9..673b04d 100644 --- a/project.godot +++ b/project.godot @@ -37,3 +37,7 @@ player="" textures/canvas_textures/default_texture_filter=0 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" + +[very_simple_twitch] + +config/client_id="02idi95zrbbtrgw9k00yhbubp41lc2" diff --git a/scorecard.tscn b/scorecard.tscn index adcae24..963e9cc 100644 --- a/scorecard.tscn +++ b/scorecard.tscn @@ -25,6 +25,7 @@ dead_texture = ExtResource("3_lb3t7") [node name="Back" type="TextureRect" parent="."] show_behind_parent = true +layout_mode = 0 offset_right = 58.0 offset_bottom = 23.0 texture = ExtResource("3_lb3t7") diff --git a/shiny.gd b/shiny.gd index cfacc9c..306e081 100644 --- a/shiny.gd +++ b/shiny.gd @@ -2,8 +2,8 @@ extends RigidBody2D -func _on_body_entered(body: Player) -> void: - print(body.name) +func _on_body_entered(body: Node) -> void: + #print(body.name) if body is Player: body.score += 1 queue_free() diff --git a/shiny.tscn b/shiny.tscn index e1e3a4f..6589001 100644 --- a/shiny.tscn +++ b/shiny.tscn @@ -24,5 +24,5 @@ shape = SubResource("CircleShape2D_yl8uo") [node name="CollisionShape2D" type="CollisionShape2D" parent="Shiny"] shape = SubResource("CircleShape2D_0cndc") -[connection signal="body_entered" from="Shiny" to="Shiny" method="_on_body_entered"] [connection signal="body_entered" from="Shiny" to="." method="_on_body_entered"] +[connection signal="body_entered" from="Shiny" to="Shiny" method="_on_body_entered"] diff --git a/twitch.gd b/twitch.gd index 61510e1..9c44891 100644 --- a/twitch.gd +++ b/twitch.gd @@ -1 +1,11 @@ extends Node + +func _ready() -> void: + VerySimpleTwitch.get_token_and_login_chat() + VerySimpleTwitch.chat_message_received.connect(print_chatter_message) + +func _process(delta: float) -> void: + pass + +func print_chatter_message(chatter: VSTChatter): + print("Message received from %s: %s" % [chatter.tags.display_name, chatter.message])