diff --git a/autoloads/game.gd b/autoloads/game.gd index 5aad72b..1f5f8f4 100644 --- a/autoloads/game.gd +++ b/autoloads/game.gd @@ -4,7 +4,7 @@ var resolution = Vector2(256,192) var current_sector = Vector2(0,0) #Onreadys #Collectibles -var golds = 0 +var keys = 0 var stars = [false,false,false,false,false] var shards = 0 var arrows = 0 @@ -60,7 +60,7 @@ func change_map(map: PackedScene): #Clear data func clear_collectibles(): score = 0 - golds = 0 + keys = 0 stars = [false,false,false,false,false] shards = 0 shards_collected = [false,false,false,false,false,false,false,false,false,false] @@ -72,7 +72,7 @@ func clear_collectibles(): func save(): var save_id = LevelData.levels[current_level].save_id var save_data = Save.get_level_data(save_id) - var is_100 = shards >= 5 && golds >= 50 + var is_100 = shards >= 5 && keys >= 50 # set score and time depending on completion if score > save_data["score_100" if is_100 else "score_any"]: Save.set_score(save_id, score, is_100) @@ -103,7 +103,7 @@ func timeify(input): func restart_level(): if score > high_score: high_score = score score = 0 - golds = 0 + keys = 0 stars = [false,false,false,false,false] shards = 0 arrows = 0 @@ -125,7 +125,7 @@ func freeze_frame(time): #Check if 100%ed func has_collection_bonus(): - return shards == 5 && golds == 50 + return shards == 5 && keys == 50 # called when player dies func _on_player_died() -> void: diff --git a/maps/map.gd b/maps/map.gd index 36aba9f..e5e4b62 100644 --- a/maps/map.gd +++ b/maps/map.gd @@ -30,7 +30,7 @@ func _physics_process(delta): if Input.is_action_just_pressed("restart"): Game.call_deferred("restart_level") - if Game.golds == 50 && Game.shards == 5: + if Game.keys == 50 && Game.shards == 5: #Time bonus collectible_bonus = true #Time bonus diff --git a/objects/collectibles/key.gd b/objects/collectibles/key.gd index 99470af..f33eaca 100644 --- a/objects/collectibles/key.gd +++ b/objects/collectibles/key.gd @@ -9,7 +9,7 @@ func _ready(): func _on_Area2D_area_entered(area): #Collect if area.is_in_group("player_hitbox"): - Game.golds += value + Game.keys += value Game.score += 5 Audio.play_sound(Audio.a_gold,Audio.ac_collectible) queue_free() diff --git a/objects/environment/barrier/barrier.gd b/objects/environment/barrier/barrier.gd index 001f01e..95ae0ac 100644 --- a/objects/environment/barrier/barrier.gd +++ b/objects/environment/barrier/barrier.gd @@ -21,7 +21,7 @@ func _ready(): func _physics_process(delta): #Open - if Game.golds >= cost: open = true + if Game.keys >= cost: open = true if open == true: sprite.region_rect.size.y -= 1 if sprite.region_rect.size.y < 1: queue_free() diff --git a/objects/environment/exit/exit.gd b/objects/environment/exit/exit.gd index 16044c0..985b7f1 100644 --- a/objects/environment/exit/exit.gd +++ b/objects/environment/exit/exit.gd @@ -11,7 +11,7 @@ func _ready(): func _physics_process(delta): - if Game.shards >= cost: + if Game.keys >= cost: anims.play("open") func _on_Area2D_area_entered(area): @@ -19,13 +19,13 @@ func _on_Area2D_area_entered(area): if Game.score > Game.high_score: Game.high_score = Game.score #BONUSES #Collection bonus - if Game.golds == 50: Game.score += 500 + if Game.keys == 50: Game.score += 500 if Game.shards == 5: Game.score += 500 - if Game.golds == 50 && Game.shards == 5: + if Game.keys == 50 && Game.shards == 5: Game.score += 250 Game.shards_collected[5] = true #Time bonus - if Game.golds == 50 && Game.shards == 5: + if Game.keys == 50 && Game.shards == 5: if Game.time < map.target_time_100: Game.score += max(2500 - 2500 * int(Game.time / map.target_time_100), 0) Game.shards_collected[6] = true @@ -39,7 +39,7 @@ func _on_Area2D_area_entered(area): Game.score += 1500 Game.shards_collected[7] = true #Perfect bonus - if Game.lives == 2 && Game.golds == 50 && Game.shards == 5 && Game.time < map.target_time_100: + if Game.lives == 2 && Game.keys == 50 && Game.shards == 5 && Game.time < map.target_time_100: Game.score += 1000 Game.save() Game.change_map(load("res://maps/level_select.tscn")) diff --git a/objects/environment/exit/exit.tscn b/objects/environment/exit/exit.tscn index 4c49a6b..6ac8ca8 100644 --- a/objects/environment/exit/exit.tscn +++ b/objects/environment/exit/exit.tscn @@ -5,7 +5,6 @@ [ext_resource path="res://graphics/exit/exit.png" type="Texture" id=3] [ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=4] - [sub_resource type="ShaderMaterial" id=1] shader = ExtResource( 4 ) shader_param/border_color = Color( 0, 0, 0, 1 ) diff --git a/objects/hud/hud.gd b/objects/hud/hud.gd index 01f8949..4382b18 100644 --- a/objects/hud/hud.gd +++ b/objects/hud/hud.gd @@ -28,7 +28,7 @@ func _ready(): func _physics_process(delta): #Gold Counter - gold_counter.text = "%02d" % Game.golds + gold_counter.text = "%02d" % Game.keys #Shard Counter shard_counter.text = str(Game.shards) #Star Counter