Skip to content

Commit

Permalink
add death to spikeWall, handle death, make spikeRun local, fix ceilin…
Browse files Browse the repository at this point in the history
…g spikes group check
  • Loading branch information
Firsttryy committed Nov 6, 2023
1 parent 4dab4fa commit b93a3e9
Show file tree
Hide file tree
Showing 7 changed files with 468 additions and 14 deletions.
7 changes: 7 additions & 0 deletions SpikeRun.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ func _on_clock_behavior_trap_trigger_elapsed():
$SpikeWallMap/AudioStreamPlayer2DSpikes.play()
$Torches/TileMap2.turn_on_lights()
$SpikeWallMap/Camera2D.restore_camera_view()
$SpikeWallMap/Area2D/CollisionShape2D.disabled = false


func _on_area_2d_11_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
if body.is_in_group("player"):
set_spikes_enabled(false)
$SpikeWallMap/AudioStreamPlayer2DSpikes.stop()

func _on_health_bar_behavior_death():
set_spikes_enabled(false)
$SpikeWallMap/AudioStreamPlayer2DSpikes.stop()
$SpikeWallMap/Camera2D.set_enabled(false)
6 changes: 3 additions & 3 deletions SpikeRun.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ size = Vector2(34, 560)
size = Vector2(64, 64)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_4q0av"]
size = Vector2(66, 578)
size = Vector2(58, 578)

[node name="Node2D" type="Node2D"]
script = ExtResource("1_mgguh")
Expand Down Expand Up @@ -234,7 +234,7 @@ texture_scale = 0.3
material = SubResource("CanvasItemMaterial_f4ms5")
tile_set = ExtResource("1_0wfw1")
format = 2
layer_0/tile_data = PackedInt32Array(0, 327680, 5, 1, 327680, 5, 2, 327680, 5, 3, 327680, 5, 4, 327680, 5, 5, 327680, 5, 6, 327680, 5, 7, 327680, 5, 8, 327680, 5, 9, 327680, 5, 10, 327680, 5, 11, 327680, 5, 12, 327680, 5, 13, 327680, 5, 14, 327680, 5, 15, 327680, 5, 655360, 327680, 5, 655361, 327680, 5, 655362, 327680, 5, 655363, 327680, 5, 655364, 327680, 5, 655365, 327680, 5, 655366, 327680, 5, 655367, 327680, 5, 655368, 327680, 5, 655369, 327680, 5, 655370, 327680, 5, 655371, 327680, 5, 655372, 327680, 5, 655373, 327680, 5, 655374, 327680, 5, 655375, 327680, 5, 655376, 327680, 5, 655377, 327680, 5, 655378, 327680, 5, 655379, 327680, 5, 16, 327680, 5, 17, 327680, 5, 18, 327680, 5, 19, 327680, 5, 20, 327680, 5, 21, 327680, 5, 22, 327680, 5, 23, 327680, 5, 24, 327680, 5, 25, 327680, 5, 26, 327680, 5, 27, 327680, 5, 28, 327680, 5, 29, 327680, 5, 30, 327680, 5, 31, 327680, 5, 32, 327680, 5, 33, 327680, 5, 34, 327680, 5, 35, 327680, 5, 36, 327680, 5, 37, 327680, 5, 38, 327680, 5, 39, 327680, 5, 40, 327680, 5, 41, 327680, 5, 42, 327680, 5, 43, 327680, 5, 44, 327680, 5, 45, 327680, 5, 46, 327680, 5, 47, 327680, 5, 48, 327680, 5, 49, 327680, 5, 50, 327680, 5, 51, 327680, 5, 52, 327680, 5, 53, 327680, 5, 54, 327680, 5, 55, 327680, 5, 56, 327680, 5, 57, 327680, 5, 58, 327680, 5, 59, 327680, 5, 60, 327680, 5, 61, 327680, 5, 62, 327680, 5, 63, 327680, 5, 64, 327680, 5, 65, 327680, 5, 66, 327680, 5, 67, 327680, 5, 68, 327680, 5, 69, 327680, 5, 655380, 327680, 5, 655412, 327680, 5, 655413, 327680, 5, 655414, 327680, 5, 655415, 327680, 5, 655416, 327680, 5, 655417, 327680, 5, 655418, 327680, 5, 655419, 327680, 5, 655420, 327680, 5, 655421, 327680, 5, 655422, 327680, 5, 655423, 327680, 5, 655424, 327680, 5, 655425, 327680, 5, 655426, 327680, 5, 655427, 327680, 5, 655428, 327680, 5, 655429, 327680, 5, 70, 327680, 5, 71, 327680, 5, 72, 327680, 5, 73, 327680, 5, 74, 327680, 5, 75, 327680, 5, 76, 327680, 5, 77, 327680, 5, 78, 327680, 5, 79, 327680, 5, 80, 327680, 5, 81, 327680, 5, 82, 327680, 5, 83, 327680, 5, 84, 327680, 5, 85, 327680, 5, 86, 327680, 5, 87, 327680, 5, 88, 327680, 5, 89, 327680, 5, 90, 327680, 5, 91, 327680, 5, 92, 327680, 5, 93, 327680, 5, 94, 327680, 5, 95, 327680, 5, 96, 327680, 5, 97, 327680, 5, 98, 327680, 5, 99, 327680, 5, 100, 327680, 5, 101, 327680, 5, 102, 327680, 5, 103, 327680, 5, 104, 327680, 5, 105, 327680, 5, 106, 327680, 5, 107, 327680, 5, 108, 327680, 5, 109, 327680, 5, 110, 327680, 5, 111, 327680, 5, 112, 327680, 5, 113, 327680, 5, 114, 327680, 5, 115, 327680, 5, 116, 327680, 5, 117, 327680, 5, 118, 327680, 5, 119, 327680, 5, 120, 327680, 5, 121, 327680, 5, 122, 327680, 5, 123, 327680, 5, 124, 327680, 5, 125, 327680, 5, 126, 327680, 5, 127, 327680, 5, 128, 327680, 5, 129, 327680, 5, 130, 327680, 5, 131, 327680, 5, 132, 327680, 5, 133, 327680, 5, 134, 327680, 5, 135, 327680, 5, 136, 327680, 5, 655430, 327680, 5, 655431, 327680, 5, 655432, 327680, 5, 655433, 327680, 5, 655434, 327680, 5, 655435, 327680, 5, 655442, 327680, 5, 655443, 327680, 5, 655444, 327680, 5, 655445, 327680, 5, 655446, 327680, 5, 655447, 327680, 5, 655448, 327680, 5, 655449, 327680, 5, 655450, 327680, 5, 655451, 327680, 5, 655452, 327680, 5, 655453, 327680, 5, 655454, 327680, 5, 655455, 327680, 5, 655456, 327680, 5, 655457, 327680, 5, 655458, 327680, 5, 655459, 327680, 5, 655460, 327680, 5, 655461, 327680, 5, 655462, 327680, 5, 655463, 327680, 5, 655464, 327680, 5, 655465, 327680, 5, 655466, 327680, 5, 655467, 327680, 5, 655468, 327680, 5, 655469, 327680, 5, 655473, 327680, 5, 655474, 327680, 5, 655475, 327680, 5, 655476, 327680, 5, 655477, 327680, 5, 655478, 327680, 5, 655479, 327680, 5, 655483, 327680, 5, 655487, 327680, 5, 655488, 327680, 5, 655489, 327680, 5, 655490, 327680, 5, 655491, 327680, 5, 655492, 327680, 5, 655493, 327680, 5, 655494, 327680, 5, 655495, 327680, 5, 137, 327680, 5, 138, 327680, 5, 139, 327680, 5, 140, 327680, 5, 141, 327680, 5, 142, 327680, 5, 143, 327680, 5, 144, 327680, 5, 145, 327680, 5, 655501, 327680, 5, 655502, 327680, 5, 655503, 327680, 5, 655504, 327680, 5, 655505, 327680, 5, 146, 327680, 5, 147, 327680, 5, 148, 327680, 5, 149, 327680, 5, 150, 327680, 5, 151, 327680, 5, 152, 327680, 5, 153, 327680, 5, 655506, 327680, 5, 655507, 327680, 5, 655508, 327680, 5, 655509, 327680, 5, 655513, 327680, 5, 655510, 327680, 5, 655511, 327680, 5, 655512, 327680, 5, 589847, 327680, 5, 458777, 327680, 5, 327703, 327680, 5, 262170, 327680, 5, 262174, 327680, 5, 65567, 327680, 5, 131103, 327680, 4, 262177, 327680, 5, 327724, 0, 4, 262191, 0, 4, 65569, 196608, 6, 65588, 196608, 6, 589863, 0, 4, 458794, 0, 4, 655396, 0, 4, 655441, 327680, 5, 655440, 327680, 5, 655439, 327680, 5, 655438, 327680, 5, 655437, 327680, 5, 655436, 327680, 5, 65605, 196608, 6, 65623, 196608, 6, 65641, 196608, 6, 655480, 327680, 5, 655481, 327680, 5, 655482, 327680, 5, 655500, 327680, 805306372, 524426, 196608, 9)
layer_0/tile_data = PackedInt32Array(0, 327680, 5, 1, 327680, 5, 2, 327680, 5, 3, 327680, 5, 4, 327680, 5, 5, 327680, 5, 6, 327680, 5, 7, 327680, 5, 8, 327680, 5, 9, 327680, 5, 10, 327680, 5, 11, 327680, 5, 12, 327680, 5, 13, 327680, 5, 14, 327680, 5, 15, 327680, 5, 655360, 327680, 5, 655361, 327680, 5, 655362, 327680, 5, 655363, 327680, 5, 655364, 327680, 5, 655365, 327680, 5, 655366, 327680, 5, 655367, 327680, 5, 655368, 327680, 5, 655369, 327680, 5, 655370, 327680, 5, 655371, 327680, 5, 655372, 327680, 5, 655373, 327680, 5, 655374, 327680, 5, 655375, 327680, 5, 655376, 327680, 5, 655377, 327680, 5, 655378, 327680, 5, 655379, 327680, 5, 16, 327680, 5, 17, 327680, 5, 18, 327680, 5, 19, 327680, 5, 20, 327680, 5, 21, 327680, 5, 22, 327680, 5, 23, 327680, 5, 24, 327680, 5, 25, 327680, 5, 26, 327680, 5, 27, 327680, 5, 28, 327680, 5, 29, 327680, 5, 30, 327680, 5, 31, 327680, 5, 32, 327680, 5, 33, 327680, 5, 34, 327680, 5, 35, 327680, 5, 36, 327680, 5, 37, 327680, 5, 38, 327680, 5, 39, 327680, 5, 40, 327680, 5, 41, 327680, 5, 42, 327680, 5, 43, 327680, 5, 44, 327680, 5, 45, 327680, 5, 46, 327680, 5, 47, 327680, 5, 48, 327680, 5, 49, 327680, 5, 50, 327680, 5, 51, 327680, 5, 52, 327680, 5, 53, 327680, 5, 54, 327680, 5, 55, 327680, 5, 56, 327680, 5, 57, 327680, 5, 58, 327680, 5, 59, 327680, 5, 60, 327680, 5, 61, 327680, 5, 62, 327680, 5, 63, 327680, 5, 64, 327680, 5, 65, 327680, 5, 66, 327680, 5, 67, 327680, 5, 68, 327680, 5, 69, 327680, 5, 655380, 327680, 5, 655412, 327680, 5, 655413, 327680, 5, 655414, 327680, 5, 655415, 327680, 5, 655416, 327680, 5, 655417, 327680, 5, 655418, 327680, 5, 655419, 327680, 5, 655420, 327680, 5, 655421, 327680, 5, 655422, 327680, 5, 655423, 327680, 5, 655424, 327680, 5, 655425, 327680, 5, 655426, 327680, 5, 655427, 327680, 5, 655428, 327680, 5, 655429, 327680, 5, 70, 327680, 5, 71, 327680, 5, 72, 327680, 5, 73, 327680, 5, 74, 327680, 5, 75, 327680, 5, 76, 327680, 5, 77, 327680, 5, 78, 327680, 5, 79, 327680, 5, 80, 327680, 5, 81, 327680, 5, 82, 327680, 5, 83, 327680, 5, 84, 327680, 5, 85, 327680, 5, 86, 327680, 5, 87, 327680, 5, 88, 327680, 5, 89, 327680, 5, 90, 327680, 5, 91, 327680, 5, 92, 327680, 5, 93, 327680, 5, 94, 327680, 5, 95, 327680, 5, 96, 327680, 5, 97, 327680, 5, 98, 327680, 5, 99, 327680, 5, 100, 327680, 5, 101, 327680, 5, 102, 327680, 5, 103, 327680, 5, 104, 327680, 5, 105, 327680, 5, 106, 327680, 5, 107, 327680, 5, 108, 327680, 5, 109, 327680, 5, 110, 327680, 5, 111, 327680, 5, 112, 327680, 5, 113, 327680, 5, 114, 327680, 5, 115, 327680, 5, 116, 327680, 5, 117, 327680, 5, 118, 327680, 5, 119, 327680, 5, 120, 327680, 5, 121, 327680, 5, 122, 327680, 5, 123, 327680, 5, 124, 327680, 5, 125, 327680, 5, 126, 327680, 5, 127, 327680, 5, 128, 327680, 5, 129, 327680, 5, 130, 327680, 5, 131, 327680, 5, 132, 327680, 5, 133, 327680, 5, 134, 327680, 5, 135, 327680, 5, 136, 327680, 5, 655430, 327680, 5, 655431, 327680, 5, 655432, 327680, 5, 655433, 327680, 5, 655434, 327680, 5, 655435, 327680, 5, 655442, 327680, 5, 655443, 327680, 5, 655444, 327680, 5, 655445, 327680, 5, 655446, 327680, 5, 655447, 327680, 5, 655448, 327680, 5, 655449, 327680, 5, 655450, 327680, 5, 655451, 327680, 5, 655452, 327680, 5, 655453, 327680, 5, 655454, 327680, 5, 655455, 327680, 5, 655456, 327680, 5, 655457, 327680, 5, 655458, 327680, 5, 655459, 327680, 5, 655460, 327680, 5, 655461, 327680, 5, 655462, 327680, 5, 655463, 327680, 5, 655464, 327680, 5, 655465, 327680, 5, 655466, 327680, 5, 655467, 327680, 5, 655468, 327680, 5, 655469, 327680, 5, 655473, 327680, 5, 655474, 327680, 5, 655475, 327680, 5, 655476, 327680, 5, 655477, 327680, 5, 655478, 327680, 5, 655479, 327680, 5, 655483, 327680, 5, 655487, 327680, 5, 655488, 327680, 5, 655489, 327680, 5, 655490, 327680, 5, 655491, 327680, 5, 655492, 327680, 5, 655493, 327680, 5, 655494, 327680, 5, 655495, 327680, 5, 137, 327680, 5, 138, 327680, 5, 139, 327680, 5, 140, 327680, 5, 141, 327680, 5, 142, 327680, 5, 143, 327680, 5, 144, 327680, 5, 145, 327680, 5, 655501, 327680, 5, 655502, 327680, 5, 655503, 327680, 5, 655504, 327680, 5, 655505, 327680, 5, 146, 327680, 5, 655506, 327680, 5, 589847, 327680, 5, 458777, 327680, 5, 327703, 327680, 5, 262170, 327680, 5, 262174, 327680, 5, 65567, 327680, 5, 131103, 327680, 4, 262177, 327680, 5, 327724, 0, 4, 262191, 0, 4, 65569, 196608, 6, 65588, 196608, 6, 589863, 0, 4, 458794, 0, 4, 655396, 0, 4, 655441, 327680, 5, 655440, 327680, 5, 655439, 327680, 5, 655438, 327680, 5, 655437, 327680, 5, 655436, 327680, 5, 65605, 196608, 6, 65623, 196608, 6, 65641, 196608, 6, 655480, 327680, 5, 655481, 327680, 5, 655482, 327680, 5, 524426, 196608, 9, 589970, 327680, 5, 524434, 327680, 5, 458898, 327680, 5, 393362, 327680, 5, 327826, 327680, 5, 262290, 327680, 5, 196754, 327680, 5, 131218, 327680, 5, 65682, 327680, 5, 655500, 327680, 805306372)

