|
@ -9,6 +9,8 @@ var asteroidSpawnRepeat = 0 |
|
|
var hiscore = 0 |
|
|
var hiscore = 0 |
|
|
var numOfCoins = 0 |
|
|
var numOfCoins = 0 |
|
|
var lastscore = 0 |
|
|
var lastscore = 0 |
|
|
|
|
|
var pause_button = preload("res://Images and Anims/In Game/pausebutton.png") |
|
|
|
|
|
var play_button = preload("res://Images and Anims/In Game/playbutton.png") |
|
|
onready var rocketNode = get_node("Rocket") |
|
|
onready var rocketNode = get_node("Rocket") |
|
|
|
|
|
|
|
|
func load_game(): |
|
|
func load_game(): |
|
@ -23,6 +25,7 @@ func load_game(): |
|
|
|
|
|
|
|
|
func _ready(): |
|
|
func _ready(): |
|
|
load_game() |
|
|
load_game() |
|
|
|
|
|
$CanvasLayer/PauseButton.texture_normal = play_button |
|
|
$CanvasLayer/PauseButton.connect("pressed", self, "_pause_game") |
|
|
$CanvasLayer/PauseButton.connect("pressed", self, "_pause_game") |
|
|
|
|
|
|
|
|
func _process(delta): |
|
|
func _process(delta): |
|
@ -61,6 +64,10 @@ func save(): |
|
|
func _pause_game(): |
|
|
func _pause_game(): |
|
|
print(get_tree().paused) |
|
|
print(get_tree().paused) |
|
|
get_tree().paused = !get_tree().paused |
|
|
get_tree().paused = !get_tree().paused |
|
|
|
|
|
if (!get_tree().paused): |
|
|
|
|
|
$CanvasLayer/PauseButton.texture_normal = play_button |
|
|
|
|
|
else: |
|
|
|
|
|
$CanvasLayer/PauseButton.texture_normal = pause_button |
|
|
|
|
|
|
|
|
func save_data(): |
|
|
func save_data(): |
|
|
var save_game = File.new() |
|
|
var save_game = File.new() |
|
|