forked from team-sg/hero-mark-2
game.gd cleaning and partial results screen implementation
This commit is contained in:
parent
b126484109
commit
e2b3db0b93
16 changed files with 425 additions and 436 deletions
|
@ -1,4 +1,7 @@
|
|||
extends Node2D
|
||||
|
||||
const PauseScreen := preload("res://objects/hud/pause_screen.tscn")
|
||||
|
||||
export var target_time_any = 0
|
||||
export var target_time_100 = 0
|
||||
export (AudioStream) var music
|
||||
|
@ -16,12 +19,14 @@ func _ready():
|
|||
Fade.connect("fade_finished", get_tree(), "set_pause", [false], CONNECT_ONESHOT)
|
||||
Fade.connect("fade_finished", Game, "set", ["can_pause", true], CONNECT_ONESHOT)
|
||||
Audio.play_music(music)
|
||||
Game.time = 0.0
|
||||
|
||||
func _physics_process(delta):
|
||||
Game.time += delta
|
||||
if Debug.entry == false && Game.can_pause:
|
||||
#Pause
|
||||
if Input.is_action_just_pressed("pause") && !get_tree().paused:
|
||||
var pause = Game.pause_screen.instance()
|
||||
var pause = PauseScreen.instance()
|
||||
if lore_entries != null && !lore_entries.empty():
|
||||
var entry = lore_entries[randi() % lore_entries.size()]
|
||||
pause.lore_entry = entry
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extends "res://maps/map.gd"
|
||||
|
||||
var acab_shard_has_been_collected = false
|
||||
var acab_shard_has_been_collected: bool = false
|
||||
|
||||
func _physics_process(delta):
|
||||
._physics_process(delta)
|
||||
|
@ -8,6 +8,5 @@ func _physics_process(delta):
|
|||
if !acab_shard_has_been_collected:
|
||||
Audio.play_shard_sound()
|
||||
Game.score += 500
|
||||
Game.shards += 1
|
||||
Game.shards_collected[0] = true
|
||||
acab_shard_has_been_collected = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue