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
|
||||
|
||||
Reference in New Issue
Block a user