Collectable WIP
This commit is contained in:
parent
c6a3fb35cb
commit
d358b436df
|
@ -1,3 +1,6 @@
|
||||||
extends RigidBody2D
|
extends Area2D
|
||||||
|
|
||||||
contact
|
|
||||||
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
|
if body.name == "player":
|
||||||
|
print("meow")
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
[gd_scene load_steps=4 format=3 uid="uid://darxbklsgh23m"]
|
[gd_scene load_steps=5 format=3 uid="uid://darxbklsgh23m"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dmyoo12ntx27" path="res://collect_crystal.gd" id="1_ttvq1"]
|
[ext_resource type="Script" uid="uid://dmyoo12ntx27" path="res://collect_crystal.gd" id="1_ttvq1"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bm245ox8exhlr" path="res://Template mew 1 front-4.png.png" id="2_4nrqi"]
|
[ext_resource type="Texture2D" uid="uid://bm245ox8exhlr" path="res://Template mew 1 front-4.png.png" id="2_4nrqi"]
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="SpriteFrames_lmbvg"]
|
[sub_resource type="SpriteFrames" id="SpriteFrames_4nrqi"]
|
||||||
animations = [{
|
animations = [{
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
|
@ -14,8 +14,18 @@ animations = [{
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}]
|
}]
|
||||||
|
|
||||||
[node name="RigidBody2D" type="RigidBody2D"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_lmbvg"]
|
||||||
|
radius = 17.0
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D"]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 0
|
||||||
script = ExtResource("1_ttvq1")
|
script = ExtResource("1_ttvq1")
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
sprite_frames = SubResource("SpriteFrames_lmbvg")
|
sprite_frames = SubResource("SpriteFrames_4nrqi")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("CircleShape2D_lmbvg")
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
[gd_scene load_steps=3 format=4 uid="uid://ccjb75bercbw8"]
|
[gd_scene load_steps=4 format=4 uid="uid://ccjb75bercbw8"]
|
||||||
|
|
||||||
[ext_resource type="TileSet" uid="uid://xnedi1edel2b" path="res://tileMaps/baseTileset.tres" id="1_a7uaa"]
|
[ext_resource type="TileSet" uid="uid://xnedi1edel2b" path="res://tileMaps/baseTileset.tres" id="1_a7uaa"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c1xy5bf2p6vmh" path="res://player.tscn" id="2_lsvd3"]
|
[ext_resource type="PackedScene" uid="uid://c1xy5bf2p6vmh" path="res://player.tscn" id="2_lsvd3"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://darxbklsgh23m" path="res://collectableCrystal.tscn" id="3_x45i2"]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
|
@ -18,3 +19,6 @@ collision_enabled = false
|
||||||
|
|
||||||
[node name="CharacterBody2D" parent="." instance=ExtResource("2_lsvd3")]
|
[node name="CharacterBody2D" parent="." instance=ExtResource("2_lsvd3")]
|
||||||
position = Vector2(373, 125)
|
position = Vector2(373, 125)
|
||||||
|
|
||||||
|
[node name="Area2D" parent="." instance=ExtResource("3_x45i2")]
|
||||||
|
position = Vector2(401, 240)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user