Fetch bingo squares from URL rather than hard-coding them in GDScript.
This commit is contained in:
parent
f3af039882
commit
c03c702d6f
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,7 +3,6 @@
|
||||||
# Godot-specific ignores
|
# Godot-specific ignores
|
||||||
.import/
|
.import/
|
||||||
export.cfg
|
export.cfg
|
||||||
export_presets.cfg
|
|
||||||
|
|
||||||
# Mono-specific ignores
|
# Mono-specific ignores
|
||||||
.mono/
|
.mono/
|
||||||
|
|
78
Main.gd
78
Main.gd
|
@ -1,67 +1,20 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
var strings = [
|
var strings
|
||||||
"Someone asks where to find an unreleased song",
|
|
||||||
"Akira gets aggro at someone in chat on stream-mods",
|
|
||||||
"Darkwing_j makes an appearance",
|
|
||||||
"Lopar makes a poll",
|
|
||||||
"Inquiry about how to join the non-existent Discord server",
|
|
||||||
"Mods get distracted by stream-mod chat",
|
|
||||||
"Annoying Jojo reference",
|
|
||||||
"Akira beats everyone else to something",
|
|
||||||
"Someone makes a business request in chat",
|
|
||||||
"Sub Bomb of 20+",
|
|
||||||
"AutoMod catches a perfectly normal message",
|
|
||||||
"Insomniac_Rap Raid",
|
|
||||||
"Jirard Raid",
|
|
||||||
"We timeout someone",
|
|
||||||
"We ban someone",
|
|
||||||
"We delete a message",
|
|
||||||
"Hugspam",
|
|
||||||
"Broken Shigi",
|
|
||||||
"Mood Flip",
|
|
||||||
"Someone asks who made Saitou's graphics",
|
|
||||||
"AutoMod catches an actual bad message",
|
|
||||||
"Tax Cheer",
|
|
||||||
"Fireworks Cheer",
|
|
||||||
"Star Cheer",
|
|
||||||
"Hype Train",
|
|
||||||
"Raid right at the end of the stream",
|
|
||||||
"We add a new word to the AutoMod block list",
|
|
||||||
"DSKoopa Raid",
|
|
||||||
"Someone just finished Rakuen",
|
|
||||||
"Someone spams a request in chat",
|
|
||||||
"Someone asks for personal information",
|
|
||||||
"We ask someone to stop spamming",
|
|
||||||
"Someone asks about effects/echo",
|
|
||||||
"Widetou appears",
|
|
||||||
"Oddtou appears",
|
|
||||||
"Saitou is Missing",
|
|
||||||
"Rapid-Fire Requests",
|
|
||||||
"Hype Train reaches max level",
|
|
||||||
"We DM someone",
|
|
||||||
"Someone asks about musical equipment",
|
|
||||||
"Someone asks for piano tutorials",
|
|
||||||
"Someone tries to post a link in chat",
|
|
||||||
"Buck Bumble",
|
|
||||||
"We need Google Translate's assistance",
|
|
||||||
"Someone claims a song sounds like something else",
|
|
||||||
"BWA HA HA",
|
|
||||||
"Overuse of the @supershigi tag",
|
|
||||||
"Hello from AN ENTIRE COUNTRY!",
|
|
||||||
"Akira and someone else say the same thing simultaneously",
|
|
||||||
"A dimpy person turns out to be cool",
|
|
||||||
"Live Learn",
|
|
||||||
"Someone needs to read the room",
|
|
||||||
"DJ Oddtou",
|
|
||||||
"Anime song request",
|
|
||||||
"Someone else sees/hears before us",
|
|
||||||
"Self-advertising",
|
|
||||||
"DEEP DREAM",
|
|
||||||
"TIMING"
|
|
||||||
]
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
$HTTPRequest.connect("request_completed", self, "_on_request_completed")
|
||||||
|
$HTTPRequest.request("https://lunarpenguin.net/stuff/stream-bingo/bingo-squares.json")
|
||||||
|
|
||||||
|
func _been_clicked(what):
|
||||||
|
var button = get_node("squares/%s/Marker" % what)
|
||||||
|
button.visible = !button.visible
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
func _on_request_completed(result, response_code, headers, body):
|
||||||
|
var json = JSON.parse(body.get_string_from_utf8())
|
||||||
|
strings = json.result
|
||||||
|
|
||||||
randomize()
|
randomize()
|
||||||
var rng = RandomNumberGenerator.new()
|
var rng = RandomNumberGenerator.new()
|
||||||
rng.randomize()
|
rng.randomize()
|
||||||
|
@ -76,8 +29,3 @@ func _ready():
|
||||||
get_node("squares/%s/Label" % j).set_text(strings[i])
|
get_node("squares/%s/Label" % j).set_text(strings[i])
|
||||||
get_node("squares/%s/Marker" % j).set_frame(rng.randi_range(0,3))
|
get_node("squares/%s/Marker" % j).set_frame(rng.randi_range(0,3))
|
||||||
get_node("squares/%s/Marker" % j).modulate = Color(1,1,1,0.5)
|
get_node("squares/%s/Marker" % j).modulate = Color(1,1,1,0.5)
|
||||||
|
|
||||||
func _been_clicked(what):
|
|
||||||
var button = get_node("squares/%s/Marker" % what)
|
|
||||||
button.visible = !button.visible
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
|
@ -876,6 +876,8 @@ autowrap = true
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="HTTPRequest" type="HTTPRequest" parent="."]
|
||||||
[connection signal="been_clicked" from="squares/1" to="." method="_been_clicked"]
|
[connection signal="been_clicked" from="squares/1" to="." method="_been_clicked"]
|
||||||
[connection signal="pressed" from="squares/1" to="squares/1" method="_on_pressed"]
|
[connection signal="pressed" from="squares/1" to="squares/1" method="_on_pressed"]
|
||||||
[connection signal="been_clicked" from="squares/2" to="." method="_been_clicked"]
|
[connection signal="been_clicked" from="squares/2" to="." method="_been_clicked"]
|
||||||
|
|
60
bingo-squares.json
Normal file
60
bingo-squares.json
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
[
|
||||||
|
"Someone asks where to find an unreleased song",
|
||||||
|
"Akira gets aggro at someone in chat on stream-mods",
|
||||||
|
"Darkwing_j makes an appearance",
|
||||||
|
"Lopar makes a poll",
|
||||||
|
"Inquiry about how to join the non-existent Discord server",
|
||||||
|
"Mods get distracted by stream-mod chat",
|
||||||
|
"Annoying Jojo reference",
|
||||||
|
"Akira beats everyone else to something",
|
||||||
|
"Someone makes a business request in chat",
|
||||||
|
"Sub Bomb of 20+",
|
||||||
|
"AutoMod catches a perfectly normal message",
|
||||||
|
"Insomniac_Rap Raid",
|
||||||
|
"Jirard Raid",
|
||||||
|
"We timeout someone",
|
||||||
|
"We ban someone",
|
||||||
|
"We delete a message",
|
||||||
|
"Hugspam",
|
||||||
|
"Broken Shigi",
|
||||||
|
"Mood Flip",
|
||||||
|
"Someone asks who made Saitou's graphics",
|
||||||
|
"AutoMod catches an actual bad message",
|
||||||
|
"Tax Cheer",
|
||||||
|
"Fireworks Cheer",
|
||||||
|
"Star Cheer",
|
||||||
|
"Hype Train",
|
||||||
|
"Raid right at the end of the stream",
|
||||||
|
"We add a new word to the AutoMod block list",
|
||||||
|
"DSKoopa Raid",
|
||||||
|
"Someone just finished Rakuen",
|
||||||
|
"Someone spams a request in chat",
|
||||||
|
"Someone asks for personal information",
|
||||||
|
"We ask someone to stop spamming",
|
||||||
|
"Someone asks about effects/echo",
|
||||||
|
"Widetou appears",
|
||||||
|
"Oddtou appears",
|
||||||
|
"Saitou is Missing",
|
||||||
|
"Rapid-Fire Requests",
|
||||||
|
"Hype Train reaches max level",
|
||||||
|
"We DM someone",
|
||||||
|
"Someone asks about musical equipment",
|
||||||
|
"Someone asks for piano tutorials",
|
||||||
|
"Someone tries to post a link in chat",
|
||||||
|
"Buck Bumble",
|
||||||
|
"We need Google Translate's assistance",
|
||||||
|
"Someone claims a song sounds like something else",
|
||||||
|
"BWA HA HA",
|
||||||
|
"Overuse of the @supershigi tag",
|
||||||
|
"Hello from AN ENTIRE COUNTRY!",
|
||||||
|
"Akira and someone else say the same thing simultaneously",
|
||||||
|
"A dimpy person turns out to be cool",
|
||||||
|
"Live Learn",
|
||||||
|
"Someone needs to read the room",
|
||||||
|
"DJ Oddtou",
|
||||||
|
"Anime song request",
|
||||||
|
"Someone else sees/hears before us",
|
||||||
|
"Self-advertising",
|
||||||
|
"DEEP DREAM",
|
||||||
|
"TIMING"
|
||||||
|
]
|
14
victory.tscn
Normal file
14
victory.tscn
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[gd_scene format=2]
|
||||||
|
|
||||||
|
[node name="victory" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Particles2D" type="CPUParticles2D" parent="."]
|
||||||
|
position = Vector2( 182.944, 128.238 )
|
||||||
|
amount = 64
|
||||||
|
emission_shape = 1
|
||||||
|
emission_sphere_radius = 128.0
|
||||||
|
spread = 124.35
|
||||||
|
radial_accel = 70.97
|
||||||
|
radial_accel_random = 0.25
|
||||||
|
hue_variation = 1.0
|
||||||
|
hue_variation_random = 1.0
|
Loading…
Reference in a new issue