Skip to content

Commit

Permalink
missiles power up now refills players missiles when collected; change…
Browse files Browse the repository at this point in the history
… lvl 00 and 02
  • Loading branch information
Nartynka committed Oct 14, 2022
1 parent 3837824 commit e1f70e8
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 34 deletions.
49 changes: 23 additions & 26 deletions Levels/Level_00.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,60 @@
[node name="Level_00" instance=ExtResource( 1 )]

[node name="Door" parent="." index="0" instance=ExtResource( 2 )]
position = Vector2( 272, 144 )
position = Vector2( 160, 144 )
connection = ExtResource( 3 )
new_level_path = "res://Levels/Level_01.tscn"

[node name="TileMap" parent="." index="1"]
tile_data = PoolIntArray( 2, 0, 0, 3, 0, 1, 4, 0, 1, 5, 0, 1, 6, 0, 1, 7, 0, 1, 8, 0, 1, 9, 0, 1, 10, 0, 2, 65537, 0, 0, 65538, 0, 131078, 65539, 0, 65537, 65540, 0, 65537, 65541, 0, 65541, 65542, 0, 131073, 65543, 0, 131073, 65544, 0, 131073, 65545, 0, 65542, 65546, 0, 131077, 65547, 0, 1, 65548, 0, 2, 131072, 0, 0, 131073, 0, 131078, 131074, 0, 65541, 131075, 0, 131073, 131076, 0, 131073, 131077, 0, 131074, 131081, 0, 131072, 131082, 0, 131073, 131083, 0, 131073, 131084, 0, 9, 131085, 0, 2, 262143, 0, 0, 196608, 0, 131078, 196609, 0, 65541, 196610, 0, 131074, 196620, 0, 131072, 196621, 0, 196613, 196622, 0, 6, 196623, 0, 2, 327677, 0, 0, 327678, 0, 1, 327679, 0, 65545, 262144, 0, 131073, 262145, 0, 131074, 262158, 0, 131072, 262159, 0, 9, 262160, 0, 1, 262161, 0, 2, 393213, 0, 65536, 393214, 0, 65541, 393215, 0, 131074, 327695, 0, 131072, 327696, 0, 131073, 327697, 0, 65543, 458748, 0, 0, 458749, 0, 65545, 458750, 0, 131074, 393233, 0, 65539, 524284, 0, 65536, 524285, 0, 65538, 458769, 0, 131075, 589820, 0, 65536, 589821, 0, 131077, 589822, 0, 2, 655356, 0, 131072, 655357, 0, 65542, 655358, 0, 65538, 720893, 0, 131072, 720894, 0, 9, 720895, 0, 1, 655360, 0, 1, 655361, 0, 1, 655362, 0, 2, 655375, 0, 0, 655376, 0, 1, 655377, 0, 2, 786430, 0, 131072, 786431, 0, 131073, 720896, 0, 131073, 720897, 0, 65542, 720898, 0, 131077, 720899, 0, 1, 720900, 0, 1, 720901, 0, 1, 720902, 0, 1, 720903, 0, 1, 720904, 0, 1, 720905, 0, 1, 720906, 0, 1, 720907, 0, 1, 720908, 0, 1, 720909, 0, 1, 720910, 0, 1, 720911, 0, 131078, 720912, 0, 65537, 720913, 0, 65538, 786433, 0, 131072, 786434, 0, 131073, 786435, 0, 131073, 786436, 0, 131073, 786437, 0, 131073, 786438, 0, 131073, 786439, 0, 131073, 786440, 0, 131073, 786441, 0, 131073, 786442, 0, 131073, 786443, 0, 131073, 786444, 0, 131073, 786445, 0, 131073, 786446, 0, 131073, 786447, 0, 131073, 786448, 0, 131073, 786449, 0, 131074 )
tile_data = PoolIntArray( 65535, 0, 0, 0, 0, 1, 1, 0, 1, 2, 0, 1, 3, 0, 2, 131070, 0, 0, 131071, 0, 131078, 65536, 0, 65537, 65537, 0, 65537, 65538, 0, 65537, 65539, 0, 131077, 65540, 0, 1, 65541, 0, 2, 196605, 0, 0, 196606, 0, 131078, 196607, 0, 65541, 131072, 0, 131073, 131073, 0, 131073, 131074, 0, 131073, 131075, 0, 131073, 131076, 0, 131073, 131077, 0, 9, 131078, 0, 2, 262140, 0, 0, 262141, 0, 131078, 262142, 0, 65541, 262143, 0, 131074, 196613, 0, 131072, 196614, 0, 196613, 196615, 0, 6, 196616, 0, 2, 327674, 0, 0, 327675, 0, 1, 327676, 0, 65545, 327677, 0, 131073, 327678, 0, 131074, 262151, 0, 131072, 262152, 0, 9, 262153, 0, 1, 262154, 0, 2, 393210, 0, 65536, 393211, 0, 65541, 393212, 0, 131074, 327688, 0, 131072, 327689, 0, 65542, 327690, 0, 65538, 458745, 0, 0, 458746, 0, 65545, 458747, 0, 131074, 393225, 0, 131072, 393226, 0, 65543, 524281, 0, 65536, 524282, 0, 65538, 458762, 0, 131075, 589817, 0, 65536, 589818, 0, 131077, 589819, 0, 2, 655353, 0, 131072, 655354, 0, 65542, 655355, 0, 65538, 720890, 0, 131072, 720891, 0, 9, 720892, 0, 1, 720893, 0, 1, 720894, 0, 1, 720895, 0, 2, 655368, 0, 0, 655369, 0, 1, 655370, 0, 2, 786427, 0, 131072, 786428, 0, 131073, 786429, 0, 131073, 786430, 0, 65542, 786431, 0, 131077, 720896, 0, 1, 720897, 0, 1, 720898, 0, 1, 720899, 0, 1, 720900, 0, 1, 720901, 0, 1, 720902, 0, 1, 720903, 0, 1, 720904, 0, 131078, 720905, 0, 65537, 720906, 0, 65538, 851966, 0, 131072, 851967, 0, 131073, 786432, 0, 131073, 786433, 0, 131073, 786434, 0, 131073, 786435, 0, 131073, 786436, 0, 131073, 786437, 0, 131073, 786438, 0, 131073, 786439, 0, 131073, 786440, 0, 131073, 786441, 0, 131073, 786442, 0, 131074 )

