diff --git a/Items/BounceWandCollectable.gd b/Items/BounceWandCollectable.gd new file mode 100644 index 0000000..34cdb88 --- /dev/null +++ b/Items/BounceWandCollectable.gd @@ -0,0 +1,6 @@ +extends Collectable + +func _on_Area2D_body_entered(body): + if body.get("Inventory") != null: + body.Inventory.add_item(Globals.Conduit3) + queue_free() diff --git a/Items/Basic Wand Pickup.tscn b/Items/BounceWandCollectable.tscn similarity index 73% rename from Items/Basic Wand Pickup.tscn rename to Items/BounceWandCollectable.tscn index 397afbe..b042cc1 100644 --- a/Items/Basic Wand Pickup.tscn +++ b/Items/BounceWandCollectable.tscn @@ -1,14 +1,14 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://art/Wand.png" type="Texture" id=1] -[ext_resource path="res://script/basic_wand_collectable.gd" type="Script" id=2] +[ext_resource path="res://art/BouncingWand.png" type="Texture" id=1] +[ext_resource path="res://Items/BounceWandCollectable.gd" type="Script" id=2] [sub_resource type="Animation" id=1] resource_name = "Bounce" length = 2.0 loop = true tracks/0/type = "value" -tracks/0/path = NodePath("Wand Pickup:position") +tracks/0/path = NodePath("Sprite:position") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false @@ -23,13 +23,12 @@ tracks/0/keys = { [sub_resource type="CircleShape2D" id=2] radius = 9.05539 -[node name="Area2D" type="Area2D"] +[node name="BounceWandPickup" type="Area2D"] monitorable = false collision_layer = 0 script = ExtResource( 2 ) -[node name="Wand Pickup" type="Sprite" parent="."] -position = Vector2( 0, -1.83113 ) +[node name="Sprite" type="Sprite" parent="."] texture = ExtResource( 1 ) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/Items/ChargeWandCollectable.gd b/Items/ChargeWandCollectable.gd new file mode 100644 index 0000000..fafefaf --- /dev/null +++ b/Items/ChargeWandCollectable.gd @@ -0,0 +1,6 @@ +extends Collectable + +func _on_Area2D_body_entered(body): + if body.get("Inventory") != null: + body.Inventory.add_item(Globals.Conduit1) + queue_free() diff --git a/Items/ChargeWandPickup.tscn b/Items/ChargeWandPickup.tscn new file mode 100644 index 0000000..f0f397d --- /dev/null +++ b/Items/ChargeWandPickup.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://art/Wand.png" type="Texture" id=2] + +[sub_resource type="Animation" id=1] +resource_name = "Bounce" +length = 2.0 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.5, 1.5 ), +"transitions": PoolRealArray( 1, 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 0, 2 ), Vector2( 0, -2 ) ] +} + +[sub_resource type="CircleShape2D" id=2] +radius = 9.05539 + +[node name="ChargeWandPickup" type="Area2D"] +monitorable = false +collision_layer = 0 + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 2 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "Bounce" +anims/Bounce = SubResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 2 ) +[connection signal="body_entered" from="." to="." method="_on_Area2D_body_entered"] diff --git a/Items/PrismWandPickup.gd b/Items/PrismWandPickup.gd new file mode 100644 index 0000000..54ba690 --- /dev/null +++ b/Items/PrismWandPickup.gd @@ -0,0 +1,6 @@ +extends Collectable + +func _on_Area2D_body_entered(body): + if body.get("Inventory") != null: + body.Inventory.add_item(Globals.Conduit4) + queue_free() diff --git a/Items/PrismWandPickup.tscn b/Items/PrismWandPickup.tscn new file mode 100644 index 0000000..3664215 --- /dev/null +++ b/Items/PrismWandPickup.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://art/PrismaticWand.png" type="Texture" id=1] +[ext_resource path="res://Items/PrismWandPickup.gd" type="Script" id=2] + +[sub_resource type="Animation" id=1] +resource_name = "Bounce" +length = 2.0 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.5, 1.5 ), +"transitions": PoolRealArray( 1, 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 0, 2 ), Vector2( 0, -2 ) ] +} + +[sub_resource type="CircleShape2D" id=2] +radius = 9.05539 + +[node name="PrismWandPickup" type="Area2D"] +monitorable = false +collision_layer = 0 +script = ExtResource( 2 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 1 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "Bounce" +anims/Bounce = SubResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 2 ) +[connection signal="body_entered" from="." to="." method="_on_Area2D_body_entered"] diff --git a/Items/TripleWandPickup.gd b/Items/TripleWandPickup.gd new file mode 100644 index 0000000..4b37b49 --- /dev/null +++ b/Items/TripleWandPickup.gd @@ -0,0 +1,6 @@ +extends Area2D + +func _on_Area2D_body_entered(body): + if body.get("Inventory") != null: + body.Inventory.add_item(Globals.Conduit2) + queue_free() diff --git a/Items/TripleWandPickup.tscn b/Items/TripleWandPickup.tscn new file mode 100644 index 0000000..a1c63dd --- /dev/null +++ b/Items/TripleWandPickup.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://Items/TripleWandPickup.gd" type="Script" id=1] +[ext_resource path="res://art/TripleWand.png" type="Texture" id=2] + +[sub_resource type="Animation" id=1] +resource_name = "Bounce" +length = 2.0 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.5, 1.5 ), +"transitions": PoolRealArray( 1, 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 0, 2 ), Vector2( 0, -2 ) ] +} + +[sub_resource type="CircleShape2D" id=2] +radius = 9.05539 + +[node name="TripleWand" type="Area2D"] +monitorable = false +collision_layer = 0 +script = ExtResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 2 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "Bounce" +anims/Bounce = SubResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 2 ) +[connection signal="body_entered" from="." to="." method="_on_Area2D_body_entered"] diff --git a/levels/test.tscn b/levels/test.tscn index a970ad0..a91bc61 100644 --- a/levels/test.tscn +++ b/levels/test.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://characters/Player.tscn" type="PackedScene" id=1] [ext_resource path="res://meta/DungeonTilemap.tscn" type="PackedScene" id=2] [ext_resource path="res://ai/ogre.tscn" type="PackedScene" id=3] +[ext_resource path="res://Items/TripleWandPickup.tscn" type="PackedScene" id=4] [node name="Node2D" type="Node2D"] @@ -14,3 +15,6 @@ position = Vector2( 252, 170 ) [node name="TileMap" parent="." instance=ExtResource( 2 )] tile_data = PoolIntArray( 65536, 0, 8, 65537, 0, 10, 65538, 0, 10, 65539, 0, 10, 65540, 0, 10, 65541, 0, 10, 65542, 0, 10, 65543, 0, 10, 65544, 0, 10, 65545, 0, 10, 65546, 0, 10, 65547, 0, 10, 65548, 0, 10, 65549, 0, 10, 65550, 0, 10, 65551, 0, 10, 65552, 0, 10, 65553, 0, 10, 65554, 0, 10, 65555, 0, 10, 65556, 0, 11, 131072, 0, 65544, 131073, 0, 131078, 131074, 0, 196617, 131075, 0, 196617, 131076, 0, 196617, 131077, 0, 196617, 131078, 0, 196617, 131079, 0, 196617, 131080, 0, 196617, 131081, 0, 196617, 131082, 0, 196617, 131083, 0, 196617, 131084, 0, 196617, 131085, 0, 196617, 131086, 0, 196617, 131087, 0, 196617, 131088, 0, 196617, 131089, 0, 196617, 131090, 0, 196617, 131091, 0, 131077, 131092, 0, 131083, 196608, 0, 65544, 196609, 0, 131083, 196627, 0, 65544, 196628, 0, 131083, 262144, 0, 65544, 262145, 0, 131083, 262163, 0, 65544, 262164, 0, 131083, 327680, 0, 65544, 327681, 0, 131083, 327699, 0, 65544, 327700, 0, 131083, 393216, 0, 65544, 393217, 0, 131083, 393235, 0, 65544, 393236, 0, 131083, 458752, 0, 65544, 458753, 0, 131083, 458771, 0, 65544, 458772, 0, 131083, 524288, 0, 65544, 524289, 0, 131083, 524307, 0, 65544, 524308, 0, 131083, 589824, 0, 65544, 589825, 0, 131083, 589843, 0, 65544, 589844, 0, 131083, 655360, 0, 65544, 655361, 0, 131083, 655379, 0, 65544, 655380, 0, 131083, 720896, 0, 65544, 720897, 0, 65542, 720898, 0, 10, 720899, 0, 10, 720900, 0, 10, 720901, 0, 10, 720902, 0, 10, 720903, 0, 10, 720904, 0, 10, 720905, 0, 10, 720906, 0, 10, 720907, 0, 10, 720908, 0, 10, 720909, 0, 10, 720910, 0, 10, 720911, 0, 10, 720912, 0, 10, 720913, 0, 10, 720914, 0, 10, 720915, 0, 65541, 720916, 0, 131083, 786432, 0, 196616, 786433, 0, 196617, 786434, 0, 196617, 786435, 0, 196617, 786436, 0, 196617, 786437, 0, 196617, 786438, 0, 196617, 786439, 0, 196617, 786440, 0, 196617, 786441, 0, 196617, 786442, 0, 196617, 786443, 0, 196617, 786444, 0, 196617, 786445, 0, 196617, 786446, 0, 196617, 786447, 0, 196617, 786448, 0, 196617, 786449, 0, 196617, 786450, 0, 196617, 786451, 0, 196617, 786452, 0, 196619 ) + +[node name="TripleWand" parent="." instance=ExtResource( 4 )] +position = Vector2( 100, 163 ) diff --git a/project.godot b/project.godot index d3dcc24..71a858f 100644 --- a/project.godot +++ b/project.godot @@ -97,32 +97,29 @@ texture={ [input] -ui_up={ -"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":16777232,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) - ] -} up={ "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":32,"unicode":0,"echo":false,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) ] } down={ "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":83,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) ] } left={ "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":65,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) ] } right={ "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,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) ] } shoot={ diff --git a/script/basic_wand_collectable.gd b/script/basic_wand_collectable.gd index 45fbf40..fafefaf 100644 --- a/script/basic_wand_collectable.gd +++ b/script/basic_wand_collectable.gd @@ -1,6 +1,5 @@ extends Collectable - func _on_Area2D_body_entered(body): if body.get("Inventory") != null: body.Inventory.add_item(Globals.Conduit1) diff --git a/ui/Inventory.tscn b/ui/Inventory.tscn index e4b32b0..185623b 100644 --- a/ui/Inventory.tscn +++ b/ui/Inventory.tscn @@ -57,6 +57,7 @@ texture = ExtResource( 1 ) [node name="Conduits" type="Node2D" parent="Inventory"] [node name="Conduit1" type="TextureButton" parent="Inventory/Conduits"] +visible = false light_mask = -2147483647 margin_left = -79.0 margin_top = -30.0 @@ -72,6 +73,7 @@ __meta__ = { } [node name="Conduit2" type="TextureButton" parent="Inventory/Conduits"] +visible = false light_mask = -2147483647 margin_left = -58.0 margin_top = -30.0 @@ -86,6 +88,7 @@ __meta__ = { } [node name="Conduit3" type="TextureButton" parent="Inventory/Conduits"] +visible = false light_mask = -2147483647 margin_left = -81.0 margin_top = -8.0 @@ -100,6 +103,7 @@ __meta__ = { } [node name="Conduit4" type="TextureButton" parent="Inventory/Conduits"] +visible = false light_mask = -2147483647 margin_left = -58.0 margin_top = -8.0