Drag and drop on one letter

This commit is contained in:
Senad Uka
2022-12-04 12:14:13 +01:00
parent 50955b03e0
commit f7b7035bf2
17 changed files with 130 additions and 15 deletions

View File

@@ -1,10 +1,11 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=10 format=2]
[ext_resource path="res://main.tres" type="TileSet" id=1]
[ext_resource path="res://MainBoard.cs" type="Script" id=2]
[ext_resource path="res://lettertileup.png" type="Texture" id=3]
[ext_resource path="res://Letterbox.cs" type="Script" id=4]
[ext_resource path="res://Letter.cs" type="Script" id=5]
[ext_resource path="res://DragAndDrop.cs" type="Script" id=6]
[sub_resource type="CanvasItemMaterial" id=2]
@@ -16,6 +17,9 @@ animations = [ {
"speed": 5.0
} ]
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 49, 53.5 )
[node name="Node2D" type="Node2D"]
material = SubResource( 2 )
@@ -30,12 +34,6 @@ script = ExtResource( 2 )
position = Vector2( 1, 4 )
script = ExtResource( 4 )
[node name="Letter1" type="AnimatedSprite" parent="Letterbox"]
position = Vector2( 263, 1335 )
scale = Vector2( 1.5, 1.5 )
frames = SubResource( 1 )
script = ExtResource( 5 )
[node name="Letter2" type="AnimatedSprite" parent="Letterbox"]
position = Vector2( 360, 1335 )
scale = Vector2( 1.5, 1.5 )
@@ -71,3 +69,19 @@ position = Vector2( 845, 1335 )
scale = Vector2( 1.5, 1.5 )
frames = SubResource( 1 )
script = ExtResource( 5 )
[node name="KinematicBody2D" type="KinematicBody2D" parent="Letterbox"]
position = Vector2( 263, 1335 )
scale = Vector2( 1.5, 1.5 )
input_pickable = true
script = ExtResource( 6 )
[node name="Letter1" type="AnimatedSprite" parent="Letterbox/KinematicBody2D"]
frames = SubResource( 1 )
script = ExtResource( 5 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Letterbox/KinematicBody2D"]
position = Vector2( 262, 1333.5 )
shape = SubResource( 3 )
[connection signal="input_event" from="Letterbox/KinematicBody2D" to="Letterbox/KinematicBody2D" method="_on_KinematicBody2D_input_event"]