4.7 Deathzone
This commit is contained in:
parent
256d057662
commit
6cbcbe743c
4 changed files with 46 additions and 2 deletions
|
|
@ -51,6 +51,12 @@ reset={
|
|||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_physics/layer_1="world"
|
||||
2d_physics/layer_2="player"
|
||||
2d_physics/layer_3="deathzone"
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://cchf5vmjp6ahj"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://cchf5vmjp6ahj"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/level.gd" id="1_84g5v"]
|
||||
[ext_resource type="PackedScene" uid="uid://c7y3ileam1twx" path="res://scenes/player.tscn" id="2_d65cs"]
|
||||
|
|
@ -15,14 +15,24 @@ colors = PackedColorArray(0, 0, 0, 1)
|
|||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_v33b1"]
|
||||
gradient = SubResource("Gradient_de2k8")
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iyldn"]
|
||||
size = Vector2(947, 20)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_14250"]
|
||||
colors = PackedColorArray(0.91, 0.42497, 0.1638, 1, 1, 0.3285, 0.21, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_y3q5v"]
|
||||
gradient = SubResource("Gradient_14250")
|
||||
|
||||
[node name="Level" type="Node2D"]
|
||||
script = ExtResource("1_84g5v")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_d65cs")]
|
||||
position = Vector2(230, 110)
|
||||
collision_layer = 2
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
position = Vector2(204, 173)
|
||||
position = Vector2(191, 200)
|
||||
physics_material_override = SubResource("PhysicsMaterial_mvbjk")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
|
|
@ -31,3 +41,21 @@ shape = SubResource("RectangleShape2D_5f3h6")
|
|||
[node name="Sprite2D" type="Sprite2D" parent="StaticBody2D"]
|
||||
scale = Vector2(1.275, 12.325)
|
||||
texture = SubResource("GradientTexture1D_v33b1")
|
||||
|
||||
[node name="Deathzone" type="Area2D" parent="."]
|
||||
position = Vector2(293, 256)
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Deathzone"]
|
||||
position = Vector2(0.5, 0)
|
||||
shape = SubResource("RectangleShape2D_iyldn")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Deathzone"]
|
||||
scale = Vector2(3.69, 20.06)
|
||||
texture = SubResource("GradientTexture1D_y3q5v")
|
||||
|
||||
[node name="StartPosition" type="Marker2D" parent="."]
|
||||
position = Vector2(309, 135)
|
||||
|
||||
[connection signal="body_entered" from="Deathzone" to="." method="_on_death_zone_body_entered"]
|
||||
|
|
|
|||
|
|
@ -213,3 +213,4 @@ position = Vector2(0, -10)
|
|||
shape = SubResource("RectangleShape2D_ereyp")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
limit_bottom = 205
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
extends Node2D
|
||||
|
||||
@onready var player: CharacterBody2D = $Player
|
||||
@onready var start_position: Marker2D = $StartPosition
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
|
|
@ -7,3 +10,9 @@ func _process(delta: float) -> void:
|
|||
get_tree().quit()
|
||||
elif Input.is_action_just_pressed("reset"):
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
|
||||
func _on_death_zone_body_entered(body: Node2D) -> void:
|
||||
player.velocity = Vector2.ZERO
|
||||
player.global_position = start_position.global_position
|
||||
pass # Replace with function body.
|
||||
|
|
|
|||
Loading…
Reference in a new issue