Add hazard spikes on the tree tops (grey spikes from the tileset atlas)
The two new spikes were painted as tiles in TerrainBase, but tileset collision can only make a solid wall, not a damaging hazard. Replaced them with a real spikes_grey prefab that uses the same atlas tile (8,3) plus hazard.gd, and erases the placeholder tile on ready. Also includes the level edits made in the editor (top-left terrain rework).
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=5 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/tilesets/kenney_tiles_atlas.png" id="1_atlas"]
|
||||
[ext_resource type="Script" path="res://scripts/hazard.gd" id="2_hazard"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_spikes"]
|
||||
atlas = ExtResource("1_atlas")
|
||||
region = Rect2(144, 54, 18, 18)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Shape_spikes"]
|
||||
size = Vector2(16, 8)
|
||||
|
||||
[node name="SpikesGrey" type="Area2D" groups=["hazard"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
script = ExtResource("2_hazard")
|
||||
erase_placeholder_tile = true
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = SubResource("AtlasTexture_spikes")
|
||||
|
||||
[node name="DetectionArea" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 4)
|
||||
shape = SubResource("Shape_spikes")
|
||||
Reference in New Issue
Block a user