Skip to content

Commit

Permalink
Added tutorial level. Several bug fixes. Tweaks to collision detectio…
Browse files Browse the repository at this point in the history
…n to avoid getting stuck. Added spawn button to respawn. Added control mapping for two-handed play. Some enemies and chests will respawn off screen now. Cleaned up the way we save and load data. Fix for save not working in the web
  • Loading branch information
laplante-sean committed Aug 18, 2020
1 parent 346a55b commit d157e62
Show file tree
Hide file tree
Showing 25 changed files with 510 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,godot,python,visualstudio

### Save data for game ###
save_data.json
*save_data.json

### C++ ###
# Prerequisites
Expand Down
2 changes: 1 addition & 1 deletion Levels/AirDungeon.tscn

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Levels/FireDungeon.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ script = ExtResource( 9 )
LEVEL_ID = "fire_dungeon"

[node name="TileMap" parent="." index="0"]
tile_data = PoolIntArray( -1048574, 4, 0, -1048573, 4, 0, -1048572, 4, 0, -1048571, 4, 0, -1048570, 4, 0, -1048569, 4, 0, -1048568, 4, 0, -1048567, 4, 0, -983038, 4, 0, -983037, 4, 0, -983036, 4, 0, -983035, 4, 0, -983034, 4, 0, -983033, 4, 0, -983032, 4, 0, -983031, 4, 0, -917502, 4, 0, -917501, 4, 0, -917500, 4, 0, -917499, 4, 0, -917498, 4, 0, -917497, 4, 0, -917496, 4, 0, -917495, 4, 0, -851966, 4, 0, -851965, 4, 0, -851964, 4, 0, -851963, 4, 0, -851962, 4, 0, -851961, 4, 0, -851960, 4, 0, -851959, 4, 0, -720896, 4, 0, -720895, 4, 0, -720894, 4, 0, -720893, 4, 0, -720892, 4, 0, -720891, 4, 0, -720890, 4, 0, -720889, 4, 0, -720888, 4, 0, -720887, 4, 0, -720886, 4, 0, -720885, 4, 0, -720884, 4, 0, -720883, 4, 0, -655360, 4, 0, -655359, 4, 0, -655358, 4, 0, -655357, 4, 0, -655356, 4, 0, -655355, 4, 0, -655354, 4, 0, -655353, 4, 0, -655352, 4, 0, -655351, 4, 0, -655350, 4, 0, -655349, 4, 0, -655348, 4, 0, -655347, 4, 0, -589824, 4, 0, -589823, 4, 0, -589822, 4, 0, -589821, 4, 0, -589820, 4, 0, -589819, 4, 0, -589818, 4, 0, -589817, 4, 0, -589816, 4, 0, -589815, 4, 0, -589814, 4, 0, -589813, 4, 0, -589812, 4, 0, -589811, 4, 0, -458760, 4, 0, -458759, 4, 0, -458758, 4, 0, -458757, 4, 0, -458756, 4, 0, -458755, 4, 0, -458754, 4, 0, -458753, 4, 0, -524288, 4, 0, -524287, 4, 0, -524286, 4, 0, -524285, 4, 0, -524284, 4, 0, -524283, 4, 0, -524282, 4, 0, -524281, 4, 0, -524280, 4, 0, -524279, 4, 0, -524278, 4, 0, -524277, 4, 0, -524276, 4, 0, -524275, 4, 0, -393224, 4, 0, -393222, 4, 0, -393221, 4, 0, -393220, 4, 0, -393219, 4, 0, -393218, 4, 0, -393217, 4, 0, -458752, 4, 0, -458751, 4, 0, -458750, 4, 0, -458749, 4, 0, -458748, 4, 0, -458747, 4, 0, -458746, 4, 0, -458745, 4, 0, -458744, 4, 0, -458743, 4, 0, -458742, 4, 0, -458741, 4, 0, -458740, 4, 0, -458739, 4, 0, -327688, 4, 0, -327687, 4, 0, -327686, 4, 0, -327685, 4, 0, -327684, 4, 0, -327683, 4, 0, -327682, 4, 0, -327681, 4, 0, -393216, 4, 0, -393215, 4, 0, -393214, 4, 0, -393213, 4, 0, -393212, 4, 0, -393211, 4, 0, -393210, 4, 0, -393209, 4, 0, -393208, 4, 0, -393207, 4, 0, -393206, 4, 0, -393205, 4, 0, -393204, 4, 0, -393203, 4, 0, -327680, 4, 0, -327679, 4, 0, -327678, 4, 0, -327677, 4, 0, -327676, 4, 0, -327675, 4, 0, -327674, 4, 0, -327673, 4, 0, -327672, 4, 0, -327671, 4, 0, -327670, 4, 0, -327669, 4, 0, -327668, 4, 0, -327667, 4, 0, -196616, 4, 0, -196615, 4, 0, -196614, 4, 0, -196613, 4, 0, -196612, 4, 0, -196611, 4, 0, -196610, 4, 0, -196609, 4, 0, -262144, 4, 0, -262143, 4, 0, -262142, 4, 0, -262141, 4, 0, -262140, 4, 0, -262139, 4, 0, -262138, 4, 0, -262137, 4, 0, -262136, 4, 0, -262135, 4, 0, -262134, 4, 0, -262133, 4, 0, -262132, 4, 0, -262131, 4, 0, -196608, 4, 0, -196607, 4, 0, -196606, 4, 0, -196605, 4, 0, -196604, 4, 0, -196603, 4, 0, -196602, 4, 0, -196601, 4, 0, -196600, 4, 0, -65536, 4, 0, -65535, 4, 0, -65534, 4, 0, -65533, 4, 0, -65532, 4, 0, -65531, 4, 0, -65530, 4, 0, -65529, 4, 0, -65528, 4, 0, 0, 4, 0, 1, 4, 0, 2, 4, 0, 3, 4, 0, 4, 4, 0, 5, 4, 0, 6, 4, 0, 7, 4, 0, 8, 4, 0, 65536, 4, 0, 65537, 4, 0, 65538, 4, 0, 65539, 4, 0, 65540, 4, 0, 65541, 4, 0, 65542, 4, 0, 65543, 4, 0, 65544, 4, 0, 131072, 4, 0, 131073, 4, 0, 131074, 4, 0, 131075, 4, 0, 131076, 4, 0, 131077, 4, 0, 131078, 4, 0, 131079, 4, 0, 131080, 4, 0 )
tile_data = PoolIntArray( -1048574, 4, 0, -1048573, 4, 0, -1048572, 4, 0, -1048571, 4, 0, -1048570, 4, 0, -1048569, 4, 0, -1048568, 4, 0, -1048567, 4, 0, -983038, 4, 0, -983037, 4, 0, -983036, 4, 0, -983035, 4, 0, -983034, 4, 0, -983033, 4, 0, -983032, 4, 0, -983031, 4, 0, -917502, 4, 0, -917501, 4, 0, -917500, 4, 0, -917499, 4, 0, -917498, 4, 0, -917497, 4, 0, -917496, 4, 0, -917495, 4, 0, -851966, 4, 0, -851965, 4, 0, -851964, 4, 0, -851963, 4, 0, -851962, 4, 0, -851961, 4, 0, -851960, 4, 0, -851959, 4, 0, -786430, 1, 65537, -786423, 1, 65537, -720896, 4, 0, -720895, 4, 0, -720894, 4, 0, -720893, 4, 0, -720892, 4, 0, -720891, 4, 0, -720890, 4, 0, -720889, 4, 0, -720888, 4, 0, -720887, 4, 0, -720886, 4, 0, -720885, 4, 0, -720884, 4, 0, -720883, 4, 0, -655360, 4, 0, -655359, 4, 0, -655358, 4, 0, -655357, 4, 0, -655356, 4, 0, -655355, 4, 0, -655354, 4, 0, -655353, 4, 0, -655352, 4, 0, -655351, 4, 0, -655350, 4, 0, -655349, 4, 0, -655348, 4, 0, -655347, 4, 0, -589824, 4, 0, -589823, 4, 0, -589822, 4, 0, -589821, 4, 0, -589820, 4, 0, -589819, 4, 0, -589818, 4, 0, -589817, 4, 0, -589816, 4, 0, -589815, 4, 0, -589814, 4, 0, -589813, 4, 0, -589812, 4, 0, -589811, 4, 0, -458760, 4, 0, -458759, 4, 0, -458758, 4, 0, -458757, 4, 0, -458756, 4, 0, -458755, 4, 0, -458754, 4, 0, -458753, 4, 0, -524288, 4, 0, -524287, 4, 0, -524286, 4, 0, -524285, 4, 0, -524284, 4, 0, -524283, 4, 0, -524282, 4, 0, -524281, 4, 0, -524280, 4, 0, -524279, 4, 0, -524278, 4, 0, -524277, 4, 0, -524276, 4, 0, -524275, 4, 0, -393224, 4, 0, -393222, 4, 0, -393221, 4, 0, -393220, 4, 0, -393219, 4, 0, -393218, 4, 0, -393217, 4, 0, -458752, 4, 0, -458751, 4, 0, -458750, 4, 0, -458749, 4, 0, -458748, 4, 0, -458747, 4, 0, -458746, 4, 0, -458745, 4, 0, -458744, 4, 0, -458743, 4, 0, -458742, 4, 0, -458741, 4, 0, -458740, 4, 0, -458739, 4, 0, -327688, 4, 0, -327687, 4, 0, -327686, 4, 0, -327685, 4, 0, -327684, 4, 0, -327683, 4, 0, -327682, 4, 0, -327681, 4, 0, -393216, 4, 0, -393215, 4, 0, -393214, 4, 0, -393213, 4, 0, -393212, 4, 0, -393211, 4, 0, -393210, 4, 0, -393209, 4, 0, -393208, 4, 0, -393207, 4, 0, -393206, 4, 0, -393205, 4, 0, -393204, 4, 0, -393203, 4, 0, -327680, 4, 0, -327679, 4, 0, -327678, 4, 0, -327677, 4, 0, -327676, 4, 0, -327675, 4, 0, -327674, 4, 0, -327673, 4, 0, -327672, 4, 0, -327671, 4, 0, -327670, 4, 0, -327669, 4, 0, -327668, 4, 0, -327667, 4, 0, -196616, 4, 0, -196615, 4, 0, -196614, 4, 0, -196613, 4, 0, -196612, 4, 0, -196611, 4, 0, -196610, 4, 0, -196609, 4, 0, -262144, 4, 0, -262143, 4, 0, -262142, 4, 0, -262141, 4, 0, -262140, 4, 0, -262139, 4, 0, -262138, 4, 0, -262137, 4, 0, -262136, 4, 0, -262135, 4, 0, -262134, 4, 0, -262133, 4, 0, -262132, 4, 0, -262131, 4, 0, -196608, 4, 0, -196607, 4, 0, -196606, 4, 0, -196605, 4, 0, -196604, 4, 0, -196603, 4, 0, -196602, 4, 0, -196601, 4, 0, -196600, 4, 0, -65536, 4, 0, -65535, 4, 0, -65534, 4, 0, -65533, 4, 0, -65532, 4, 0, -65531, 4, 0, -65530, 4, 0, -65529, 4, 0, -65528, 4, 0, 0, 4, 0, 1, 4, 0, 2, 4, 0, 3, 4, 0, 4, 4, 0, 5, 4, 0, 6, 4, 0, 7, 4, 0, 8, 4, 0, 65536, 4, 0, 65537, 4, 0, 65538, 4, 0, 65539, 4, 0, 65540, 4, 0, 65541, 4, 0, 65542, 4, 0, 65543, 4, 0, 65544, 4, 0, 131072, 4, 0, 131073, 4, 0, 131074, 4, 0, 131075, 4, 0, 131076, 4, 0, 131077, 4, 0, 131078, 4, 0, 131079, 4, 0, 131080, 4, 0 )

