Prism wand uses energy

This commit is contained in:
Logan 2020-07-23 02:07:34 -05:00
parent a9a49ba273
commit 013c5f0cfd
5 changed files with 27 additions and 34 deletions

View file

@ -1,11 +1,8 @@
[gd_scene load_steps=17 format=2]
[gd_scene load_steps=14 format=2]
[ext_resource path="res://meta/DungeonTilemap.tres" type="TileSet" id=1]
[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://ai/Scenes/Skeleton Enemy.tscn" type="PackedScene" id=3]
[ext_resource path="res://ai/Scenes/Demon.tscn" type="PackedScene" id=4]
[ext_resource path="res://art/door.png" type="Texture" id=5]
[ext_resource path="res://art/Paralax Dungeon.png" type="Texture" id=6]
[ext_resource path="res://art/Black.png" type="Texture" id=7]
[ext_resource path="res://Music and Fonts(Misc.)/m5x7.ttf" type="DynamicFontData" id=8]
[ext_resource path="res://levels/Campaign/Level 1/Leap Of Faith.gd" type="Script" id=9]
@ -48,24 +45,14 @@ hframes = 2
]]
tile_set = ExtResource( 1 )
cell_size = Vector2( 16, 16 )
collision_layer = 2
collision_mask = 0
format = 1
tile_data = PoolIntArray( 65535, 0, 8, 0, 0, 10, 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, 11, 131071, 0, 65544, 65536, 0, 131078, 65537, 0, 196617, 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, 196617, 65557, 0, 196617, 65558, 0, 196617, 65559, 0, 196617, 65560, 0, 196617, 65561, 0, 196617, 65562, 0, 196617, 65563, 0, 196617, 65564, 0, 196617, 65565, 0, 196617, 65566, 0, 196617, 65567, 0, 196617, 65568, 0, 196617, 65569, 0, 196617, 65570, 0, 196617, 65571, 0, 196617, 65572, 0, 196617, 65573, 0, 196617, 65574, 0, 196617, 65575, 0, 196617, 65576, 0, 196617, 65577, 0, 196617, 65578, 0, 196617, 65579, 0, 196617, 65580, 0, 196617, 65581, 0, 131077, 65582, 0, 131081, 65583, 0, 131081, 65584, 0, 131081, 65585, 0, 131081, 65586, 0, 131081, 65587, 0, 131083, 196607, 0, 65544, 131072, 0, 131083, 131117, 0, 65544, 131118, 0, 131081, 131119, 0, 131081, 131120, 0, 131081, 131121, 0, 131081, 131122, 0, 131081, 131123, 0, 131083, 262143, 0, 65544, 196608, 0, 131083, 196653, 0, 65544, 196654, 0, 131081, 196655, 0, 131081, 196656, 0, 131081, 196657, 0, 131081, 196658, 0, 131081, 196659, 0, 131083, 327679, 0, 65544, 262144, 0, 131083, 262189, 0, 65544, 262190, 0, 131081, 262191, 0, 131081, 262192, 0, 131081, 262193, 0, 131081, 262194, 0, 131081, 262195, 0, 131083, 393215, 0, 65544, 327680, 0, 131083, 327725, 0, 65544, 327726, 0, 131081, 327727, 0, 131081, 327728, 0, 131081, 327729, 0, 131081, 327730, 0, 131081, 327731, 0, 131083, 458751, 0, 65544, 393216, 0, 131083, 393261, 0, 65544, 393262, 0, 131081, 393263, 0, 131081, 393264, 0, 131081, 393265, 0, 131081, 393266, 0, 131081, 393267, 0, 131083, 524287, 0, 65544, 458752, 0, 131083, 458797, 0, 65544, 458798, 0, 131081, 458799, 0, 131081, 458800, 0, 131081, 458801, 0, 131081, 458802, 0, 131081, 458803, 0, 131083, 589823, 0, 65544, 524288, 0, 131083, 524308, 0, 196608, 524333, 0, 65544, 524334, 0, 131081, 524335, 0, 131081, 524336, 0, 131081, 524337, 0, 131081, 524338, 0, 131081, 524339, 0, 131083, 655359, 0, 65544, 589824, 0, 131083, 589869, 0, 65544, 589870, 0, 131081, 589871, 0, 131081, 589872, 0, 131081, 589873, 0, 131081, 589874, 0, 131081, 589875, 0, 131083, 720895, 0, 65544, 655360, 0, 131083, 655374, 0, 0, 655386, 0, 0, 655405, 0, 65544, 655406, 0, 131081, 655407, 0, 131081, 655408, 0, 131081, 655409, 0, 131081, 655410, 0, 131081, 655411, 0, 131083, 786431, 0, 65544, 720896, 0, 65542, 720897, 0, 10, 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, 9, 720911, 0, 10, 720912, 0, 10, 720913, 0, 10, 720914, 0, 10, 720915, 0, 10, 720916, 0, 10, 720917, 0, 10, 720918, 0, 10, 720919, 0, 10, 720920, 0, 10, 720921, 0, 10, 720922, 0, 9, 720923, 0, 10, 720924, 0, 10, 720925, 0, 10, 720926, 0, 10, 720927, 0, 10, 720928, 0, 10, 720929, 0, 10, 720930, 0, 10, 720931, 0, 10, 720932, 0, 10, 720933, 0, 11, 720941, 0, 65544, 720942, 0, 131081, 720943, 0, 131081, 720944, 0, 131081, 720945, 0, 131081, 720946, 0, 131081, 720947, 0, 131083, 851967, 0, 196616, 786432, 0, 196617, 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, 196619, 786477, 0, 196616, 786478, 0, 196617, 786479, 0, 196617, 786480, 0, 196617, 786481, 0, 196617, 786482, 0, 196617, 786483, 0, 196619 )
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
motion_mirroring = Vector2( 384, 180 )
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
texture = ExtResource( 6 )
centered = false
tile_data = PoolIntArray( 65535, 0, 8, 0, 0, 10, 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, 11, 131071, 0, 65544, 65536, 0, 131078, 65537, 0, 196617, 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, 196617, 65557, 0, 196617, 65558, 0, 196617, 65559, 0, 196617, 65560, 0, 196617, 65561, 0, 196617, 65562, 0, 196617, 65563, 0, 196617, 65564, 0, 196617, 65565, 0, 196617, 65566, 0, 196617, 65567, 0, 196617, 65568, 0, 196617, 65569, 0, 196617, 65570, 0, 196617, 65571, 0, 196617, 65572, 0, 196617, 65573, 0, 196617, 65574, 0, 196617, 65575, 0, 196617, 65576, 0, 196617, 65577, 0, 196617, 65578, 0, 196617, 65579, 0, 196617, 65580, 0, 196617, 65581, 0, 131077, 65582, 0, 131081, 65583, 0, 131081, 65584, 0, 131081, 65585, 0, 131081, 65586, 0, 131081, 65587, 0, 131083, 196607, 0, 65544, 131072, 0, 131083, 131117, 0, 65544, 131118, 0, 131081, 131119, 0, 131081, 131120, 0, 131081, 131121, 0, 131081, 131122, 0, 131081, 131123, 0, 131083, 262143, 0, 65544, 196608, 0, 131083, 196653, 0, 65544, 196654, 0, 131081, 196655, 0, 131081, 196656, 0, 131081, 196657, 0, 131081, 196658, 0, 131081, 196659, 0, 131083, 327679, 0, 65544, 262144, 0, 131083, 262189, 0, 65544, 262190, 0, 131081, 262191, 0, 131081, 262192, 0, 131081, 262193, 0, 131081, 262194, 0, 131081, 262195, 0, 131083, 393215, 0, 65544, 327680, 0, 131083, 327725, 0, 65544, 327726, 0, 131081, 327727, 0, 131081, 327728, 0, 131081, 327729, 0, 131081, 327730, 0, 131081, 327731, 0, 131083, 458751, 0, 65544, 393216, 0, 131083, 393261, 0, 65544, 393262, 0, 131081, 393263, 0, 131081, 393264, 0, 131081, 393265, 0, 131081, 393266, 0, 131081, 393267, 0, 131083, 524287, 0, 65544, 458752, 0, 131083, 458797, 0, 65544, 458798, 0, 131081, 458799, 0, 131081, 458800, 0, 131081, 458801, 0, 131081, 458802, 0, 131081, 458803, 0, 131083, 589823, 0, 65544, 524288, 0, 131083, 524333, 0, 65544, 524334, 0, 131081, 524335, 0, 131081, 524336, 0, 131081, 524337, 0, 131081, 524338, 0, 131081, 524339, 0, 131083, 655359, 0, 65544, 589824, 0, 131083, 589869, 0, 65544, 589870, 0, 131081, 589871, 0, 131081, 589872, 0, 131081, 589873, 0, 131081, 589874, 0, 131081, 589875, 0, 131083, 720895, 0, 65544, 655360, 0, 131083, 655405, 0, 65544, 655406, 0, 131081, 655407, 0, 131081, 655408, 0, 131081, 655409, 0, 131081, 655410, 0, 131081, 655411, 0, 131083, 786431, 0, 65544, 720896, 0, 65542, 720897, 0, 10, 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, 10, 720917, 0, 10, 720918, 0, 10, 720919, 0, 10, 720920, 0, 10, 720921, 0, 10, 720922, 0, 10, 720923, 0, 10, 720924, 0, 10, 720925, 0, 10, 720926, 0, 10, 720927, 0, 10, 720928, 0, 10, 720929, 0, 10, 720930, 0, 10, 720931, 0, 10, 720932, 0, 10, 720933, 0, 11, 720941, 0, 65544, 720942, 0, 131081, 720943, 0, 131081, 720944, 0, 131081, 720945, 0, 131081, 720946, 0, 131081, 720947, 0, 131083, 851967, 0, 196616, 786432, 0, 196617, 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, 196619, 786477, 0, 196616, 786478, 0, 196617, 786479, 0, 196617, 786480, 0, 196617, 786481, 0, 196617, 786482, 0, 196617, 786483, 0, 196619 )
[node name="Player" parent="." instance=ExtResource( 2 )]
position = Vector2( 30, 174 )
[node name="Demon" parent="." instance=ExtResource( 4 )]
position = Vector2( 301, 164 )
[node name="Leap" type="Area2D" parent="."]
script = ExtResource( 9 )
@ -82,6 +69,11 @@ script = ExtResource( 11 )
anims/Typewriter = SubResource( 2 )
script = ExtResource( 12 )
[node name="Timer" type="Timer" parent="."]
wait_time = 4.386
one_shot = true
script = ExtResource( 10 )
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Sprite" type="Sprite" parent="CanvasLayer"]
@ -102,14 +94,13 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Skeleton Enemy" parent="." instance=ExtResource( 3 )]
position = Vector2( 357, 167 )
[node name="Timer" type="Timer" parent="."]
wait_time = 4.386
one_shot = true
script = ExtResource( 10 )
[connection signal="body_entered" from="Leap" to="Timer" method="_on_Leap_body_entered"]
[connection signal="body_entered" from="Leap" to="AnimationPlayer" method="_on_Leap_body_entered"]
[node name="Label" type="Label" parent="."]
margin_right = 40.0
margin_bottom = 14.0
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="body_entered" from="Leap" to="AnimationPlayer2" method="_on_Leap_body_entered"]
[connection signal="body_entered" from="Leap" to="AnimationPlayer" method="_on_Leap_body_entered"]
[connection signal="body_entered" from="Leap" to="Timer" method="_on_Leap_body_entered"]
[connection signal="timeout" from="Timer" to="Timer" method="_on_Timer_timeout"]

