Merge branch 'main' into Space-level

This commit is contained in:
Jane Cho
2021-12-09 18:34:56 -06:00
committed by GitHub
85 changed files with 2220 additions and 467 deletions

View File

@@ -0,0 +1,10 @@
extends Area2D
signal coin_grabbed
func _on_Node2D_body_entered(body: Node) -> void:
if body.get_name() == 'Player':
emit_signal("coin_grabbed")
print("coin!")
queue_free()

View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Levels/Interactables/Coin.gd" type="Script" id=1]
[ext_resource path="res://Sprites/Assets/coin.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
radius = 6.38067
[node name="coin" type="Area2D"]
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, 1 )
texture = ExtResource( 2 )
[node name="coin" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[connection signal="body_entered" from="." to="." method="_on_Node2D_body_entered"]

View File

@@ -0,0 +1,11 @@
extends Area2D
signal enter_level(level)
export var level_path: String = 'res://Levels/LEVEL.tscn'
func _on_level_portal_body_entered(body: Node) -> void:
if body.is_in_group('player'):
emit_signal('enter_level', level_path)
return

View File

@@ -0,0 +1,28 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Sprites/Levels/Interactables/Level_Portal.png" type="Texture" id=1]
[ext_resource path="res://Levels/Interactables/Level Portal.gd" type="Script" id=2]
[sub_resource type="CapsuleShape2D" id=1]
radius = 8.0
height = 18.0
[node name="Level Portal" type="Area2D"]
light_mask = 0
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
offset = Vector2( 0, -8 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
light_mask = 0
position = Vector2( 0, -8 )
shape = SubResource( 1 )
[connection signal="body_entered" from="." to="." method="_on_level_portal_body_entered"]

View File

@@ -38,10 +38,10 @@ shape = SubResource( 2 )
[node name="Unlock" type="Area2D" parent="."]
light_mask = 0
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
collision_layer = 0
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Unlock"]
visible = false