gameplay start
This commit is contained in:
BIN
assets/audio/sfx/SE_Picnic.ogg
Normal file
BIN
assets/audio/sfx/SE_Picnic.ogg
Normal file
Binary file not shown.
19
assets/audio/sfx/SE_Picnic.ogg.import
Normal file
19
assets/audio/sfx/SE_Picnic.ogg.import
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://ck3wyh24v8it4"
|
||||||
|
path="res://.godot/imported/SE_Picnic.ogg-ada37d1be5f94a9dd33e40b3a4eeed99.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/audio/sfx/SE_Picnic.ogg"
|
||||||
|
dest_files=["res://.godot/imported/SE_Picnic.ogg-ada37d1be5f94a9dd33e40b3a4eeed99.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
BIN
assets/audio/sfx/SE_Push.ogg
Normal file
BIN
assets/audio/sfx/SE_Push.ogg
Normal file
Binary file not shown.
19
assets/audio/sfx/SE_Push.ogg.import
Normal file
19
assets/audio/sfx/SE_Push.ogg.import
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://t6tbvilcrwy8"
|
||||||
|
path="res://.godot/imported/SE_Push.ogg-a20157c158ace1705cd9334fec4372cb.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/audio/sfx/SE_Push.ogg"
|
||||||
|
dest_files=["res://.godot/imported/SE_Push.ogg-a20157c158ace1705cd9334fec4372cb.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
BIN
assets/audio/sfx/SYS_save.ogg
Normal file
BIN
assets/audio/sfx/SYS_save.ogg
Normal file
Binary file not shown.
19
assets/audio/sfx/SYS_save.ogg.import
Normal file
19
assets/audio/sfx/SYS_save.ogg.import
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://bq63r7u8v0jtj"
|
||||||
|
path="res://.godot/imported/SYS_save.ogg-876645e37f57f4f33e4583cf9ff5f0fd.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/audio/sfx/SYS_save.ogg"
|
||||||
|
dest_files=["res://.godot/imported/SYS_save.ogg-876645e37f57f4f33e4583cf9ff5f0fd.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
BIN
assets/audio/sfx/SYS_select.ogg
Normal file
BIN
assets/audio/sfx/SYS_select.ogg
Normal file
Binary file not shown.
19
assets/audio/sfx/SYS_select.ogg.import
Normal file
19
assets/audio/sfx/SYS_select.ogg.import
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://c5pio3qsltbsn"
|
||||||
|
path="res://.godot/imported/SYS_select.ogg-59add645453eeb679fec8593a45bc19e.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/audio/sfx/SYS_select.ogg"
|
||||||
|
dest_files=["res://.godot/imported/SYS_select.ogg-59add645453eeb679fec8593a45bc19e.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
10
gameplay/word_sets/lol.txt
Normal file
10
gameplay/word_sets/lol.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
lol
|
||||||
|
SIEMBRA
|
||||||
|
JARED BERESFORD
|
||||||
|
MAX IS GARDEN
|
||||||
|
HELLO
|
||||||
|
COMOS PARKS
|
||||||
|
COSMOS SPARK
|
||||||
|
SONIC
|
||||||
|
DANGANRONPA
|
||||||
|
RANMA
|
||||||
@@ -23,6 +23,7 @@ config/icon="uid://cicpbsmd3i1x4"
|
|||||||
|
|
||||||
window/size/viewport_width=1280
|
window/size/viewport_width=1280
|
||||||
window/size/viewport_height=720
|
window/size/viewport_height=720
|
||||||
|
window/stretch/mode="canvas_items"
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
|||||||
77
scenes/game/comet_zap.gd
Normal file
77
scenes/game/comet_zap.gd
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
# word stuff
|
||||||
|
var word_set
|
||||||
|
var word_set_file_path
|
||||||
|
var word_set_file
|
||||||
|
var word_set_content
|
||||||
|
var word_set_array
|
||||||
|
|
||||||
|
# init random
|
||||||
|
var alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N",
|
||||||
|
"O","P","Q","R","S","T","U","V","W","X","Y","Z"]
|
||||||
|
var comets = []
|
||||||
|
var comet_speed = 150
|
||||||
|
|
||||||
|
# numbers
|
||||||
|
var delay = 2
|
||||||
|
var spawn_timer = 0
|
||||||
|
|
||||||
|
# objects
|
||||||
|
var comet_source = preload("res://scenes/objects/game/comet.tscn")
|
||||||
|
|
||||||
|
# Runs on start
|
||||||
|
func _ready() -> void:
|
||||||
|
|
||||||
|
# Load Corresponding Text File
|
||||||
|
word_set_file_path = "res://gameplay/word_sets/" + word_set + ".txt"
|
||||||
|
word_set_file = FileAccess.open(word_set_file_path, FileAccess.READ)
|
||||||
|
|
||||||
|
# Gets file contents as text
|
||||||
|
word_set_content = word_set_file.get_as_text()
|
||||||
|
|
||||||
|
# Splits text file contents by line and removes the first entry (its just the name)
|
||||||
|
word_set_array = word_set_content.split("\n", true)
|
||||||
|
word_set_array.remove_at(0)
|
||||||
|
|
||||||
|
if word_set_array[len(word_set_array)-1] == "":
|
||||||
|
word_set_array.remove_at(len(word_set_array)-1)
|
||||||
|
|
||||||
|
#print(word_set_array)
|
||||||
|
|
||||||
|
# Runs every frame
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
spawn_timer += delta
|
||||||
|
|
||||||
|
if spawn_timer >= delay:
|
||||||
|
spawn_timer = 0
|
||||||
|
spawn_word()
|
||||||
|
|
||||||
|
func spawn_word():
|
||||||
|
var new_word = word_set_array[randi_range(0,len(word_set_array)-1)]
|
||||||
|
var viewport_size = get_viewport_rect().size
|
||||||
|
var offset = 0
|
||||||
|
|
||||||
|
for char in new_word:
|
||||||
|
if char != " ":
|
||||||
|
var new_commet = comet_source.instantiate()
|
||||||
|
new_commet.position = Vector2(128+offset,-128)
|
||||||
|
new_commet.get_node("Sprite").get_node("Label").text = char
|
||||||
|
new_commet.speed = comet_speed
|
||||||
|
add_child(new_commet)
|
||||||
|
comets.append(new_commet)
|
||||||
|
offset += 75
|
||||||
|
|
||||||
|
func _input(event):
|
||||||
|
if event is InputEventKey and event.pressed:
|
||||||
|
if event.as_text() in alphabet:
|
||||||
|
print(event.as_text())
|
||||||
|
|
||||||
|
if len(comets) > 0:
|
||||||
|
var comet = comets[0]
|
||||||
|
if event.as_text() == comet.get_node("Sprite").get_node("Label").text:
|
||||||
|
comets.erase(comet)
|
||||||
|
comet.get_node("Sprite").play("cometbreak")
|
||||||
|
$CometBreakSound.play()
|
||||||
|
await comet.get_node("Sprite").animation_finished
|
||||||
|
comet.queue_free()
|
||||||
1
scenes/game/comet_zap.gd.uid
Normal file
1
scenes/game/comet_zap.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c7vntfq6dyb2k
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
[gd_scene format=3 uid="uid://bef8re5x0kmmd"]
|
[gd_scene format=3 uid="uid://bef8re5x0kmmd"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://c7vntfq6dyb2k" path="res://scenes/game/comet_zap.gd" id="1_eyb20"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b0qibayc8b02i" path="res://assets/visual/backgrounds/misc/10-6.png" id="1_lcssi"]
|
[ext_resource type="Texture2D" uid="uid://b0qibayc8b02i" path="res://assets/visual/backgrounds/misc/10-6.png" id="1_lcssi"]
|
||||||
[ext_resource type="AudioStream" uid="uid://b2l55uknctgo6" path="res://assets/audio/music/game/Ranma Nibun-no-ichi Bakuretsu Rantouhen - King's Casino [Qk0v_NIqVPg].mp3" id="2_ije4o"]
|
[ext_resource type="AudioStream" uid="uid://b2l55uknctgo6" path="res://assets/audio/music/game/Ranma Nibun-no-ichi Bakuretsu Rantouhen - King's Casino [Qk0v_NIqVPg].mp3" id="2_ije4o"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://jd2rnhvq6gl6" path="res://original data/images/tux/tux-yes2.png" id="4_yib6v"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://t6tbvilcrwy8" path="res://assets/audio/sfx/SE_Push.ogg" id="5_62k7v"]
|
||||||
|
|
||||||
[node name="CometZap" type="Node2D" unique_id=1227404695]
|
[node name="CometZap" type="Node2D" unique_id=1227404695]
|
||||||
|
script = ExtResource("1_eyb20")
|
||||||
|
|
||||||
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1005683026]
|
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1005683026]
|
||||||
|
layer = -1
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="CanvasLayer" unique_id=2022519285]
|
[node name="Control" type="Control" parent="CanvasLayer" unique_id=2022519285]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
@@ -29,3 +34,12 @@ expand_mode = 1
|
|||||||
stream = ExtResource("2_ije4o")
|
stream = ExtResource("2_ije4o")
|
||||||
autoplay = true
|
autoplay = true
|
||||||
parameters/looping = true
|
parameters/looping = true
|
||||||
|
|
||||||
|
[node name="Tux" type="Sprite2D" parent="." unique_id=1799546830]
|
||||||
|
position = Vector2(599, 651.00006)
|
||||||
|
scale = Vector2(2.654338, 2.220616)
|
||||||
|
texture = ExtResource("4_yib6v")
|
||||||
|
|
||||||
|
[node name="CometBreakSound" type="AudioStreamPlayer2D" parent="." unique_id=169663936]
|
||||||
|
stream = ExtResource("5_62k7v")
|
||||||
|
volume_db = -10.0
|
||||||
|
|||||||
14
scenes/objects/game/comet.gd
Normal file
14
scenes/objects/game/comet.gd
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
var speed = 100
|
||||||
|
var scene
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
scene = self.get_parent()
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
self.position.y += speed*delta
|
||||||
|
|
||||||
|
if self.position.y >= 720:
|
||||||
|
scene.comets.erase(self)
|
||||||
|
self.queue_free()
|
||||||
1
scenes/objects/game/comet.gd.uid
Normal file
1
scenes/objects/game/comet.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://vrep8fdk6uqo
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
[gd_scene format=3 uid="uid://bxhyh5xkl8o31"]
|
[gd_scene format=3 uid="uid://bxhyh5xkl8o31"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://vrep8fdk6uqo" path="res://scenes/objects/game/comet.gd" id="1_0gpin"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bfhijtgf8gfq5" path="res://original data/images/comets/comet1.svg" id="1_k3nfo"]
|
[ext_resource type="Texture2D" uid="uid://bfhijtgf8gfq5" path="res://original data/images/comets/comet1.svg" id="1_k3nfo"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bsa3mto3d4240" path="res://original data/images/comets/comet2.svg" id="2_y71x0"]
|
[ext_resource type="Texture2D" uid="uid://bsa3mto3d4240" path="res://original data/images/comets/comet2.svg" id="2_y71x0"]
|
||||||
[ext_resource type="Texture2D" uid="uid://birp1wvovf4ti" path="res://original data/images/comets/comet3.svg" id="3_hx85f"]
|
[ext_resource type="Texture2D" uid="uid://birp1wvovf4ti" path="res://original data/images/comets/comet3.svg" id="3_hx85f"]
|
||||||
@@ -29,15 +30,35 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": ExtResource("5_r0eex")
|
"texture": ExtResource("5_r0eex")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": &"cometbreak",
|
"name": &"cometbreak",
|
||||||
"speed": 5.0
|
"speed": 10.0
|
||||||
}]
|
}]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D" unique_id=1878661663]
|
[sub_resource type="LabelSettings" id="LabelSettings_3d2ho"]
|
||||||
|
font_size = 70
|
||||||
|
outline_size = 10
|
||||||
|
outline_color = Color(0.9529412, 0.16078432, 1, 1)
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1849187873]
|
[node name="Comet" type="Node2D" unique_id=1878661663]
|
||||||
|
script = ExtResource("1_0gpin")
|
||||||
|
|
||||||
|
[node name="Sprite" type="AnimatedSprite2D" parent="." unique_id=1849187873]
|
||||||
position = Vector2(0, -1)
|
position = Vector2(0, -1)
|
||||||
sprite_frames = SubResource("SpriteFrames_ggplc")
|
sprite_frames = SubResource("SpriteFrames_ggplc")
|
||||||
animation = &"comet"
|
animation = &"cometbreak"
|
||||||
frame_progress = 0.69607645
|
autoplay = "comet"
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Sprite" unique_id=494320078]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_left = -41.5
|
||||||
|
offset_top = -75.0
|
||||||
|
offset_right = -41.5
|
||||||
|
offset_bottom = -75.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
label_settings = SubResource("LabelSettings_3d2ho")
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 2
|
||||||
|
|||||||
17
scenes/objects/ui/word_select_button.gd
Normal file
17
scenes/objects/ui/word_select_button.gd
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
extends Button
|
||||||
|
|
||||||
|
var current_scene
|
||||||
|
var next_scene
|
||||||
|
|
||||||
|
func _on_pressed() -> void:
|
||||||
|
current_scene = self.get_parent().get_parent().get_parent()
|
||||||
|
|
||||||
|
if current_scene.game_mode == "cascade":
|
||||||
|
pass
|
||||||
|
elif current_scene.game_mode == "comet":
|
||||||
|
$ButtonPress.play()
|
||||||
|
await $ButtonPress.finished
|
||||||
|
next_scene = load("res://scenes/game/comet_zap.tscn").instantiate()
|
||||||
|
next_scene.word_set = self.text.to_lower().replace(" ", "")
|
||||||
|
get_tree().change_scene_to_node(next_scene)
|
||||||
|
|
||||||
1
scenes/objects/ui/word_select_button.gd.uid
Normal file
1
scenes/objects/ui/word_select_button.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bsfmhi1abix5v
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
[gd_scene format=3 uid="uid://xcgelb5iy4wu"]
|
[gd_scene format=3 uid="uid://xcgelb5iy4wu"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bsfmhi1abix5v" path="res://scenes/objects/ui/word_select_button.gd" id="1_mjqrp"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://podscahsf0d4" path="res://assets/audio/sfx/MenuAccept.wav" id="2_suean"]
|
||||||
|
|
||||||
[node name="Button" type="Button" unique_id=25006937]
|
[node name="Button" type="Button" unique_id=25006937]
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -7,3 +10,10 @@ anchor_bottom = 1.0
|
|||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
text = "Placeholder"
|
text = "Placeholder"
|
||||||
|
script = ExtResource("1_mjqrp")
|
||||||
|
|
||||||
|
[node name="ButtonPress" type="AudioStreamPlayer2D" parent="." unique_id=1570916989]
|
||||||
|
stream = ExtResource("2_suean")
|
||||||
|
volume_db = -20.0
|
||||||
|
|
||||||
|
[connection signal="pressed" from="." to="." method="_on_pressed"]
|
||||||
|
|||||||
Reference in New Issue
Block a user