cool progress

This commit is contained in:
Tabby 2025-04-21 01:11:27 +10:00
parent 07de7179c9
commit 341c91742c
14 changed files with 52 additions and 16 deletions

View file

@ -3,8 +3,8 @@
[ext_resource type="Texture2D" uid="uid://i348o6hqw2dn" path="res://sprites/44389.png" id="1_e2o6t"] [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="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://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://ck06glyqpqy3n" path="res://music/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://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://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"] [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")] [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") script = ExtResource("1_feb5d")
autoplay_mode = true
max_shinies = 100 max_shinies = 100
player_spawns_nodes = NodePath("PlayerSpawns") player_spawns_nodes = NodePath("PlayerSpawns")
starting_shine_nodes = NodePath("StartingShineLocations") starting_shine_nodes = NodePath("StartingShineLocations")

View file

@ -8,11 +8,15 @@ enum State {
} }
@export var shyguy_mode : bool @export var shyguy_mode : bool
@export var autoplay_mode : bool = false
@export var max_shinies : int = 9 @export var max_shinies : int = 9
var player_spawns : Array[Node] var player_spawns : Array[Node]
var starting_shine_spawns : Array[Node] var starting_shine_spawns : Array[Node]
static var shine_spawns : Array[Node] static var shine_spawns : Array[Node]
var players : Array[Player] var players : Array[Player]
var autoplay_timer : float = 20
var autoreset_timer : float = 20
var bets_closed : bool = false
@export_group("Node References") @export_group("Node References")
@export var player_spawns_nodes : Node2D @export var player_spawns_nodes : Node2D
@ -80,9 +84,20 @@ func spawn_new_shiny():
func _process(delta: float) -> void: 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): if(state == State.game):
elim_timer -= delta elim_timer -= delta
game_timer += delta game_timer += delta
shiny_spawn_timer -= delta shiny_spawn_timer -= delta
if(shiny_spawn_timer<=0 and shiny_count < max_shinies): if(shiny_spawn_timer<=0 and shiny_count < max_shinies):
spawn_new_shiny() spawn_new_shiny()
@ -118,10 +133,15 @@ func check_win_con():
if gamers == 1: if gamers == 1:
music_player.stop() music_player.stop()
win_player.play() win_player.play()
state = State.end
func update_ui(): func update_ui():
elim_timer_label.text = format_time(elim_timer, false) elim_timer_label.text = format_time(elim_timer, false)
game_timer_label.text = format_time(game_timer, true) 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() order_scoreboard()
func order_scoreboard(): func order_scoreboard():

View file

@ -3,12 +3,12 @@
importer="wav" importer="wav"
type="AudioStreamWAV" type="AudioStreamWAV"
uid="uid://igps611ecoc" uid="uid://igps611ecoc"
path="res://.godot/imported/0014.wav-fa68a7bd2db71d351ca25159fbf8c79f.sample" path="res://.godot/imported/0014.wav-0fd55b830d58ece581b8aa6ac1e07fea.sample"
[deps] [deps]
source_file="res://0014.wav" source_file="res://music/0014.wav"
dest_files=["res://.godot/imported/0014.wav-fa68a7bd2db71d351ca25159fbf8c79f.sample"] dest_files=["res://.godot/imported/0014.wav-0fd55b830d58ece581b8aa6ac1e07fea.sample"]
[params] [params]

View file

@ -3,12 +3,12 @@
importer="mp3" importer="mp3"
type="AudioStreamMP3" type="AudioStreamMP3"
uid="uid://ck06glyqpqy3n" 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] [deps]
source_file="res://Battle Mode - Mario Kart DS OST Extended.mp3" 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-d412b39a20f551844107975154365a25.mp3str"] dest_files=["res://.godot/imported/Battle Mode - Mario Kart DS OST Extended.mp3-77a53cf8ed45bcf5942977388e0a7c97.mp3str"]
[params] [params]

View file

@ -3,12 +3,12 @@
importer="mp3" importer="mp3"
type="AudioStreamMP3" type="AudioStreamMP3"
uid="uid://c27abe2dhhok1" 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] [deps]
source_file="res://Mario Kart Race Start - Sound Effect (HD).mp3" 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-d1ec96e7e84451715534300088c258b8.mp3str"] dest_files=["res://.godot/imported/Mario Kart Race Start - Sound Effect (HD).mp3-cfd3d79913d1ddd7e5aba77e191310a3.mp3str"]
[params] [params]

View file

@ -28,7 +28,7 @@ func respawn_shiny():
var shiny = load("res://shiny.tscn").instantiate() var shiny = load("res://shiny.tscn").instantiate()
var ranPos = randi_range(0,GM.shine_spawns.size()-1) var ranPos = randi_range(0,GM.shine_spawns.size()-1)
shiny.position = GM.shine_spawns[ranPos].position 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: func _process(delta: float) -> void:
scorecard.score = score scorecard.score = score
@ -47,7 +47,7 @@ func _process(delta: float) -> void:
func _on_body_entered(body: Node) -> void: func _on_body_entered(body: Node) -> void:
#print("mew") #print("mew")
if body.is_in_group("player") : if body.is_in_group("player") :
print("playersHit") #print("playersHit")
if(score > 0): if(score > 0):
#score -= 1 #score -= 1
#respawn_shiny() #respawn_shiny()

View file

@ -37,3 +37,7 @@ player=""
textures/canvas_textures/default_texture_filter=0 textures/canvas_textures/default_texture_filter=0
renderer/rendering_method="gl_compatibility" renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility"
[very_simple_twitch]
config/client_id="02idi95zrbbtrgw9k00yhbubp41lc2"

View file

@ -25,6 +25,7 @@ dead_texture = ExtResource("3_lb3t7")
[node name="Back" type="TextureRect" parent="."] [node name="Back" type="TextureRect" parent="."]
show_behind_parent = true show_behind_parent = true
layout_mode = 0
offset_right = 58.0 offset_right = 58.0
offset_bottom = 23.0 offset_bottom = 23.0
texture = ExtResource("3_lb3t7") texture = ExtResource("3_lb3t7")

View file

@ -2,8 +2,8 @@ extends RigidBody2D
func _on_body_entered(body: Player) -> void: func _on_body_entered(body: Node) -> void:
print(body.name) #print(body.name)
if body is Player: if body is Player:
body.score += 1 body.score += 1
queue_free() queue_free()

View file

@ -24,5 +24,5 @@ shape = SubResource("CircleShape2D_yl8uo")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shiny"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Shiny"]
shape = SubResource("CircleShape2D_0cndc") 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="." method="_on_body_entered"]
[connection signal="body_entered" from="Shiny" to="Shiny" method="_on_body_entered"]

View file

@ -1 +1,11 @@
extends Node 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])