forked from team-sg/hero-mark-2
renamed game.golds into game.keys
This commit is contained in:
parent
bc57ba4171
commit
51a6a6c10d
7 changed files with 14 additions and 15 deletions
|
@ -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()
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue