74e4bd1e97
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.
36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
[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")
|