4.7 Deathzone
This commit is contained in:
parent
256d057662
commit
5d7831cc2e
3 changed files with 37 additions and 2 deletions
|
|
@ -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="Script" path="res://scripts/level.gd" id="1_84g5v"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c7y3ileam1twx" path="res://scenes/player.tscn" id="2_d65cs"]
|
[ext_resource type="PackedScene" uid="uid://c7y3ileam1twx" path="res://scenes/player.tscn" id="2_d65cs"]
|
||||||
|
|
@ -15,6 +15,15 @@ colors = PackedColorArray(0, 0, 0, 1)
|
||||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_v33b1"]
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_v33b1"]
|
||||||
gradient = SubResource("Gradient_de2k8")
|
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"]
|
[node name="Level" type="Node2D"]
|
||||||
script = ExtResource("1_84g5v")
|
script = ExtResource("1_84g5v")
|
||||||
|
|
||||||
|
|
@ -22,7 +31,7 @@ script = ExtResource("1_84g5v")
|
||||||
position = Vector2(230, 110)
|
position = Vector2(230, 110)
|
||||||
|
|
||||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||||
position = Vector2(204, 173)
|
position = Vector2(191, 200)
|
||||||
physics_material_override = SubResource("PhysicsMaterial_mvbjk")
|
physics_material_override = SubResource("PhysicsMaterial_mvbjk")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||||
|
|
@ -31,3 +40,19 @@ shape = SubResource("RectangleShape2D_5f3h6")
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="StaticBody2D"]
|
[node name="Sprite2D" type="Sprite2D" parent="StaticBody2D"]
|
||||||
scale = Vector2(1.275, 12.325)
|
scale = Vector2(1.275, 12.325)
|
||||||
texture = SubResource("GradientTexture1D_v33b1")
|
texture = SubResource("GradientTexture1D_v33b1")
|
||||||
|
|
||||||
|
[node name="Deathzone" type="Area2D" parent="."]
|
||||||
|
position = Vector2(293, 256)
|
||||||
|
|
||||||
|
[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")
|
shape = SubResource("RectangleShape2D_ereyp")
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
limit_bottom = 205
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
extends Node2D
|
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.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
|
@ -7,3 +10,9 @@ func _process(delta: float) -> void:
|
||||||
get_tree().quit()
|
get_tree().quit()
|
||||||
elif Input.is_action_just_pressed("reset"):
|
elif Input.is_action_just_pressed("reset"):
|
||||||
get_tree().reload_current_scene()
|
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