renamed game.golds into game.keys

This commit is contained in:
pennyrigate 2023-05-08 03:16:41 -04:00
parent bc57ba4171
commit 51a6a6c10d
7 changed files with 14 additions and 15 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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"))

View file

@ -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 )

View file

@ -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