[node name="Spikes" type="Node2D" parent="." index="2"]
position = Vector2( -112, 0 )

[node name="Spikes1" parent="Spikes" index="0" instance=ExtResource( 5 )]
position = Vector2( -16, 112 )
position = Vector2( 64, 144 )
rotation = 1.5708

[node name="Spikes2" parent="Spikes" index="1" instance=ExtResource( 5 )]
position = Vector2( 0, 96 )
position = Vector2( 64, 128 )
rotation = 1.5708

[node name="Spikes3" parent="Spikes" index="2" instance=ExtResource( 5 )]
position = Vector2( 16, 80 )
position = Vector2( 48, 112 )
rotation = 1.5708

[node name="Spikes4" parent="Spikes" index="3" instance=ExtResource( 5 )]
position = Vector2( 48, 64 )
position = Vector2( 64, 96 )
rotation = 1.5708

[node name="Spikes5" parent="Spikes" index="4" instance=ExtResource( 5 )]
position = Vector2( 176, 64 )
rotation = -1.5708

[node name="Spikes6" parent="Spikes" index="5" instance=ExtResource( 5 )]
[node name="Spikes6" parent="Spikes" index="4" instance=ExtResource( 5 )]
position = Vector2( 208, 80 )
rotation = -1.5708

[node name="Spikes7" parent="Spikes" index="6" instance=ExtResource( 5 )]
[node name="Spikes7" parent="Spikes" index="5" instance=ExtResource( 5 )]
position = Vector2( 224, 96 )
rotation = -1.5708

[node name="Spikes12" parent="Spikes" index="7" instance=ExtResource( 5 )]
position = Vector2( 256, 112 )
rotation = -1.5708
[node name="Spikes8" parent="Spikes" index="6" instance=ExtResource( 5 )]
position = Vector2( 80, 96 )
rotation = -3.14159

