diff --git a/Game Scenes/Game.tscn b/Game Scenes/Game.tscn index 048edfc..3293dbc 100644 --- a/Game Scenes/Game.tscn +++ b/Game Scenes/Game.tscn @@ -83,11 +83,10 @@ __meta__ = { position = Vector2( -8.0022, -34.2137 ) scale = Vector2( 0.401688, 0.401688 ) frames = SubResource( 6 ) -frame = 3 +frame = 1 playing = true [node name="Theme Music" type="AudioStreamPlayer" parent="Rocket"] -pause_mode = 2 stream = ExtResource( 9 ) autoplay = true @@ -111,6 +110,7 @@ texture = ExtResource( 3 ) [node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="PauseButton" type="TextureButton" parent="CanvasLayer"] +pause_mode = 2 anchor_left = 1.0 anchor_top = 1.0 anchor_right = 1.0 diff --git a/Images and Anims/In Game/pausebutton.png b/Images and Anims/In Game/pausebutton.png index a1f252f..f2c3486 100644 Binary files a/Images and Anims/In Game/pausebutton.png and b/Images and Anims/In Game/pausebutton.png differ diff --git a/Scripts/Game.gd b/Scripts/Game.gd index ec02626..59405cb 100644 --- a/Scripts/Game.gd +++ b/Scripts/Game.gd @@ -9,6 +9,8 @@ var asteroidSpawnRepeat = 0 var hiscore = 0 var numOfCoins = 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") func load_game(): @@ -23,6 +25,7 @@ func load_game(): func _ready(): load_game() + $CanvasLayer/PauseButton.texture_normal = play_button $CanvasLayer/PauseButton.connect("pressed", self, "_pause_game") func _process(delta): @@ -61,6 +64,10 @@ func save(): func _pause_game(): print(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(): var save_game = File.new()