gameplay start
This commit is contained in:
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"]
|
||||
|
||||
[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://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"]
|
||||
@@ -29,15 +30,35 @@ animations = [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_r0eex")
|
||||
}],
|
||||
"loop": true,
|
||||
"loop": false,
|
||||
"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)
|
||||
sprite_frames = SubResource("SpriteFrames_ggplc")
|
||||
animation = &"comet"
|
||||
frame_progress = 0.69607645
|
||||
animation = &"cometbreak"
|
||||
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"]
|
||||
|
||||
[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]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -7,3 +10,10 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
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