mirror of
https://github.com/SEISYUNLie/Platform-Jump.git
synced 2026-10-25 18:31:10 +08:00
Initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
[gd_scene format=3 uid="uid://bof8b4hbutp3r"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hqjfwm6g6n2d" path="res://scripts/climb.gd" id="1_gr47n"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
size = Vector2(9, 18)
|
||||
|
||||
[node name="bashou" type="Area2D" unique_id=1972429983]
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_gr47n")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1860907114]
|
||||
position = Vector2(-4.5, 0)
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,22 @@
|
||||
[gd_scene format=3 uid="uid://70xdk4q8sa6o"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cbh3alwjyg4u0" path="res://scripts/button.gd" id="1_3q610"]
|
||||
[ext_resource type="Texture2D" uid="uid://dxhrjf4pn67cm" path="res://assets/kenney/tiles/tile_0148.png" id="2_i7y4x"]
|
||||
[ext_resource type="Texture2D" uid="uid://b2io5pgawh4pr" path="res://assets/kenney/tiles/tile_0149.png" id="3_1bdt2"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
size = Vector2(24, 20)
|
||||
|
||||
[node name="Button" type="Area2D" unique_id=1567474226 node_paths=PackedStringArray("ok", "nook")]
|
||||
script = ExtResource("1_3q610")
|
||||
ok = NodePath("ok")
|
||||
nook = NodePath("nook")
|
||||
|
||||
[node name="ok" type="Sprite2D" parent="." unique_id=808882749]
|
||||
texture = ExtResource("2_i7y4x")
|
||||
|
||||
[node name="nook" type="Sprite2D" parent="." unique_id=1516027891]
|
||||
texture = ExtResource("3_1bdt2")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=278581740]
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene format=3 uid="uid://8uxyaa5pl57p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hqjfwm6g6n2d" path="res://scripts/climb.gd" id="1_7ifiw"]
|
||||
|
||||
[sub_resource type="SegmentShape2D" id="SegmentShape2D_xtrpm"]
|
||||
b = Vector2(0, 100)
|
||||
|
||||
[node name="Climb_Line" type="Area2D" unique_id=1984978610]
|
||||
script = ExtResource("1_7ifiw")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=159492363]
|
||||
shape = SubResource("SegmentShape2D_xtrpm")
|
||||
@@ -0,0 +1,29 @@
|
||||
[gd_scene format=3 uid="uid://dkk624rhcp7aj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dldku23tokg8g" path="res://scripts/cloud_platform.gd" id="1_7g14f"]
|
||||
[ext_resource type="Texture2D" uid="uid://cmcbnefs0bxd0" path="res://assets/kenney/tiles/tile_0156.png" id="2_e801p"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_muem4"]
|
||||
size = Vector2(168.36133, 4.3251553)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
size = Vector2(17, 0.25)
|
||||
|
||||
[node name="CloudPlatform" type="StaticBody2D" unique_id=853282597]
|
||||
script = ExtResource("1_7g14f")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1282726332]
|
||||
position = Vector2(0, -7.602276)
|
||||
scale = Vector2(0.0950337, 0.74091035)
|
||||
shape = SubResource("RectangleShape2D_muem4")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=344131128]
|
||||
texture = ExtResource("2_e801p")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=1584508868]
|
||||
collision_mask = 3
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1019851471]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,11 @@
|
||||
[gd_scene format=3 uid="uid://cfl2edtyemk04"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://csipfcqva0gmy" path="res://scripts/door1.gd" id="1_rqu1w"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
|
||||
[node name="Door1" type="Area2D" unique_id=1028097837]
|
||||
script = ExtResource("1_rqu1w")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=185177601]
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,11 @@
|
||||
[gd_scene format=3 uid="uid://tull1xdh06fa"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://blv3emw6on4w0" path="res://scripts/door2.gd" id="1_e7htq"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
|
||||
[node name="Area2D" type="Area2D" unique_id=1892075002]
|
||||
script = ExtResource("1_e7htq")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1486009286]
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,22 @@
|
||||
[gd_scene format=3 uid="uid://jxdmer6b4bgt"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dmo6gf7nah07f" path="res://scripts/flag.gd" id="1_l1sgl"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
|
||||
[node name="Flag" type="Area2D" unique_id=1041418518 node_paths=PackedStringArray("label")]
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_l1sgl")
|
||||
label = NodePath("Label")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=7464851]
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
|
||||
[node name="Label" type="Label" parent="." unique_id=562263317]
|
||||
offset_left = -18.999998
|
||||
offset_top = -20.0
|
||||
offset_right = 77.0
|
||||
offset_bottom = 3.0
|
||||
scale = Vector2(0.42871976, 0.43396875)
|
||||
theme_override_colors/font_color = Color(0.9286286, 0.50334245, 0.30297205, 1)
|
||||
text = "重生点已设置"
|
||||
@@ -0,0 +1,18 @@
|
||||
extends Area2D
|
||||
|
||||
@export var label:Label
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
body_entered.connect(win)
|
||||
label.visible = false
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func win(body):
|
||||
if body.is_in_group("player"):
|
||||
label.visible = true
|
||||
body.set_physics_process(false)
|
||||
body.velocity = Vector2.ZERO
|
||||
@@ -0,0 +1 @@
|
||||
uid://bv1qm7h8ued0y
|
||||
@@ -0,0 +1,20 @@
|
||||
[gd_scene format=3 uid="uid://dxr208n1trq8a"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bibf255rv8r4t" path="res://scripts/horizen_spring.gd" id="1_i1git"]
|
||||
[ext_resource type="Texture2D" uid="uid://80q4nidlih65" path="res://assets/kenney/tiles/tile_0107.png" id="2_i1git"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
size = Vector2(5, 16)
|
||||
|
||||
[node name="horizen_spring" type="Area2D" unique_id=1107435615]
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_i1git")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=954712945]
|
||||
position = Vector2(5, 0)
|
||||
rotation = 1.5707964
|
||||
texture = ExtResource("2_i1git")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=189041955]
|
||||
position = Vector2(3, 0)
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,18 @@
|
||||
[gd_scene format=3 uid="uid://byxray84ox0bw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://wicj671ou4fj" path="res://scripts/key.gd" id="1_fttkb"]
|
||||
[ext_resource type="Texture2D" uid="uid://dk5c4jyxdmc0t" path="res://assets/kenney/tiles/tile_0027.png" id="1_yk2u2"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
|
||||
[node name="Key" type="Area2D" unique_id=333197868]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_fttkb")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1221538472]
|
||||
texture = ExtResource("1_yk2u2")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1163680320]
|
||||
scale = Vector2(0.8, 0.8)
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,27 @@
|
||||
extends Area2D
|
||||
|
||||
var _in = false
|
||||
var player = null
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
body_entered.connect(_up)
|
||||
body_exited.connect(out)
|
||||
player = get_tree().get_first_node_in_group("player")
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if player == null:
|
||||
return
|
||||
if player.is_in_group("player") and Input.is_action_pressed("jump") and _in:
|
||||
player.velocity.y = -80
|
||||
|
||||
func _up(body):
|
||||
if body.is_in_group("player"):
|
||||
_in = true
|
||||
|
||||
|
||||
func out(body):
|
||||
if body.is_in_group("player"):
|
||||
_in = false
|
||||
@@ -0,0 +1 @@
|
||||
uid://chjusrg550jpw
|
||||
@@ -0,0 +1,13 @@
|
||||
[gd_scene format=3 uid="uid://dnqjb3pfqv44w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://chjusrg550jpw" path="res://scenes/ladder.gd" id="1_cq4ai"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xtrpm"]
|
||||
size = Vector2(20, 128)
|
||||
|
||||
[node name="Ladder" type="Area2D" unique_id=1461068671]
|
||||
script = ExtResource("1_cq4ai")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=864274058]
|
||||
position = Vector2(0, 3)
|
||||
shape = SubResource("RectangleShape2D_xtrpm")
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_scene format=3 uid="uid://buch4t7s8ro30"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dve2d7snw7pr0" path="res://scripts/line.gd" id="1_pdjlr"]
|
||||
|
||||
[sub_resource type="SegmentShape2D" id="SegmentShape2D_xtrpm"]
|
||||
b = Vector2(4.851964e-06, 111)
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" unique_id=50328971]
|
||||
script = ExtResource("1_pdjlr")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1450023896]
|
||||
rotation = 1.5707964
|
||||
shape = SubResource("SegmentShape2D_xtrpm")
|
||||
one_way_collision = true
|
||||
one_way_collision_direction = Vector2(1, 0)
|
||||
+1133
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,35 @@
|
||||
[gd_scene format=3 uid="uid://c1u8k6ny02t4y"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cgkn1cd8uhunb" path="res://assets/game/characters/player_green_idle.png" id="1_character"]
|
||||
[ext_resource type="Script" uid="uid://b0gltif7vthau" path="res://scripts/player_controller.gd" id="1_g2els"]
|
||||
[ext_resource type="Script" uid="uid://3pm2vt1do0dd" path="res://scripts/camera_2d.gd" id="3_dqkch"]
|
||||
[ext_resource type="Texture2D" uid="uid://dyiiy25t1v6a1" path="res://assets/kenney/characters/tile_0001.png" id="3_qhqgy"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_player"]
|
||||
radius = 7.0
|
||||
height = 17.0
|
||||
|
||||
[node name="Player" type="CharacterBody2D" unique_id=1749745791]
|
||||
collision_layer = 2
|
||||
script = ExtResource("1_g2els")
|
||||
|
||||
[node name="jump" type="Sprite2D" parent="." unique_id=1345864522]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_character")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1631249303]
|
||||
position = Vector2(0, 1)
|
||||
shape = SubResource("CapsuleShape2D_player")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="." unique_id=1136280684]
|
||||
zoom = Vector2(2, 2)
|
||||
limit_left = 0
|
||||
limit_top = 0
|
||||
limit_right = 468
|
||||
limit_bottom = 270
|
||||
position_smoothing_enabled = true
|
||||
position_smoothing_speed = 6.0
|
||||
script = ExtResource("3_dqkch")
|
||||
|
||||
[node name="idel" type="Sprite2D" parent="." unique_id=1841773488]
|
||||
texture = ExtResource("3_qhqgy")
|
||||
@@ -0,0 +1,41 @@
|
||||
[gd_scene format=3 uid="uid://c1u8k6ny02t4y"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cgkn1cd8uhunb" path="res://assets/game/characters/player_green_idle.png" id="1_character"]
|
||||
[ext_resource type="Script" uid="uid://b0gltif7vthau" path="res://scripts/player_controller.gd" id="1_g2els"]
|
||||
[ext_resource type="Script" uid="uid://3pm2vt1do0dd" path="res://scenes/camera_2d.gd" id="3_dqkch"]
|
||||
[ext_resource type="Texture2D" uid="uid://dyiiy25t1v6a1" path="res://assets/kenney/characters/tile_0001.png" id="3_qhqgy"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_player"]
|
||||
radius = 5.0
|
||||
height = 17.0
|
||||
|
||||
[node name="Player" type="CharacterBody2D" unique_id=1749745791]
|
||||
collision_layer = 2
|
||||
script = ExtResource("1_g2els")
|
||||
double_press_interval = null
|
||||
move_speed = null
|
||||
acceleration = null
|
||||
deceleration = null
|
||||
jump_velocity = null
|
||||
invincibility_duration = null
|
||||
|
||||
[node name="jump" type="Sprite2D" parent="." unique_id=1345864522]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_character")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1631249303]
|
||||
position = Vector2(0, 2)
|
||||
shape = SubResource("CapsuleShape2D_player")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="." unique_id=1136280684]
|
||||
zoom = Vector2(2, 2)
|
||||
limit_left = 0
|
||||
limit_top = 0
|
||||
limit_right = 468
|
||||
limit_bottom = 270
|
||||
position_smoothing_enabled = true
|
||||
position_smoothing_speed = 6.0
|
||||
script = ExtResource("3_dqkch")
|
||||
|
||||
[node name="idel" type="Sprite2D" parent="." unique_id=1841773488]
|
||||
texture = ExtResource("3_qhqgy")
|
||||
@@ -0,0 +1,17 @@
|
||||
[gd_scene format=3 uid="uid://c6nnj5n0p8hew"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cb8de6nm1sbvw" path="res://assets/game/collectibles/coin_gold_round.png" id="1_texture"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="Shape_coin"]
|
||||
radius = 5.0
|
||||
|
||||
[node name="CoinGoldRound" type="Area2D" unique_id=480374752 groups=["collectible"]]
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="." unique_id=1188104520]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
[node name="PickupArea" type="CollisionShape2D" parent="." unique_id=1101990910]
|
||||
shape = SubResource("Shape_coin")
|
||||
@@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/collectibles/coin_gold_thin.png" id="1_texture"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Shape_coin"]
|
||||
size = Vector2(7, 13)
|
||||
|
||||
[node name="CoinGoldThin" type="Area2D" groups=["collectible"]]
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
[node name="PickupArea" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("Shape_coin")
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/collectibles/gem_blue.png" id="1_texture"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="Shape_gem"]
|
||||
radius = 6.0
|
||||
|
||||
[node name="GemBlue" type="Area2D" groups=["collectible"]]
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
[node name="PickupArea" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("Shape_gem")
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=5 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_canopy_left.png" id="1_left"]
|
||||
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_canopy_middle.png" id="2_middle"]
|
||||
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_canopy_right.png" id="3_right"]
|
||||
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_trunk.png" id="4_trunk"]
|
||||
|
||||
[node name="TreeSmall" type="Node2D"]
|
||||
|
||||
[node name="CanopyLeft" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(-18, -18)
|
||||
texture = ExtResource("1_left")
|
||||
|
||||
[node name="CanopyMiddle" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -18)
|
||||
texture = ExtResource("2_middle")
|
||||
|
||||
[node name="CanopyRight" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(18, -18)
|
||||
texture = ExtResource("3_right")
|
||||
|
||||
[node name="Trunk" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("4_trunk")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
extends Area2D
|
||||
|
||||
var damage = 1
|
||||
|
||||
func _ready():
|
||||
body_entered.connect(_on_body_entered)
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.is_in_group("player"):
|
||||
body.take_damage(damage)
|
||||
@@ -0,0 +1 @@
|
||||
uid://3ugbvq1iadqi
|
||||
@@ -0,0 +1,20 @@
|
||||
[gd_scene format=3 uid="uid://dh3mm14yem44n"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://3ugbvq1iadqi" path="res://scenes/prefabs/hazards/spikes_double.gd" id="1_hlpjn"]
|
||||
[ext_resource type="Texture2D" uid="uid://wmoyejtjsmhh" 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" unique_id=1646987965 groups=["hazard"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_hlpjn")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="." unique_id=997342456]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
[node name="DetectionArea" type="CollisionShape2D" parent="." unique_id=997417100]
|
||||
position = Vector2(0, 4)
|
||||
shape = SubResource("Shape_spikes")
|
||||
@@ -0,0 +1,21 @@
|
||||
extends Area2D
|
||||
|
||||
var ok = true
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
body_entered.connect(_in)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _in(body):
|
||||
if body.is_in_group("player") and body.velocity.y > 0 and ok :
|
||||
body.velocity.y = -300
|
||||
body.reset_jump()
|
||||
ok = false
|
||||
get_tree().create_timer(0.2).timeout.connect(reset)
|
||||
|
||||
func reset():
|
||||
ok = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://dffa4gfegesjp
|
||||
@@ -0,0 +1,20 @@
|
||||
[gd_scene format=3 uid="uid://jbye06it1ov5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dffa4gfegesjp" path="res://scenes/prefabs/interactables/spring_red.gd" id="1_i3l3r"]
|
||||
[ext_resource type="Texture2D" uid="uid://b7wkoed3ty7em" path="res://assets/game/interactables/spring_red.png" id="1_texture"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Shape_spring"]
|
||||
size = Vector2(14, 6)
|
||||
|
||||
[node name="SpringRed" type="Area2D" unique_id=742449581 groups=["spring"]]
|
||||
collision_layer = 8
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_i3l3r")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="." unique_id=183929814]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
[node name="ActivationArea" type="CollisionShape2D" parent="." unique_id=716768850]
|
||||
position = Vector2(0, -2)
|
||||
shape = SubResource("Shape_spring")
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/signs/direction_sign_left.png" id="1_texture"]
|
||||
|
||||
[node name="DirectionSignLeft" type="Node2D"]
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/signs/direction_sign_right.png" id="1_texture"]
|
||||
|
||||
[node name="DirectionSignRight" type="Node2D"]
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://assets/game/structures/crate.png" id="1_texture"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Shape_crate"]
|
||||
size = Vector2(18, 18)
|
||||
|
||||
[node name="Crate" type="StaticBody2D"]
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_texture")
|
||||
|
||||
[node name="Collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("Shape_crate")
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
extends Area2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
body_entered.connect(take_damage)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func take_damage(body):
|
||||
if body.is_in_group("player"):
|
||||
body.take_damage(1)
|
||||
if body.health <= 0:
|
||||
return
|
||||
body.global_position = body.respownpoint
|
||||
@@ -0,0 +1 @@
|
||||
uid://ddyxjw2uld32p
|
||||
Reference in New Issue
Block a user