[node name="Spikes13" parent="Spikes" index="8" instance=ExtResource( 5 )]
position = Vector2( 256, 128 )
rotation = -1.5708
[node name="Spikes9" parent="Spikes" index="7" instance=ExtResource( 5 )]
position = Vector2( 96, 96 )
rotation = -3.14159

[node name="Spikes8" parent="Spikes" index="9" instance=ExtResource( 5 )]
position = Vector2( 80, 64 )
[node name="Spikes10" parent="Spikes" index="8" instance=ExtResource( 5 )]
position = Vector2( 144, 64 )
rotation = -3.14159

[node name="Spikes9" parent="Spikes" index="10" instance=ExtResource( 5 )]
position = Vector2( 96, 64 )
[node name="Spikes14" parent="Spikes" index="9" instance=ExtResource( 5 )]
position = Vector2( 192, 64 )
rotation = -3.14159

[node name="Spikes10" parent="Spikes" index="11" instance=ExtResource( 5 )]
position = Vector2( 144, 48 )
[node name="Spikes15" parent="Spikes" index="10" instance=ExtResource( 5 )]
position = Vector2( 176, 64 )
rotation = -3.14159

[node name="Spikes11" parent="Spikes" index="12" instance=ExtResource( 5 )]
position = Vector2( 128, 48 )
[node name="Spikes11" parent="Spikes" index="11" instance=ExtResource( 5 )]
position = Vector2( 128, 64 )
rotation = -3.14159
4 changes: 4 additions & 0 deletions Levels/Level_02.gd
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
extends "res://Levels/Level.gd"

onready var boss = $BossEnemy
onready var doorBlock = $EnterDoorBlock
onready var doorBlock2 = $ExitDoorBlock

func _ready():
boss.set_process(false)

func _on_Trigger_area_triggered():
block_door(true)
boss.set_process(true)

func _on_BossEnemy_boss_died():
block_door(false)
Expand Down
8 changes: 4 additions & 4 deletions Levels/Level_02.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ connection = ExtResource( 6 )
new_level_path = "res://Levels/Level_free.tscn"

[node name="Door" parent="." index="1" instance=ExtResource( 2 )]
position = Vector2( -32, 144 )
position = Vector2( -48, 144 )
scale = Vector2( -1, 1 )
connection = ExtResource( 3 )
new_level_path = "res://Levels/Level_01.tscn"

[node name="TileMap" parent="." index="2"]
tile_data = PoolIntArray( -65533, 0, 0, -65532, 0, 1, -65531, 0, 1, -65530, 0, 1, -65529, 0, 1, -65528, 0, 1, -65527, 0, 2, 2, 0, 0, 3, 0, 131078, 4, 0, 65537, 5, 0, 65537, 6, 0, 65537, 7, 0, 65537, 8, 0, 65537, 9, 0, 131077, 10, 0, 1, 11, 0, 2, 65537, 0, 0, 65538, 0, 131078, 65539, 0, 65541, 65540, 0, 131073, 65541, 0, 131073, 65542, 0, 131073, 65543, 0, 65542, 65544, 0, 65541, 65545, 0, 131073, 65546, 0, 131073, 65547, 0, 9, 65548, 0, 2, 131072, 0, 0, 131073, 0, 131078, 131074, 0, 65541, 131075, 0, 131074, 131079, 0, 131072, 131080, 0, 131074, 131083, 0, 131072, 131084, 0, 196613, 131085, 0, 6, 131086, 0, 2, 262142, 0, 0, 262143, 0, 1, 196608, 0, 65545, 196609, 0, 131073, 196610, 0, 131074, 196621, 0, 131072, 196622, 0, 9, 196623, 0, 1, 196624, 0, 2, 327678, 0, 65536, 327679, 0, 65541, 262144, 0, 131074, 262158, 0, 131072, 262159, 0, 131073, 262160, 0, 65543, 393213, 0, 0, 393214, 0, 65545, 393215, 0, 131074, 327696, 0, 65539, 458749, 0, 65536, 458750, 0, 65538, 393232, 0, 65539, 524285, 0, 131072, 524286, 0, 131074, 458768, 0, 131075, 720893, 0, 0, 720894, 0, 1, 720895, 0, 2, 655362, 0, 0, 655363, 0, 1, 655364, 0, 2, 655366, 0, 0, 655367, 0, 2, 655373, 0, 0, 655374, 0, 1, 655375, 0, 1, 655376, 0, 2, 786429, 0, 131072, 786430, 0, 65542, 786431, 0, 131077, 720896, 0, 1, 720897, 0, 1, 720898, 0, 131078, 720899, 0, 65537, 720900, 0, 131077, 720901, 0, 1, 720902, 0, 131078, 720903, 0, 131077, 720904, 0, 1, 720905, 0, 1, 720906, 0, 1, 720907, 0, 1, 720908, 0, 1, 720909, 0, 131078, 720910, 0, 65537, 720911, 0, 65537, 720912, 0, 65538, 851966, 0, 131072, 851967, 0, 131073, 786432, 0, 131073, 786433, 0, 131073, 786434, 0, 131073, 786435, 0, 131073, 786436, 0, 131073, 786437, 0, 131073, 786438, 0, 131073, 786439, 0, 131073, 786440, 0, 131073, 786441, 0, 131073, 786442, 0, 131073, 786443, 0, 131073, 786444, 0, 131073, 786445, 0, 131073, 786446, 0, 131073, 786447, 0, 131073, 786448, 0, 131074 )
tile_data = PoolIntArray( -65533, 0, 0, -65532, 0, 1, -65531, 0, 1, -65530, 0, 1, -65529, 0, 1, -65528, 0, 1, -65527, 0, 2, 2, 0, 0, 3, 0, 131078, 4, 0, 65537, 5, 0, 65537, 6, 0, 65537, 7, 0, 65537, 8, 0, 65537, 9, 0, 131077, 10, 0, 1, 11, 0, 2, 65537, 0, 0, 65538, 0, 131078, 65539, 0, 65541, 65540, 0, 131073, 65541, 0, 131073, 65542, 0, 131073, 65543, 0, 65542, 65544, 0, 65541, 65545, 0, 131073, 65546, 0, 131073, 65547, 0, 9, 65548, 0, 2, 131072, 0, 0, 131073, 0, 131078, 131074, 0, 65541, 131075, 0, 131074, 131079, 0, 131072, 131080, 0, 131074, 131083, 0, 131072, 131084, 0, 196613, 131085, 0, 6, 131086, 0, 2, 262142, 0, 0, 262143, 0, 1, 196608, 0, 65545, 196609, 0, 131073, 196610, 0, 131074, 196621, 0, 131072, 196622, 0, 9, 196623, 0, 1, 196624, 0, 2, 327678, 0, 65536, 327679, 0, 65541, 262144, 0, 131074, 262158, 0, 131072, 262159, 0, 131073, 262160, 0, 65543, 393213, 0, 0, 393214, 0, 65545, 393215, 0, 131074, 327696, 0, 65539, 458748, 0, 0, 458749, 0, 131078, 458750, 0, 65538, 393232, 0, 65539, 524284, 0, 131072, 524285, 0, 131073, 524286, 0, 131074, 458768, 0, 131075, 720892, 0, 0, 720893, 0, 1, 720894, 0, 1, 720895, 0, 2, 655362, 0, 0, 655363, 0, 1, 655364, 0, 2, 655366, 0, 0, 655367, 0, 2, 655373, 0, 0, 655374, 0, 1, 655375, 0, 1, 655376, 0, 2, 786428, 0, 131072, 786429, 0, 131073, 786430, 0, 65542, 786431, 0, 131077, 720896, 0, 1, 720897, 0, 1, 720898, 0, 131078, 720899, 0, 65537, 720900, 0, 131077, 720901, 0, 1, 720902, 0, 131078, 720903, 0, 131077, 720904, 0, 1, 720905, 0, 1, 720906, 0, 1, 720907, 0, 1, 720908, 0, 1, 720909, 0, 131078, 720910, 0, 65537, 720911, 0, 65537, 720912, 0, 65538, 851966, 0, 131072, 851967, 0, 131073, 786432, 0, 131073, 786433, 0, 131073, 786434, 0, 131073, 786435, 0, 131073, 786436, 0, 131073, 786437, 0, 131073, 786438, 0, 131073, 786439, 0, 131073, 786440, 0, 131073, 786441, 0, 131073, 786442, 0, 131073, 786443, 0, 131073, 786444, 0, 131073, 786445, 0, 131073, 786446, 0, 131073, 786447, 0, 131073, 786448, 0, 131074 )

[node name="Spikes" type="Node2D" parent="." index="3"]
position = Vector2( 16, -16 )
Expand Down Expand Up @@ -82,7 +82,7 @@ position = Vector2( 144, 64 )
rotation = -3.14159

[node name="BossEnemy" parent="." index="4" instance=ExtResource( 4 )]
position = Vector2( 144, 120 )
position = Vector2( 216, 120 )

[node name="Trigger" parent="." index="5" instance=ExtResource( 7 )]
position = Vector2( 0, 144 )
Expand All @@ -93,7 +93,7 @@ shape = SubResource( 1 )
[node name="EnterDoorBlock" parent="." index="6" instance=ExtResource( 9 )]
visible = false
collision_layer = 0
tile_data = PoolIntArray( 589821, 0, 3, 655357, 0, 131075 )
tile_data = PoolIntArray( 589820, 0, 3, 655356, 0, 131075 )

[node name="ExitDoorBlock" parent="." index="7" instance=ExtResource( 9 )]
visible = false
Expand Down
15 changes: 14 additions & 1 deletion Levels/Level_free.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=2]
[gd_scene load_steps=24 format=2]

[ext_resource path="res://Enemies/WalkingEnemy.tscn" type="PackedScene" id=1]
[ext_resource path="res://Levels/Level.tscn" type="PackedScene" id=2]
Expand All @@ -9,6 +9,7 @@
[ext_resource path="res://Enemies/FlyingEnemy.tscn" type="PackedScene" id=7]
[ext_resource path="res://World/Brick.tscn" type="PackedScene" id=8]
[ext_resource path="res://Levels/Door.tscn" type="PackedScene" id=9]
[ext_resource path="res://Player/MissilesPowerup.tscn" type="PackedScene" id=10]

[sub_resource type="Animation" id=1]
resource_name = "Loop"
Expand Down Expand Up @@ -681,6 +682,18 @@ rotation = 1.5708
position = Vector2( 256, -216 )
rotation = -1.5708

[node name="MissilesPowerup" parent="." index="8" instance=ExtResource( 10 )]
position = Vector2( 224, 744 )

[node name="MissilesPowerup2" parent="." index="9" instance=ExtResource( 10 )]
position = Vector2( 584, 272 )

[node name="MissilesPowerup3" parent="." index="10" instance=ExtResource( 10 )]
position = Vector2( 1216, 624 )

[node name="MissilesPowerup4" parent="." index="11" instance=ExtResource( 10 )]
position = Vector2( 1800, 592 )

[editable path="MovingPlatforms/MovingPlatform7"]
[editable path="MovingPlatforms/MovingPlatform2"]
[editable path="MovingPlatforms/MovingPlatform3"]
Expand Down
5 changes: 4 additions & 1 deletion Player/MissilesPowerup.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
extends Powerup

func _pick_up():
PlayerStats.missiles_unlocked = true
if PlayerStats.missiles_unlocked:
PlayerStats.missiles = PlayerStats.max_missiles
else:
PlayerStats.missiles_unlocked = true
queue_free()
2 changes: 0 additions & 2 deletions Player/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ func _physics_process(delta):
if PlayerStats.missiles > 0 and PlayerStats.missiles_unlocked:
fire_missile()
PlayerStats.missiles -= 1
if Input.is_action_pressed("ui_down") and !PlayerStats.missiles_unlocked:
PlayerStats.missiles_unlocked = true

func fire_bullet():
var bullet = Utils.instance_on_main(Bullet, firePoint.global_position)
Expand Down

0 comments on commit e1f70e8

Please sign in to comment.