Fish Cascade WIP added
This commit is contained in:
14
scenes/objects/game/fish.gd
Normal file
14
scenes/objects/game/fish.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.fishs.erase(self)
|
||||
self.queue_free()
|
||||
1
scenes/objects/game/fish.gd.uid
Normal file
1
scenes/objects/game/fish.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c0mf5vliqjiou
|
||||
59
scenes/objects/game/fish.tscn
Normal file
59
scenes/objects/game/fish.tscn
Normal file
@@ -0,0 +1,59 @@
|
||||
[gd_scene format=3 uid="uid://b6xc0bu0slgue"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c0mf5vliqjiou" path="res://scenes/objects/game/fish.gd" id="1_dy21x"]
|
||||
[ext_resource type="Texture2D" uid="uid://bpmmklm87rhys" path="res://original data/images/fishy0.png" id="1_foolk"]
|
||||
[ext_resource type="Texture2D" uid="uid://bgjxv801vvsw2" path="res://original data/images/fishy1.png" id="2_dy21x"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4wc4ngjdq0es" path="res://original data/images/fishy2.png" id="3_qijva"]
|
||||
[ext_resource type="Texture2D" uid="uid://ba8uy4eamf0qc" path="res://original data/images/fishy3.png" id="4_2qncy"]
|
||||
[ext_resource type="Texture2D" uid="uid://n6yqudl5bdtc" path="res://original data/images/fishy-.png" id="5_u8vaa"]
|
||||
[ext_resource type="Texture2D" uid="uid://dn63xjbx8yqac" path="res://original data/images/splat0.png" id="7_qijva"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_10y2t"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_foolk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_dy21x")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_qijva")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_2qncy")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_u8vaa")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fish",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("7_qijva")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"splat",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="Fish" type="Node2D" unique_id=1446966186]
|
||||
script = ExtResource("1_dy21x")
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="." unique_id=71448930]
|
||||
sprite_frames = SubResource("SpriteFrames_10y2t")
|
||||
animation = &"fish"
|
||||
|
||||
[node name="Label" type="Label" parent="Sprite" unique_id=1746822548]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -12.0
|
||||
offset_top = -46.0
|
||||
offset_right = -22.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -7,7 +7,11 @@ func _on_pressed() -> void:
|
||||
current_scene = self.get_parent().get_parent().get_parent()
|
||||
|
||||
if current_scene.game_mode == "cascade":
|
||||
pass
|
||||
$ButtonPress.play()
|
||||
await $ButtonPress.finished
|
||||
next_scene = load("res://scenes/game/fish_cascade.tscn").instantiate()
|
||||
next_scene.word_set = self.text.to_lower().replace(" ", "")
|
||||
get_tree().change_scene_to_node(next_scene)
|
||||
elif current_scene.game_mode == "comet":
|
||||
$ButtonPress.play()
|
||||
await $ButtonPress.finished
|
||||
|
||||
Reference in New Issue
Block a user