End of lesson 26
This commit is contained in:
15
scenes/game/maps/entities/map_entity.tscn
Normal file
15
scenes/game/maps/entities/map_entity.tscn
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b1x2qqok7xafr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dypu0r4iadf8u" path="res://scripts/game/maps/entities/map_entity.gd" id="1_4euqm"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_agn4j"]
|
||||
size = Vector2(4, 4)
|
||||
|
||||
[node name="MapEntity" type="Area2D"]
|
||||
script = ExtResource("1_4euqm")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(8, 8)
|
||||
shape = SubResource("RectangleShape2D_agn4j")
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://d3e5mg0gk8u7r"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://d3e5mg0gk8u7r"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://byx166hd5b3as" path="res://gfx/game/maps/entities/player/Idle/Untitled-0_0.png" id="1_li2a0"]
|
||||
[ext_resource type="Script" uid="uid://bo0had2vq4r7h" path="res://scripts/game/maps/entities/mob.gd" id="1_mu6cs"]
|
||||
@@ -122,6 +122,9 @@ animations = [{
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mu6cs"]
|
||||
size = Vector2(4, 4)
|
||||
|
||||
[node name="Mob" type="Node2D" node_paths=PackedStringArray("animator", "collisionRay_1", "collisionRay_2")]
|
||||
script = ExtResource("1_mu6cs")
|
||||
animator = NodePath("AnimatedSprite2D")
|
||||
@@ -144,3 +147,9 @@ collide_with_areas = true
|
||||
position = Vector2(8, 8)
|
||||
target_position = Vector2(0, 16)
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(8, 8)
|
||||
shape = SubResource("RectangleShape2D_mu6cs")
|
||||
|
||||
Reference in New Issue
Block a user