bad commit message
This commit is contained in:
11
Items/Item.gd
Normal file
11
Items/Item.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Area2D
|
||||
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
func _on_Item_body_entered(body):
|
||||
if body.is_in_group("Balls"):
|
||||
print("item picked up")
|
||||
queue_free()
|
18
Items/Item.tscn
Normal file
18
Items/Item.tscn
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Items/Item.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 35.0
|
||||
|
||||
[node name="Item" type="Area2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_Item_body_entered"]
|
Reference in New Issue
Block a user