Skip to content

Commit

Permalink
changed default cell size to 128 in the Godot settings, made it so th…
Browse files Browse the repository at this point in the history
…at the artifacts disappear and emit a signal when then are entered
  • Loading branch information
acknapp committed Jan 30, 2022
1 parent f43a53e commit dd9157d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions World/Artifact.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends Area2D

signal stolen

func _on_Artifact_body_entered(body):
$Sprite.visible = false
emit_signal("stolen")
6 changes: 5 additions & 1 deletion World/Artifact.tscn
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]

[ext_resource path="res://assets/entities/Artefact Mirror.png" type="Texture" id=1]
[ext_resource path="res://World/Artifact.gd" type="Script" id=2]

[sub_resource type="CircleShape2D" id=1]
radius = 16.0

[node name="Artifact" type="Area2D"]
scale = Vector2( 2, 2 )
script = ExtResource( 2 )

[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, 8 )
texture = ExtResource( 1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )

[connection signal="body_entered" from="." to="." method="_on_Artifact_body_entered"]
8 changes: 6 additions & 2 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ window/size/height=900

disguise_tiger={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":84,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":84,"unicode":0,"echo":false,"script":null)
]
}
disguise_dragon={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
]
}
tilesize={
Expand All @@ -55,3 +55,7 @@ common/enable_pause_aware_picking=true
[rendering]

environment/default_environment="res://default_env.tres"

[world]

2d/cell_size=128

0 comments on commit dd9157d

Please sign in to comment.