lose condition

This commit is contained in:
archfan 2020-04-20 20:55:58 -04:00
parent b1b5d6e186
commit 8ce9ada279

View File

@ -8,6 +8,9 @@ var last_mv_delta = 0
func get_fall_offset(): func get_fall_offset():
var state = get_parent().get_state() var state = get_parent().get_state()
var tile_below = get_pos() + Vector2(0, 1) var tile_below = get_pos() + Vector2(0, 1)
if state.player_pos == tile_below:
OS.window_size = Vector2(1024,600)
get_tree().change_scene("res://Defeat.tscn")
if tile_below.y > len(state.level_map) - 1: if tile_below.y > len(state.level_map) - 1:
return null return null
if state.get_type(tile_below) == "Empty": if state.get_type(tile_below) == "Empty":