File diff suppressed because one or more lines are too long

View file

@ -30,7 +30,6 @@ func _input(event):
if charge_level <= 0:
charge_level = 0
return
print(charge_level)
var temp = projectile.instance()
get_tree().current_scene.add_child(temp)
temp.global_transform = $ProjectileSpawn.global_transform

View file

@ -26,7 +26,7 @@ func fire(projectile):
var beam = get_beam_type(projectile)
if beam != null:
beam.activate()
if $ShootDelay.is_stopped():
if $ShootDelay.is_stopped() and beam != null:
$ShootDelay.start()
var c = beam.get_collider()
if typeof(c) == TYPE_ARRAY:
@ -34,11 +34,12 @@ func fire(projectile):
if body != null and body.has_method("get_type") && body.get_type() == "enemy":
body.health -= beam.damage
body.play_hit()
return beam.energy_cost
else:
if c != null and c.has_method("get_type") && c.get_type() == "enemy":
c.health -= beam.damage
c.play_hit()
return 0
return beam.energy_cost
func _input(event):
if event.is_action_released("shoot"):

View file

@ -57,6 +57,7 @@ _global_script_class_icons={
[application]
config/name="Gamejam"
run/main_scene="res://levels/Campaign/Level0.tscn"
config/icon="res://icon.png"
[autoload]