[node name="YSortTileMap" parent="." index="1"]
tile_data = PoolIntArray( -1114110, 0, 0, -1114109, 0, 1, -1114108, 0, 1, -1114107, 0, 1, -1114106, 0, 1, -1114105, 0, 1, -1114104, 0, 1, -1114103, 0, 3, -1048574, 0, 65536, -1048567, 0, 65539, -983038, 0, 65536, -983031, 0, 65539, -917502, 0, 65536, -917495, 0, 65539, -851966, 0, 65536, -851959, 0, 65539, -720897, 0, 196610, -786432, 0, 1, -786431, 0, 1, -786430, 0, 1, -786429, 0, 1, -786428, 0, 1, -786425, 0, 1, -786424, 0, 1, -786423, 0, 1, -786422, 0, 1, -786421, 0, 1, -786420, 0, 1, -786419, 0, 3, -655361, 0, 65539, -720883, 0, 65539, -589825, 0, 65539, -655347, 0, 65539, -524296, 0, 0, -524295, 0, 1, -524294, 0, 1, -524293, 0, 1, -524292, 0, 1, -524291, 0, 1, -524290, 0, 1, -524289, 0, 327681, -589811, 0, 65539, -458760, 0, 65536, -458753, 0, 65539, -524275, 0, 65539, -393224, 0, 65536, -393217, 0, 65539, -458739, 0, 65539, -327688, 0, 65536, -327681, 0, 65539, -393203, 0, 65539, -262152, 0, 327680, -262151, 0, 1, -262150, 0, 1, -262149, 0, 131074, -262148, 0, 1, -262147, 0, 1, -262146, 0, 1, -262145, 0, 131075, -327667, 0, 65539, -196616, 0, 65536, -262131, 0, 65539, -131080, 0, 327682, -131079, 0, 262146, -131078, 0, 262146, -131077, 0, 262146, -131076, 0, 262147, -131075, 0, 262147, -131074, 0, 262147, -131073, 0, 262147, -196608, 0, 196611, -196600, 0, 196610, -196599, 0, 262146, -196598, 0, 262146, -196597, 0, 262146, -196596, 0, 262146, -196595, 0, 327683, -131072, 0, 327680, -131071, 0, 1, -131070, 0, 1, -131068, 0, 1, -131067, 0, 1, -131066, 0, 1, -131065, 0, 1, -131064, 0, 327681, -65536, 0, 65536, -65530, 2, 131080, -65528, 0, 65539, 0, 0, 65536, 5, 2, 131080, 7, 2, 131080, 8, 0, 65539, 65536, 0, 65536, 65542, 2, 131080, 65544, 0, 65539, 131072, 0, 65536, 131078, 2, 65544, 131079, 2, 65544, 131080, 0, 65539, 196608, 0, 327682, 196609, 0, 262146, 196610, 0, 262146, 196611, 0, 262146, 196612, 0, 262146, 196613, 0, 262146, 196614, 0, 262146, 196615, 0, 262146, 196616, 0, 327683 )
tile_data = PoolIntArray( -1114110, 0, 0, -1114109, 0, 1, -1114108, 0, 1, -1114107, 0, 1, -1114106, 0, 1, -1114105, 0, 1, -1114104, 0, 1, -1114103, 0, 3, -1048574, 0, 65536, -1048567, 0, 65539, -983038, 0, 65536, -983031, 0, 65539, -917502, 0, 65536, -917495, 0, 65539, -851966, 0, 65536, -851959, 0, 65539, -720897, 0, 196610, -786432, 0, 1, -786431, 0, 1, -786430, 0, 1, -786429, 0, 1, -786428, 0, 1, -786425, 0, 1, -786424, 0, 1, -786423, 0, 1, -786422, 0, 1, -786421, 0, 1, -786420, 0, 1, -786419, 0, 3, -655361, 0, 65539, -720883, 0, 65539, -589825, 0, 65539, -655347, 0, 65539, -524296, 0, 0, -524295, 0, 1, -524294, 0, 1, -524293, 0, 1, -524292, 0, 1, -524291, 0, 1, -524290, 0, 1, -524289, 0, 327681, -589811, 0, 65539, -458760, 0, 65536, -458753, 0, 65539, -524275, 0, 65539, -393224, 0, 65536, -393217, 0, 65539, -458739, 0, 65539, -327688, 0, 65536, -327681, 0, 65539, -393203, 0, 65539, -262152, 0, 327680, -262151, 0, 1, -262150, 0, 1, -262149, 0, 131074, -262148, 0, 1, -262147, 0, 1, -262146, 0, 1, -262145, 0, 131075, -327667, 0, 65539, -196616, 0, 65536, -262131, 0, 65539, -131080, 0, 327682, -131079, 0, 262146, -131078, 0, 262146, -131077, 0, 262146, -131076, 0, 262147, -131075, 0, 262147, -131074, 0, 262147, -131073, 0, 262147, -196608, 0, 196611, -196600, 0, 196610, -196599, 0, 262146, -196598, 0, 262146, -196597, 0, 262146, -196596, 0, 262146, -196595, 0, 327683, -131072, 0, 327680, -131071, 0, 1, -131070, 0, 1, -131068, 0, 1, -131067, 0, 1, -131066, 0, 1, -131065, 0, 1, -131064, 0, 327681, -65536, 0, 65536, -65530, 2, 131080, -65528, 0, 65539, 0, 0, 65536, 5, 2, 131080, 7, 2, 131080, 8, 0, 65539, 65536, 0, 65536, 65542, 2, 131080, 65544, 0, 65539, 131072, 0, 65536, 131080, 0, 65539, 196608, 0, 327682, 196609, 0, 262146, 196610, 0, 262146, 196611, 0, 262146, 196612, 0, 262146, 196613, 0, 262146, 196614, 0, 262146, 196615, 0, 262146, 196616, 0, 327683 )

[node name="Sign" parent="YSortTileMap" index="0" instance=ExtResource( 2 )]
position = Vector2( 36, -5 )
Expand Down
11 changes: 0 additions & 11 deletions Levels/Level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ onready var ySortTileMap = $YSortTileMap
onready var deathWaitTime = $DeathWaitTime

func _ready():
Events.connect("no_save_data", self, "_on_Events_no_save_data")
Events.connect("yesno_answer", self, "_on_Events_yesno_answer")
PlayerStats.connect("no_health", self, "_on_PlayerStats_no_health")
spawn()
Expand Down Expand Up @@ -45,16 +44,6 @@ func _on_Events_yesno_answer(question, answer):
get_tree().quit(0)


func _on_Events_no_save_data():
call_deferred("trigger_spawners")


func trigger_spawners():
for child in ySortTileMap.get_children():
if child is NPCSpawner:
child.spawn()


func save_data():
var data = {
level_id = LEVEL_ID,
Expand Down
Loading

0 comments on commit d157e62

Please sign in to comment.