Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
790f764802
|
@ -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"]
|
Binary file not shown.
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 161 B |
|
@ -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"]
|
||||
|
|
41
levels/Tilte.tscn
Normal file
41
levels/Tilte.tscn
Normal file
|
@ -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"]
|
File diff suppressed because one or more lines are too long
|
@ -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="."]
|
||||
|
|
|
@ -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="."]
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
4
script/globals.gd
Normal file
4
script/globals.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends Node
|
||||
|
||||
const TILE_SIZE = 16
|
||||
const WHITE_PROJECTILE_PS = preload("res://magic/projectiles/WhiteProjectile.tscn")
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue