Added interacted signal to player. Removed deprecated tips
This commit is contained in:
@@ -3,6 +3,7 @@ extends CharacterBody2D
|
|||||||
|
|
||||||
|
|
||||||
signal dead
|
signal dead
|
||||||
|
signal interacted
|
||||||
|
|
||||||
|
|
||||||
const PICKUP_OFFSET = 16.0
|
const PICKUP_OFFSET = 16.0
|
||||||
@@ -55,6 +56,9 @@ func _physics_process(delta: float) -> void:
|
|||||||
if is_dead:
|
if is_dead:
|
||||||
_slow_down(delta*3)
|
_slow_down(delta*3)
|
||||||
else:
|
else:
|
||||||
|
if Input.is_action_just_pressed("interact"):
|
||||||
|
interacted.emit()
|
||||||
|
|
||||||
if Input.is_action_just_pressed("jump"):
|
if Input.is_action_just_pressed("jump"):
|
||||||
jump_buffer_timer.start()
|
jump_buffer_timer.start()
|
||||||
|
|
||||||
|
|||||||
+41
-39
File diff suppressed because one or more lines are too long
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://bgs6j6ak5qnq1"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_0act5"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pnn6n"]
|
|
||||||
atlas = ExtResource("1_0act5")
|
|
||||||
region = Rect2(48, 96, 32, 32)
|
|
||||||
|
|
||||||
[node name="InteractionKbd" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_pnn6n")
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://c0cae3bivcnal"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_fjtec"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ow2w5"]
|
|
||||||
atlas = ExtResource("1_fjtec")
|
|
||||||
region = Rect2(112, 96, 32, 32)
|
|
||||||
|
|
||||||
[node name="InteractionPad" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_ow2w5")
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://pw8xqtpauy57"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_gth0n"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wa8xe"]
|
|
||||||
atlas = ExtResource("1_gth0n")
|
|
||||||
region = Rect2(0, 96, 48, 32)
|
|
||||||
|
|
||||||
[node name="JumpKbd" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_wa8xe")
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://3372ayctb2ed"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_206pc"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6w0xc"]
|
|
||||||
atlas = ExtResource("1_206pc")
|
|
||||||
region = Rect2(80, 96, 32, 32)
|
|
||||||
|
|
||||||
[node name="JumpPad" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_6w0xc")
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://cemhsfdru4pv6"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_pa6ll"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v0og1"]
|
|
||||||
atlas = ExtResource("1_pa6ll")
|
|
||||||
region = Rect2(0, 64, 48, 32)
|
|
||||||
|
|
||||||
[node name="MovementKbd" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_v0og1")
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://tipop68pyrf7"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_crf2r"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_00r84"]
|
|
||||||
atlas = ExtResource("1_crf2r")
|
|
||||||
region = Rect2(80, 48, 32, 48)
|
|
||||||
|
|
||||||
[node name="MovementPad" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_00r84")
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://deo60sij43ibm"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_t6r5l"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lviuj"]
|
|
||||||
atlas = ExtResource("1_t6r5l")
|
|
||||||
region = Rect2(0, 128, 48, 32)
|
|
||||||
|
|
||||||
[node name="SwitchKbd" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_lviuj")
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://f70xseggdimg"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_d2iw1"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nyhjv"]
|
|
||||||
atlas = ExtResource("1_d2iw1")
|
|
||||||
region = Rect2(112, 64, 32, 32)
|
|
||||||
|
|
||||||
[node name="SwitchPad" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_nyhjv")
|
|
||||||
@@ -16,8 +16,10 @@ func _ready() -> void:
|
|||||||
func _on_body_entered(body: Node2D) -> void:
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
if body is Player:
|
if body is Player:
|
||||||
hint_sprite.show()
|
hint_sprite.show()
|
||||||
|
body.interacted.connect(activate)
|
||||||
|
|
||||||
|
|
||||||
func _on_body_exited(body: Node2D) -> void:
|
func _on_body_exited(body: Node2D) -> void:
|
||||||
if body is Player:
|
if body is Player:
|
||||||
hint_sprite.hide()
|
hint_sprite.hide()
|
||||||
|
body.interacted.disconnect(activate)
|
||||||
|
|||||||
Reference in New Issue
Block a user