第一次提交作业
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
extends Area2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body.is_in_group("hazard"):
|
||||
if body.has_method("take_damage"):
|
||||
body.take_damage()
|
||||
# Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://3ugbvq1iadqi
|
||||
@@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/obstacles/spikes_double.png" id="1_texture"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Shape_spikes"]
|
||||
size = Vector2(14, 6)
|
||||
|
||||
[node name="SpikesDouble" type="Area2D" groups=["hazard"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
[node name="DetectionArea" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 4)
|
||||
shape = SubResource("Shape_spikes")
|
||||
|
||||
Reference in New Issue
Block a user