[node name="ColorRect" type="ColorRect" parent="TileMap"]
offset_left = 2128.0
Expand Down Expand Up @@ -374,7 +374,7 @@ script = ExtResource("4_m4gou")
[node name="Area2D" type="Area2D" parent="SpikeWallMap"]

[node name="CollisionShape2D" type="CollisionShape2D" parent="SpikeWallMap/Area2D"]
position = Vector2(-97, 351)
position = Vector2(-101, 351)
shape = SubResource("RectangleShape2D_4q0av")

[node name="MoveBehavior" type="Node2D" parent="SpikeWallMap"]
Expand Down
1 change: 1 addition & 0 deletions SpikeWallMap.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extends TileMap
# Called when the node enters the scene tree for the first time.
func _ready():
set_visible(false)
$Area2D/CollisionShape2D.disabled = true


# Called every frame. 'delta' is the elapsed time since the previous frame.
Expand Down
2 changes: 2 additions & 0 deletions addons/pronto/behaviors/MoveBehavior.gd
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ func move_right_a_bit():

func increase_spike_speed(value = 0.04):
spike_speed += value
$"../AudioStreamPlayer2DSpikes".pitch_scale *= (1.0 + value)
$"../AudioStreamPlayer2DSpikes".volume_db *= (1.0 + value)
pass

func set_done():
Expand Down
Loading

0 comments on commit b93a3e9

Please sign in to comment.