Add patrolling enemies and link level 1 to level 2
New walker prefab (mushroom_red sprite) patrols a platform, turns at walls and ledges, drains a heart on contact and dies when stomped, bouncing the player up. Three are placed in level2. The level 2 spawn point is set to cell (7,11) so the player starts standing on the floor instead of falling in from mid-air, and level 1's LevelClear now loads level2.tscn.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
[gd_scene load_steps=5 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/vegetation/mushroom_red.png" id="1_tex"]
|
||||
[ext_resource type="Script" path="res://scripts/walker.gd" id="2_walker"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Shape_body"]
|
||||
size = Vector2(12, 16)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Shape_touch"]
|
||||
size = Vector2(16, 16)
|
||||
|
||||
[node name="Walker" type="CharacterBody2D" groups=["enemy"]]
|
||||
z_index = 5
|
||||
collision_layer = 4
|
||||
collision_mask = 1
|
||||
script = ExtResource("2_walker")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_tex")
|
||||
|
||||
[node name="Collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("Shape_body")
|
||||
|
||||
[node name="FloorProbe" type="RayCast2D" parent="."]
|
||||
position = Vector2(-6, 7)
|
||||
target_position = Vector2(0, 9)
|
||||
collision_mask = 1
|
||||
|
||||
[node name="TouchArea" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
|
||||
[node name="TouchShape" type="CollisionShape2D" parent="TouchArea"]
|
||||
shape = SubResource("Shape_touch")
|
||||
Reference in New Issue
Block a user