renamed game.golds into game.keys
This commit is contained in:
parent
bc57ba4171
commit
51a6a6c10d
7 changed files with 14 additions and 15 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue