diff --git a/Title/Tilte.tscn b/Title/Tilte.tscn deleted file mode 100644 index ffdef54..0000000 --- a/Title/Tilte.tscn +++ /dev/null @@ -1,47 +0,0 @@ -[gd_scene load_steps=8 format=2] - -[ext_resource path="res://Title/Quit 1.png" type="Texture" id=1] -[ext_resource path="res://Title/Wizard Background.png" type="Texture" id=2] -[ext_resource path="res://Title/Quit 2.png" type="Texture" id=3] -[ext_resource path="res://Title/Play 1.png" type="Texture" id=4] -[ext_resource path="res://Title/Play 2.png" type="Texture" id=5] -[ext_resource path="res://Title/Tilte.gd" type="Script" id=6] -[ext_resource path="res://Music and Fonts(Misc.)/Hawaii Partii - Labyrinth (8-Bit).wav" type="AudioStream" id=7] - -[node name="Title" type="Node"] -script = ExtResource( 6 ) - -[node name="Sprite" type="Sprite" parent="."] -texture = ExtResource( 2 ) -centered = false - -[node name="TextureButton" type="TextureButton" parent="."] -margin_left = 0.989594 -margin_top = 73.7678 -margin_right = 120.99 -margin_bottom = 124.768 -texture_normal = ExtResource( 4 ) -texture_hover = ExtResource( 5 ) -expand = true -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="TextureButton2" type="TextureButton" parent="."] -margin_left = 1.0 -margin_top = 128.0 -margin_right = 125.0 -margin_bottom = 179.0 -texture_normal = ExtResource( 1 ) -texture_hover = ExtResource( 3 ) -expand = true -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 7 ) -volume_db = -36.349 -autoplay = true -[connection signal="pressed" from="TextureButton" to="." method="_on_TextureButton_pressed"] -[connection signal="pressed" from="TextureButton2" to="." method="_on_TextureButton2_pressed"] diff --git a/art/WhiteProjectile.png b/art/WhiteProjectile.png index a4113d8..7660397 100644 Binary files a/art/WhiteProjectile.png and b/art/WhiteProjectile.png differ diff --git a/characters/Player.tscn b/characters/Player.tscn index 2f9ef45..34a26f3 100644 --- a/characters/Player.tscn +++ b/characters/Player.tscn @@ -1,15 +1,17 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://script/player.gd" type="Script" id=1] [ext_resource path="res://meta/BoundedCamera.tscn" type="PackedScene" id=2] [ext_resource path="res://script/PlayerStateMachine.gd" type="Script" id=3] -[ext_resource path="res://art/WizardM.png" type="Texture" id=4] +[ext_resource path="res://art/Wand.png" type="Texture" id=4] +[ext_resource path="res://art/WizardM.png" type="Texture" id=5] [sub_resource type="OccluderPolygon2D" id=1] polygon = PoolVector2Array( -7, 0, -7, -2, -6, -2, -6, -3, -5, -3, -5, -5, -6, -5, -6, -10, -7, -10, -7, -12, -6, -12, -6, -19, -4, -19, -4, -18, -3, -18, -3, -17, 1, -17, 1, -16, 3, -16, 3, -15, 4, -15, 4, -14, 5, -14, 5, -13, 6, -13, 6, -12, 7, -12, 7, -10, 6, -10, 6, -9, 5, -9, 5, -8, 6, -8, 6, -4, 5, -4, 5, 0, -7, 0 ) -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 6, 6 ) +[sub_resource type="CapsuleShape2D" id=2] +radius = 6.0 +height = 2.0 [sub_resource type="Animation" id=3] resource_name = "Idle" @@ -61,6 +63,7 @@ tracks/0/keys = { } [node name="Player" type="KinematicBody2D"] +collision_mask = 2 script = ExtResource( 1 ) [node name="Node2D" parent="." instance=ExtResource( 2 )] @@ -74,9 +77,22 @@ drag_margin_bottom = 0.0 [node name="PlayerStateMachine" type="Node" parent="."] script = ExtResource( 3 ) +[node name="HoldPosition" type="Position2D" parent="."] +position = Vector2( 0, -6 ) +rotation = 1.5708 + +[node name="Wand" type="Sprite" parent="HoldPosition"] +position = Vector2( 10, 0 ) +rotation = 1.5708 +texture = ExtResource( 4 ) + +[node name="ProjectileSpawn" type="Position2D" parent="HoldPosition"] +position = Vector2( 17, -9.53674e-007 ) +rotation = 1.5708 + [node name="Sprite" type="Sprite" parent="."] position = Vector2( 0, -12 ) -texture = ExtResource( 4 ) +texture = ExtResource( 5 ) vframes = 3 hframes = 4 @@ -85,8 +101,9 @@ visible = false position = Vector2( 0, 12 ) occluder = SubResource( 1 ) -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 0, -6 ) +[node name="WorldCollision" type="CollisionShape2D" parent="."] +visible = false +position = Vector2( 0, -7 ) shape = SubResource( 2 ) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] @@ -97,4 +114,12 @@ anims/Running = SubResource( 5 ) [node name="CoyoteTimer" type="Timer" parent="."] wait_time = 0.1 one_shot = true + +[node name="Hitbox" type="Area2D" parent="."] +visible = false +position = Vector2( 0, -7 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hitbox"] +visible = false +polygon = PoolVector2Array( -6, -12, -6, -5, -7, -5, -7, -3, -6, -3, -6, 2, -5, 2, -5, 4, -6, 4, -6, 5, -7, 5, -7, 7, 5, 7, 5, 3, 6, 3, 6, -1, 5, -1, 5, -2, 6, -2, 6, -3, 7, -3, 7, -5, 6, -5, 6, -6, 5, -6, 5, -7, 4, -7, 4, -8, 3, -8, 3, -9, 1, -9, 1, -10, -3, -10, -3, -11, -4, -11, -4, -12, -6, -12 ) [connection signal="grounded_updated" from="." to="Node2D" method="_on_grounded_updated"] diff --git a/levels/Tilte.tscn b/levels/Tilte.tscn new file mode 100644 index 0000000..3468b81 --- /dev/null +++ b/levels/Tilte.tscn @@ -0,0 +1,41 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://levels/Tilte.gd" type="Script" id=1] +[ext_resource path="res://levels/Wizard Background.png" type="Texture" id=2] +[ext_resource path="res://levels/Play 1.png" type="Texture" id=3] +[ext_resource path="res://levels/Play 2.png" type="Texture" id=4] +[ext_resource path="res://levels/Quit 1.png" type="Texture" id=5] +[ext_resource path="res://levels/Quit 2.png" type="Texture" id=6] + +[node name="Title" type="Node"] +script = ExtResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 2 ) +centered = false + +[node name="TextureButton" type="TextureButton" parent="."] +margin_left = 0.989594 +margin_top = 73.7678 +margin_right = 120.99 +margin_bottom = 124.768 +texture_normal = ExtResource( 3 ) +texture_hover = ExtResource( 4 ) +expand = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureButton2" type="TextureButton" parent="."] +margin_left = 1.0 +margin_top = 128.0 +margin_right = 125.0 +margin_bottom = 179.0 +texture_normal = ExtResource( 5 ) +texture_hover = ExtResource( 6 ) +expand = true +__meta__ = { +"_edit_use_anchors_": false +} +[connection signal="pressed" from="TextureButton" to="." method="_on_TextureButton_pressed"] +[connection signal="pressed" from="TextureButton2" to="." method="_on_TextureButton2_pressed"] diff --git a/levels/World.tscn b/levels/World.tscn index a981a96..1481e8a 100644 --- a/levels/World.tscn +++ b/levels/World.tscn @@ -1,12 +1,12 @@ [gd_scene load_steps=10 format=2] -[ext_resource path="res://meta/DungeonTilemap.tscn" type="PackedScene" id=1] -[ext_resource path="res://characters/Player.tscn" type="PackedScene" id=2] -[ext_resource path="res://Music and Fonts(Misc.)/Tifax-AJ7g.ttf" type="DynamicFontData" id=3] -[ext_resource path="res://Music and Fonts(Misc.)/Hawaii Partii - Stranded Lullaby(8-Bit).wav" type="AudioStream" id=4] +[ext_resource path="res://Music and Fonts(Misc.)/Tifax-AJ7g.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://meta/DungeonTilemap.tscn" type="PackedScene" id=2] +[ext_resource path="res://Music and Fonts(Misc.)/Hawaii Partii - Stranded Lullaby(8-Bit).wav" type="AudioStream" id=3] +[ext_resource path="res://characters/Player.tscn" type="PackedScene" id=4] [sub_resource type="DynamicFont" id=1] -font_data = ExtResource( 3 ) +font_data = ExtResource( 1 ) [sub_resource type="Animation" id=2] resource_name = "Type Writer" @@ -153,14 +153,14 @@ __meta__ = { autoplay = "Type Writer" "anims/Type Writer" = SubResource( 5 ) -[node name="TileMap" parent="." instance=ExtResource( 1 )] +[node name="TileMap" parent="." instance=ExtResource( 2 )] position = Vector2( -5.81107, -6.20908 ) tile_data = PoolIntArray( 0, 0, 8, 1, 0, 10, 2, 0, 10, 3, 0, 10, 4, 0, 10, 5, 0, 10, 6, 0, 10, 7, 0, 10, 8, 0, 10, 9, 0, 10, 10, 0, 10, 11, 0, 10, 12, 0, 10, 13, 0, 10, 14, 0, 10, 15, 0, 10, 16, 0, 10, 17, 0, 10, 18, 0, 10, 19, 0, 10, 20, 0, 10, 21, 0, 10, 22, 0, 10, 23, 0, 10, 24, 0, 10, 25, 0, 10, 26, 0, 10, 27, 0, 10, 28, 0, 10, 29, 0, 10, 30, 0, 10, 31, 0, 10, 32, 0, 10, 33, 0, 10, 34, 0, 10, 35, 0, 10, 36, 0, 10, 37, 0, 10, 38, 0, 10, 39, 0, 10, 40, 0, 10, 41, 0, 10, 42, 0, 10, 43, 0, 10, 44, 0, 10, 45, 0, 10, 46, 0, 10, 47, 0, 10, 48, 0, 10, 49, 0, 10, 50, 0, 10, 51, 0, 10, 52, 0, 10, 53, 0, 10, 54, 0, 10, 55, 0, 10, 56, 0, 10, 57, 0, 10, 58, 0, 10, 59, 0, 10, 60, 0, 10, 61, 0, 10, 62, 0, 10, 63, 0, 10, 64, 0, 10, 65, 0, 10, 66, 0, 10, 67, 0, 10, 68, 0, 10, 69, 0, 10, 70, 0, 10, 71, 0, 10, 72, 0, 11, 65536, 0, 65544, 65537, 0, 131078, 65538, 0, 196617, 65539, 0, 196617, 65540, 0, 196617, 65541, 0, 196617, 65542, 0, 196617, 65543, 0, 196617, 65544, 0, 196617, 65545, 0, 196617, 65546, 0, 196617, 65547, 0, 196617, 65548, 0, 196617, 65549, 0, 196617, 65550, 0, 196617, 65551, 0, 196617, 65552, 0, 196617, 65553, 0, 196617, 65554, 0, 196617, 65555, 0, 131077, 65556, 0, 131081, 65557, 0, 131081, 65558, 0, 131081, 65559, 0, 131081, 65560, 0, 131081, 65561, 0, 131081, 65562, 0, 131081, 65563, 0, 131081, 65564, 0, 131081, 65565, 0, 131081, 65566, 0, 131081, 65567, 0, 131081, 65568, 0, 131081, 65569, 0, 131081, 65570, 0, 131081, 65571, 0, 131081, 65572, 0, 131081, 65573, 0, 131081, 65574, 0, 131081, 65575, 0, 131081, 65576, 0, 131081, 65577, 0, 131081, 65578, 0, 131081, 65579, 0, 131081, 65580, 0, 131081, 65581, 0, 131078, 65582, 0, 196617, 65583, 0, 196617, 65584, 0, 196617, 65585, 0, 196617, 65586, 0, 196617, 65587, 0, 196617, 65588, 0, 196617, 65589, 0, 196617, 65590, 0, 196617, 65591, 0, 196617, 65592, 0, 196617, 65593, 0, 196617, 65594, 0, 196617, 65595, 0, 196617, 65596, 0, 196617, 65597, 0, 196617, 65598, 0, 196617, 65599, 0, 196617, 65600, 0, 196617, 65601, 0, 196617, 65602, 0, 196617, 65603, 0, 196617, 65604, 0, 196617, 65605, 0, 196617, 65606, 0, 196617, 65607, 0, 196617, 65608, 0, 196619, 131072, 0, 65544, 131073, 0, 131083, 131091, 0, 65544, 131092, 0, 131081, 131093, 0, 131081, 131094, 0, 131081, 131095, 0, 131081, 131096, 0, 131081, 131097, 0, 131081, 131098, 0, 131081, 131099, 0, 131081, 131100, 0, 131081, 131101, 0, 131081, 131102, 0, 131081, 131103, 0, 131081, 131104, 0, 131081, 131105, 0, 131081, 131106, 0, 131081, 131107, 0, 131081, 131108, 0, 131081, 131109, 0, 131081, 131110, 0, 131081, 131111, 0, 131081, 131112, 0, 131081, 131113, 0, 131081, 131114, 0, 131081, 131115, 0, 131081, 131116, 0, 131081, 131117, 0, 131083, 196608, 0, 65544, 196609, 0, 131083, 196627, 0, 65544, 196628, 0, 131081, 196629, 0, 131081, 196630, 0, 131081, 196631, 0, 131081, 196632, 0, 131081, 196633, 0, 131081, 196634, 0, 131081, 196635, 0, 131081, 196636, 0, 131081, 196637, 0, 131081, 196638, 0, 131081, 196639, 0, 131081, 196640, 0, 131081, 196641, 0, 131081, 196642, 0, 131081, 196643, 0, 131081, 196644, 0, 131081, 196645, 0, 131081, 196646, 0, 131081, 196647, 0, 131081, 196648, 0, 131081, 196649, 0, 131081, 196650, 0, 131081, 196651, 0, 131081, 196652, 0, 131081, 196653, 0, 131083, 262144, 0, 65544, 262145, 0, 131083, 262163, 0, 65544, 262164, 0, 131081, 262165, 0, 131081, 262166, 0, 131081, 262167, 0, 131081, 262168, 0, 131081, 262169, 0, 131081, 262170, 0, 131081, 262171, 0, 131081, 262172, 0, 131081, 262173, 0, 131081, 262174, 0, 131081, 262175, 0, 131081, 262176, 0, 131081, 262177, 0, 131081, 262178, 0, 131081, 262179, 0, 131081, 262180, 0, 131081, 262181, 0, 131081, 262182, 0, 131081, 262183, 0, 131081, 262184, 0, 131081, 262185, 0, 131081, 262186, 0, 131081, 262187, 0, 131081, 262188, 0, 131081, 262189, 0, 131083, 327680, 0, 65544, 327681, 0, 131083, 327699, 0, 65544, 327700, 0, 131081, 327701, 0, 131081, 327702, 0, 131081, 327703, 0, 131081, 327704, 0, 131081, 327705, 0, 131081, 327706, 0, 131081, 327707, 0, 131081, 327708, 0, 131081, 327709, 0, 131081, 327710, 0, 131081, 327711, 0, 131081, 327712, 0, 131081, 327713, 0, 131081, 327714, 0, 131081, 327715, 0, 131081, 327716, 0, 131081, 327717, 0, 131081, 327718, 0, 131081, 327719, 0, 131081, 327720, 0, 131081, 327721, 0, 131081, 327722, 0, 131081, 327723, 0, 131081, 327724, 0, 131081, 327725, 0, 131083, 393216, 0, 65544, 393217, 0, 131083, 393235, 0, 196616, 393236, 0, 196617, 393237, 0, 196617, 393238, 0, 196617, 393239, 0, 196617, 393240, 0, 196617, 393241, 0, 196617, 393242, 0, 196617, 393243, 0, 196617, 393244, 0, 196617, 393245, 0, 196617, 393246, 0, 196617, 393247, 0, 196617, 393248, 0, 196617, 393249, 0, 196617, 393250, 0, 196617, 393251, 0, 196617, 393252, 0, 196617, 393253, 0, 196617, 393254, 0, 196617, 393255, 0, 196617, 393256, 0, 196617, 393257, 0, 196617, 393258, 0, 196617, 393259, 0, 196617, 393260, 0, 196617, 393261, 0, 196619, 458752, 0, 65544, 458753, 0, 131083, 524288, 0, 65544, 524289, 0, 131083, 589824, 0, 65544, 589825, 0, 131083, 655360, 0, 65544, 655361, 0, 65542, 655362, 0, 10, 655363, 0, 10, 655364, 0, 10, 655365, 0, 10, 655366, 0, 10, 655367, 0, 10, 655368, 0, 10, 655369, 0, 10, 655370, 0, 10, 655371, 0, 10, 655372, 0, 10, 655373, 0, 10, 655374, 0, 10, 655375, 0, 10, 655376, 0, 10, 655377, 0, 10, 655378, 0, 10, 655379, 0, 10, 655380, 0, 10, 655381, 0, 10, 655382, 0, 10, 655383, 0, 10, 655384, 0, 10, 655385, 0, 10, 655386, 0, 10, 655387, 0, 10, 655388, 0, 10, 655389, 0, 10, 655390, 0, 10, 655391, 0, 10, 655392, 0, 10, 655393, 0, 10, 655394, 0, 10, 655395, 0, 10, 655396, 0, 10, 655397, 0, 10, 655398, 0, 10, 655399, 0, 10, 655400, 0, 10, 655401, 0, 10, 655402, 0, 10, 655403, 0, 10, 655404, 0, 10, 655405, 0, 10, 655406, 0, 10, 655407, 0, 10, 655408, 0, 10, 655409, 0, 10, 655410, 0, 10, 655411, 0, 10, 655412, 0, 10, 655413, 0, 10, 655414, 0, 10, 655415, 0, 10, 655416, 0, 10, 655417, 0, 10, 655418, 0, 10, 655419, 0, 10, 655420, 0, 10, 655421, 0, 10, 655422, 0, 10, 655423, 0, 10, 655424, 0, 10, 655425, 0, 10, 655426, 0, 10, 655427, 0, 10, 655428, 0, 10, 655429, 0, 10, 655430, 0, 10, 655431, 0, 10, 655432, 0, 10, 655433, 0, 11, 720896, 0, 65544, 720897, 0, 131081, 720898, 0, 131081, 720899, 0, 131081, 720900, 0, 131081, 720901, 0, 131081, 720902, 0, 131081, 720903, 0, 131081, 720904, 0, 131081, 720905, 0, 131081, 720906, 0, 131081, 720907, 0, 131081, 720908, 0, 131081, 720909, 0, 131081, 720910, 0, 131081, 720911, 0, 131081, 720912, 0, 131081, 720913, 0, 131081, 720914, 0, 131081, 720915, 0, 131081, 720916, 0, 131081, 720917, 0, 131081, 720918, 0, 131081, 720919, 0, 131081, 720920, 0, 131081, 720921, 0, 131081, 720922, 0, 131081, 720923, 0, 131081, 720924, 0, 131081, 720925, 0, 131081, 720926, 0, 131081, 720927, 0, 131081, 720928, 0, 131081, 720929, 0, 131081, 720930, 0, 131081, 720931, 0, 131081, 720932, 0, 131081, 720933, 0, 131081, 720934, 0, 131081, 720935, 0, 131081, 720936, 0, 131081, 720937, 0, 131081, 720938, 0, 131081, 720939, 0, 131081, 720940, 0, 131081, 720941, 0, 131081, 720942, 0, 131081, 720943, 0, 131081, 720944, 0, 131081, 720945, 0, 131081, 720946, 0, 131081, 720947, 0, 131081, 720948, 0, 131081, 720949, 0, 131081, 720950, 0, 131081, 720951, 0, 131081, 720952, 0, 131081, 720953, 0, 131081, 720954, 0, 131081, 720955, 0, 131081, 720956, 0, 131081, 720957, 0, 131081, 720958, 0, 131081, 720959, 0, 131081, 720960, 0, 131081, 720961, 0, 131081, 720962, 0, 131081, 720963, 0, 131081, 720964, 0, 131081, 720965, 0, 131081, 720966, 0, 131081, 720967, 0, 131081, 720968, 0, 131081, 720969, 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, 196617, 786453, 0, 196617, 786454, 0, 196617, 786455, 0, 196617, 786456, 0, 196617, 786457, 0, 196617, 786458, 0, 196617, 786459, 0, 196617, 786460, 0, 196617, 786461, 0, 196617, 786462, 0, 196617, 786463, 0, 196617, 786464, 0, 196617, 786465, 0, 196617, 786466, 0, 196617, 786467, 0, 196617, 786468, 0, 196617, 786469, 0, 196617, 786470, 0, 196617, 786471, 0, 196617, 786472, 0, 196617, 786473, 0, 196617, 786474, 0, 196617, 786475, 0, 196617, 786476, 0, 196617, 786477, 0, 196617, 786478, 0, 196617, 786479, 0, 196617, 786480, 0, 196617, 786481, 0, 196617, 786482, 0, 196617, 786483, 0, 196617, 786484, 0, 196617, 786485, 0, 196617, 786486, 0, 196617, 786487, 0, 196617, 786488, 0, 196617, 786489, 0, 196617, 786490, 0, 196617, 786491, 0, 196617, 786492, 0, 196617, 786493, 0, 196617, 786494, 0, 196617, 786495, 0, 196617, 786496, 0, 196617, 786497, 0, 196617, 786498, 0, 196617, 786499, 0, 196617, 786500, 0, 196617, 786501, 0, 196617, 786502, 0, 196617, 786503, 0, 196617, 786504, 0, 196617, 786505, 0, 196619 ) [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 4 ) +stream = ExtResource( 3 ) volume_db = -21.204 autoplay = true -[node name="Player" parent="." instance=ExtResource( 2 )] +[node name="Player" parent="." instance=ExtResource( 4 )] position = Vector2( 39.6773, 71.1674 ) diff --git a/levels/test.tscn b/levels/test.tscn index 9997a31..cdf1a94 100644 --- a/levels/test.tscn +++ b/levels/test.tscn @@ -1,17 +1,14 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=3 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://magic/projectiles/WhiteProjectile.tscn" type="PackedScene" id=3] [node name="Node2D" type="Node2D"] -position = Vector2( -14, 0 ) [node name="Player" parent="." instance=ExtResource( 1 )] -position = Vector2( 169, 166 ) +position = Vector2( 152, 157 ) [node name="TileMap" parent="." instance=ExtResource( 2 )] -tile_data = PoolIntArray( 0, 0, 8, 1, 0, 10, 2, 0, 10, 3, 0, 10, 4, 0, 10, 5, 0, 10, 6, 0, 10, 7, 0, 10, 8, 0, 10, 9, 0, 10, 10, 0, 10, 11, 0, 10, 12, 0, 10, 13, 0, 10, 14, 0, 10, 15, 0, 10, 16, 0, 10, 17, 0, 10, 18, 0, 10, 19, 0, 10, 20, 0, 11, 65536, 0, 65544, 65537, 0, 131078, 65538, 0, 196617, 65539, 0, 196617, 65540, 0, 196617, 65541, 0, 196617, 65542, 0, 196617, 65543, 0, 196617, 65544, 0, 196617, 65545, 0, 196617, 65546, 0, 196617, 65547, 0, 196617, 65548, 0, 196617, 65549, 0, 196617, 65550, 0, 196617, 65551, 0, 196617, 65552, 0, 196617, 65553, 0, 196617, 65554, 0, 196617, 65555, 0, 131077, 65556, 0, 131083, 131072, 0, 65544, 131073, 0, 131083, 131091, 0, 65544, 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, 589830, 0, 0, 589843, 0, 65544, 589844, 0, 131083, 655360, 0, 65544, 655361, 0, 131083, 655366, 0, 65536, 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, 9, 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 ) +tile_data = PoolIntArray( 0, 0, 8, 1, 0, 10, 2, 0, 10, 3, 0, 10, 4, 0, 10, 5, 0, 10, 6, 0, 10, 7, 0, 10, 8, 0, 10, 9, 0, 10, 10, 0, 10, 11, 0, 10, 12, 0, 10, 13, 0, 10, 14, 0, 10, 15, 0, 10, 16, 0, 10, 17, 0, 10, 18, 0, 10, 19, 0, 10, 20, 0, 10, 21, 0, 11, 65536, 0, 65544, 65537, 0, 131078, 65538, 0, 196617, 65539, 0, 196617, 65540, 0, 196617, 65541, 0, 196617, 65542, 0, 196617, 65543, 0, 196617, 65544, 0, 196617, 65545, 0, 196617, 65546, 0, 196617, 65547, 0, 196617, 65548, 0, 196617, 65549, 0, 196617, 65550, 0, 196617, 65551, 0, 196617, 65552, 0, 196617, 65553, 0, 196617, 65554, 0, 196617, 65555, 0, 196617, 65556, 0, 131077, 65557, 0, 131083, 131072, 0, 65544, 131073, 0, 131083, 131092, 0, 65544, 131093, 0, 131083, 196608, 0, 65544, 196609, 0, 131083, 196628, 0, 65544, 196629, 0, 131083, 262144, 0, 65544, 262145, 0, 131083, 262164, 0, 65544, 262165, 0, 131083, 327680, 0, 65544, 327681, 0, 131083, 327700, 0, 65544, 327701, 0, 131083, 393216, 0, 65544, 393217, 0, 131083, 393236, 0, 65544, 393237, 0, 131083, 458752, 0, 65544, 458753, 0, 131083, 458772, 0, 65544, 458773, 0, 131083, 524288, 0, 65544, 524289, 0, 131083, 524308, 0, 65544, 524309, 0, 131083, 589824, 0, 65544, 589825, 0, 131083, 589844, 0, 65544, 589845, 0, 131083, 655360, 0, 65544, 655361, 0, 131083, 655380, 0, 65544, 655381, 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, 10, 720916, 0, 65541, 720917, 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, 196617, 786453, 0, 196619 ) -[node name="WhiteProjectile" parent="." instance=ExtResource( 3 )] -position = Vector2( 195, 158 ) +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/magic/projectiles/WhiteProjectile.tscn b/magic/projectiles/WhiteProjectile.tscn index 7601c60..d15ce7b 100644 --- a/magic/projectiles/WhiteProjectile.tscn +++ b/magic/projectiles/WhiteProjectile.tscn @@ -4,10 +4,11 @@ [ext_resource path="res://art/WhiteProjectile.png" type="Texture" id=2] [sub_resource type="CircleShape2D" id=1] -radius = 7.0 +radius = 4.0 [node name="WhiteProjectile" type="KinematicBody2D"] -scale = Vector2( 0.5, 0.5 ) +collision_layer = 8 +collision_mask = 2 script = ExtResource( 1 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/meta/DungeonTilemap.tres b/meta/DungeonTilemap.tres index 3c172d8..c0e7ee5 100644 --- a/meta/DungeonTilemap.tres +++ b/meta/DungeonTilemap.tres @@ -302,11 +302,6 @@ points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) 0/autotile/z_index_map = [ ] 0/occluder_offset = Vector2( 0, 0 ) 0/navigation_offset = Vector2( 0, 0 ) -0/shape_offset = Vector2( 0, 0 ) -0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) -0/shape = SubResource( 48 ) -0/shape_one_way = false -0/shape_one_way_margin = 1.0 0/shapes = [ { "autotile_coord": Vector2( 0, 0 ), "one_way": false, diff --git a/meta/DungeonTilemap.tscn b/meta/DungeonTilemap.tscn index d38d75a..1ade854 100644 --- a/meta/DungeonTilemap.tscn +++ b/meta/DungeonTilemap.tscn @@ -7,5 +7,7 @@ ]] tile_set = ExtResource( 1 ) cell_size = Vector2( 16, 16 ) +collision_layer = 2 +collision_mask = 0 format = 1 tile_data = PoolIntArray( 0, 0, 8, 1, 0, 10, 2, 0, 10, 3, 0, 10, 4, 0, 10, 5, 0, 10, 6, 0, 10, 7, 0, 10, 8, 0, 10, 9, 0, 10, 10, 0, 10, 11, 0, 10, 12, 0, 10, 13, 0, 10, 14, 0, 10, 15, 0, 10, 16, 0, 10, 17, 0, 10, 18, 0, 10, 19, 0, 10, 20, 0, 11, 65536, 0, 65544, 65537, 0, 131078, 65538, 0, 196617, 65539, 0, 196617, 65540, 0, 196617, 65541, 0, 196617, 65542, 0, 196617, 65543, 0, 196617, 65544, 0, 196617, 65545, 0, 196617, 65546, 0, 196617, 65547, 0, 196617, 65548, 0, 196617, 65549, 0, 196617, 65550, 0, 196617, 65551, 0, 196617, 65552, 0, 196617, 65553, 0, 196617, 65554, 0, 196617, 65555, 0, 131077, 65556, 0, 131083, 131072, 0, 65544, 131073, 0, 131083, 131091, 0, 65544, 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, 65542, 655362, 0, 10, 655363, 0, 10, 655364, 0, 10, 655365, 0, 10, 655366, 0, 10, 655367, 0, 10, 655368, 0, 10, 655369, 0, 10, 655370, 0, 10, 655371, 0, 10, 655372, 0, 10, 655373, 0, 10, 655374, 0, 10, 655375, 0, 10, 655376, 0, 10, 655377, 0, 10, 655378, 0, 10, 655379, 0, 65541, 655380, 0, 131083, 720896, 0, 196616, 720897, 0, 196617, 720898, 0, 196617, 720899, 0, 196617, 720900, 0, 196617, 720901, 0, 196617, 720902, 0, 196617, 720903, 0, 196617, 720904, 0, 196617, 720905, 0, 196617, 720906, 0, 196617, 720907, 0, 196617, 720908, 0, 196617, 720909, 0, 196617, 720910, 0, 196617, 720911, 0, 196617, 720912, 0, 196617, 720913, 0, 196617, 720914, 0, 196617, 720915, 0, 196617, 720916, 0, 196619 ) diff --git a/project.godot b/project.godot index 6999d34..c8ce3c9 100644 --- a/project.godot +++ b/project.godot @@ -27,7 +27,7 @@ _global_script_class_icons={ [application] config/name="Gamejam" -run/main_scene="res://Title/Tilte.tscn" +run/main_scene="res://levels/test.tscn" config/icon="res://icon.png" [autoload] @@ -35,6 +35,11 @@ config/icon="res://icon.png" UserData="*res://addons/github-integration/scripts/user_data.gd" IconLoaderGithub="*res://addons/github-integration/scripts/IconLoaderGithub.gd" RestHandler="*res://addons/github-integration/scripts/RestHandler.gd" +globals="*res://script/globals.gd" + +[debug] + +settings/fps/force_fps=60 [display] @@ -71,23 +76,12 @@ texture={ "stream": false, "svg/scale": 1.0 } -wav={ -"compress/mode": 0, -"edit/loop": true, -"edit/normalize": false, -"edit/trim": false, -"force/8_bit": false, -"force/max_rate": false, -"force/max_rate_hz": 44100, -"force/mono": false -} [input] 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) ] } down={ @@ -105,6 +99,18 @@ right={ "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) ] } +shoot={ +"deadzone": 0.5, +"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) + ] +} + +[layer_names] + +2d_physics/layer_1="Player" +2d_physics/layer_2="World" +2d_physics/layer_3="Enemy" +2d_physics/layer_4="Projectiles" [rendering] diff --git a/script/Projectile.gd b/script/Projectile.gd index 695fd11..464d852 100644 --- a/script/Projectile.gd +++ b/script/Projectile.gd @@ -9,8 +9,9 @@ func _physics_process(delta): if collision != null: on_impact() -func launch(direction: Vector2): - velocity = direction * speed +func launch(): + velocity = (Vector2(speed, 0)).rotated(rotation) + print(velocity) func on_impact(): queue_free() diff --git a/script/globals.gd b/script/globals.gd new file mode 100644 index 0000000..5054da9 --- /dev/null +++ b/script/globals.gd @@ -0,0 +1,4 @@ +extends Node + +const TILE_SIZE = 16 +const WHITE_PROJECTILE_PS = preload("res://magic/projectiles/WhiteProjectile.tscn") diff --git a/script/player.gd b/script/player.gd index db8ebd7..7660c8a 100644 --- a/script/player.gd +++ b/script/player.gd @@ -15,12 +15,15 @@ var walljump_height = 2.25 * 16 var jump_duration = 0.35 var is_grounded var touching_wall = 0 +var projectile_ps = globals.WHITE_PROJECTILE_PS onready var Spr: Sprite = $Sprite onready var Occluder: LightOccluder2D = $Sprite/LightOccluder2D onready var Anim: AnimationPlayer = $AnimationPlayer onready var CoyoteTimer: Timer = $CoyoteTimer onready var StateMachine: Node = $PlayerStateMachine +onready var HoldPosition: Node2D = $HoldPosition +onready var ProjectileSpawn: Node2D = $HoldPosition/ProjectileSpawn func _ready(): @@ -37,6 +40,13 @@ func _physics_process(delta): func handle_move_input(): input_direction = int(Input.is_action_pressed("right")) - int(Input.is_action_pressed("left")) velocity.x = lerp(velocity.x, speed * input_direction, get_movement_weight()) + HoldPosition.look_at(get_global_mouse_position()) + HoldPosition.rotation_degrees + + + if Input.is_action_just_pressed("shoot"): + fire_projectile() + print("fire") if input_direction > 0: Spr.flip_h = false @@ -46,11 +56,17 @@ func handle_move_input(): Spr.flip_h = true Occluder.scale.x = -1 - func jump(): velocity.y = max_jump_velocity CoyoteTimer.stop() +func fire_projectile(): + var temp = projectile_ps.instance() + get_tree().current_scene.add_child(temp) + temp.global_position = ProjectileSpawn.global_position + temp.rotation_degrees = HoldPosition.rotation_degrees + temp.launch() + func apply_gravity(delta, modifier = 1): velocity.y += gravity * delta * modifier