diff --git a/Fonts/BigShouldersDisplay-Medium.ttf b/Fonts/BigShouldersDisplay-Medium.ttf new file mode 100644 index 0000000..dce16ad Binary files /dev/null and b/Fonts/BigShouldersDisplay-Medium.ttf differ diff --git a/Game Scenes/Game.tscn b/Game Scenes/Game.tscn index eb3267e..048edfc 100644 --- a/Game Scenes/Game.tscn +++ b/Game Scenes/Game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=2] +[gd_scene load_steps=18 format=2] [ext_resource path="res://Objects/Rocket.tscn" type="PackedScene" id=1] [ext_resource path="res://Scripts/Rocket.gd" type="Script" id=2] @@ -10,6 +10,7 @@ [ext_resource path="res://Music and Sounds/explosion.ogg" type="AudioStream" id=8] [ext_resource path="res://Music and Sounds/astervoid-theme.ogg" type="AudioStream" id=9] [ext_resource path="res://Music and Sounds/rocket-launch.ogg" type="AudioStream" id=10] +[ext_resource path="res://Images and Anims/In Game/playbutton.png" type="Texture" id=11] [sub_resource type="AtlasTexture" id=1] flags = 4 @@ -82,10 +83,11 @@ __meta__ = { position = Vector2( -8.0022, -34.2137 ) scale = Vector2( 0.401688, 0.401688 ) frames = SubResource( 6 ) -frame = 1 +frame = 3 playing = true [node name="Theme Music" type="AudioStreamPlayer" parent="Rocket"] +pause_mode = 2 stream = ExtResource( 9 ) autoplay = true @@ -99,9 +101,25 @@ autoplay = true [node name="ParallaxBackground" type="ParallaxBackground" parent="."] [node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] -motion_scale = Vector2( 0.01, 0.01 ) +motion_scale = Vector2( 0.1, 0.1 ) [node name="Background" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] -position = Vector2( 89.4544, -100.794 ) -scale = Vector2( 5, 5 ) +position = Vector2( 174.306, -100.794 ) +scale = Vector2( 7.46004, 7.46004 ) texture = ExtResource( 3 ) + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="PauseButton" type="TextureButton" parent="CanvasLayer"] +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = -173.0 +margin_top = -231.0 +margin_right = -40.0 +margin_bottom = -48.0 +texture_normal = ExtResource( 11 ) +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/Game Scenes/Main Menu.tscn b/Game Scenes/Main Menu.tscn index 8efdc4c..5ef8c3b 100644 --- a/Game Scenes/Main Menu.tscn +++ b/Game Scenes/Main Menu.tscn @@ -1,13 +1,15 @@ -[gd_scene load_steps=17 format=2] +[gd_scene load_steps=21 format=2] [ext_resource path="res://Scripts/Text Container.gd" type="Script" id=1] [ext_resource path="res://Objects/Rocket.tscn" type="PackedScene" id=2] [ext_resource path="res://Images and Anims/In Game/background.png" type="Texture" id=3] [ext_resource path="res://Fonts/FasterOne-Regular.ttf" type="DynamicFontData" id=4] [ext_resource path="res://Scripts/MenuCoinLabel.gd" type="Script" id=5] -[ext_resource path="res://Music and Sounds/menu.ogg" type="AudioStream" id=6] +[ext_resource path="res://Scripts/HiScoreLabel.gd" type="Script" id=6] [ext_resource path="res://Images and Anims/In Game/coin.png" type="Texture" id=7] [ext_resource path="res://Fonts/TurretRoad-Medium.ttf" type="DynamicFontData" id=8] +[ext_resource path="res://Scripts/ScoreLabel.gd" type="Script" id=9] +[ext_resource path="res://Fonts/BigShouldersDisplay-Medium.ttf" type="DynamicFontData" id=10] [sub_resource type="DynamicFont" id=1] size = 96 @@ -52,6 +54,18 @@ animations = [ { "speed": 8.0 } ] +[sub_resource type="DynamicFont" id=9] +size = 24 +outline_size = 1 +outline_color = Color( 0, 0, 0, 1 ) +font_data = ExtResource( 10 ) + +[sub_resource type="DynamicFont" id=10] +size = 24 +outline_size = 1 +outline_color = Color( 0, 0, 0, 1 ) +font_data = ExtResource( 10 ) + [node name="MarginContainer" type="MarginContainer"] anchor_right = 1.0 anchor_bottom = 1.0 @@ -83,7 +97,6 @@ position = Vector2( 0, -34 ) scale = Vector2( 10, 10 ) [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="HBoxContainer/VBoxContainer/CenterContainer/Rocket"] -stream = ExtResource( 6 ) autoplay = true [node name="TextContainer" type="Node2D" parent="HBoxContainer/VBoxContainer/CenterContainer"] @@ -118,7 +131,7 @@ position = Vector2( 0, -576 ) scale = Vector2( 3, 3 ) frames = SubResource( 8 ) animation = "spin" -frame = 3 +frame = 1 playing = true [node name="Label" type="Label" parent="HBoxContainer/VBoxContainer/CenterContainer/Coin"] @@ -133,6 +146,34 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="Label3" type="Label" parent="HBoxContainer/VBoxContainer/CenterContainer/Coin"] +margin_left = -110.0 +margin_top = 129.667 +margin_right = -63.0 +margin_bottom = 143.667 +custom_fonts/font = SubResource( 9 ) +align = 1 +valign = 1 +uppercase = true +script = ExtResource( 9 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label4" type="Label" parent="HBoxContainer/VBoxContainer/CenterContainer/Coin"] +margin_left = 55.333 +margin_top = 130.0 +margin_right = 102.333 +margin_bottom = 144.0 +custom_fonts/font = SubResource( 10 ) +align = 1 +valign = 1 +uppercase = true +script = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Background" type="Sprite" parent="."] position = Vector2( -205.108, 755.715 ) scale = Vector2( 4.46278, 4.46278 ) diff --git a/Images and Anims/In Game/.DS_Store b/Images and Anims/In Game/.DS_Store index b1468d6..2a9ee65 100644 Binary files a/Images and Anims/In Game/.DS_Store and b/Images and Anims/In Game/.DS_Store differ diff --git a/Images and Anims/In Game/background.png b/Images and Anims/In Game/background.png index 6d22a42..e5149bb 100644 Binary files a/Images and Anims/In Game/background.png and b/Images and Anims/In Game/background.png differ diff --git a/Images and Anims/In Game/background.png.bak b/Images and Anims/In Game/background.png.bak new file mode 100644 index 0000000..2a51b21 Binary files /dev/null and b/Images and Anims/In Game/background.png.bak differ diff --git a/Images and Anims/In Game/pausebutton.png b/Images and Anims/In Game/pausebutton.png new file mode 100644 index 0000000..a1f252f Binary files /dev/null and b/Images and Anims/In Game/pausebutton.png differ diff --git a/Images and Anims/In Game/pausebutton.png.import b/Images and Anims/In Game/pausebutton.png.import new file mode 100644 index 0000000..97501d3 --- /dev/null +++ b/Images and Anims/In Game/pausebutton.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/pausebutton.png-fce1a35638d9c9e5e5680ee254349c04.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images and Anims/In Game/pausebutton.png" +dest_files=[ "res://.import/pausebutton.png-fce1a35638d9c9e5e5680ee254349c04.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Images and Anims/In Game/playbutton.png b/Images and Anims/In Game/playbutton.png new file mode 100644 index 0000000..2c0b06f Binary files /dev/null and b/Images and Anims/In Game/playbutton.png differ diff --git a/Images and Anims/In Game/playbutton.png.import b/Images and Anims/In Game/playbutton.png.import new file mode 100644 index 0000000..b2f18c2 --- /dev/null +++ b/Images and Anims/In Game/playbutton.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/playbutton.png-f46f169e8e383816c2f7e25c5dc62b3c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images and Anims/In Game/playbutton.png" +dest_files=[ "res://.import/playbutton.png-f46f169e8e383816c2f7e25c5dc62b3c.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Images and Anims/Other/icon.png b/Images and Anims/Other/icon.png index 5a5634c..f038ca1 100644 Binary files a/Images and Anims/Other/icon.png and b/Images and Anims/Other/icon.png differ diff --git a/Music and Sounds/menu.ogg.import b/Music and Sounds/menu.ogg.import deleted file mode 100644 index d08bad5..0000000 --- a/Music and Sounds/menu.ogg.import +++ /dev/null @@ -1,15 +0,0 @@ -[remap] - -importer="ogg_vorbis" -type="AudioStreamOGGVorbis" -path="res://.import/menu.ogg-98e0c28691ee2b4507b45873b3dde0d1.oggstr" - -[deps] - -source_file="res://Music and Sounds/menu.ogg" -dest_files=[ "res://.import/menu.ogg-98e0c28691ee2b4507b45873b3dde0d1.oggstr" ] - -[params] - -loop=true -loop_offset=0 diff --git a/Scripts/Game.gd b/Scripts/Game.gd index aa1a56e..ec02626 100644 --- a/Scripts/Game.gd +++ b/Scripts/Game.gd @@ -8,6 +8,7 @@ var deltaSpawnTime = 1 var asteroidSpawnRepeat = 0 var hiscore = 0 var numOfCoins = 0 +var lastscore = 0 onready var rocketNode = get_node("Rocket") func load_game(): @@ -22,9 +23,11 @@ func load_game(): func _ready(): load_game() + $CanvasLayer/PauseButton.connect("pressed", self, "_pause_game") func _process(delta): if rocketNode.collided: + lastscore = $"Rocket".lastscore save_data() spawnTime = 500/get_viewport_rect().size.x * deltaSpawnTime time += delta @@ -50,10 +53,15 @@ func _process(delta): func save(): var save_dict = { "hiscore" : hiscore, + "lastscore" : lastscore, "numOfCoins" : numOfCoins } return save_dict +func _pause_game(): + print(get_tree().paused) + get_tree().paused = !get_tree().paused + func save_data(): var save_game = File.new() save_game.open("user://savegame.save", File.WRITE) diff --git a/Scripts/HiScoreLabel.gd b/Scripts/HiScoreLabel.gd new file mode 100644 index 0000000..56195a2 --- /dev/null +++ b/Scripts/HiScoreLabel.gd @@ -0,0 +1,17 @@ +extends Label + +var hiscore = 0 + +func load_game(): + var save_game = File.new() + if not save_game.file_exists("user://savegame.save"): + return + save_game.open("user://savegame.save", File.READ) + while save_game.get_position() < save_game.get_len(): + var data = parse_json(save_game.get_line()) + hiscore = data["hiscore"] + + +func _ready(): + load_game() + text="Hi-Score\n" + str(round(hiscore)) diff --git a/Scripts/MenuCoinLabel.gd b/Scripts/MenuCoinLabel.gd index 49052c6..b18075c 100644 --- a/Scripts/MenuCoinLabel.gd +++ b/Scripts/MenuCoinLabel.gd @@ -16,4 +16,3 @@ func load_game(): func _ready(): load_game() text = str(numOfCoins) - diff --git a/Scripts/MenuLabels.gd b/Scripts/MenuLabels.gd new file mode 100644 index 0000000..7b2281d --- /dev/null +++ b/Scripts/MenuLabels.gd @@ -0,0 +1,31 @@ +extends Node2D + +var lastscore = 0 +var hiscore = 0 + +func load_game(): + var save_game = File.new() + if not save_game.file_exists("user://savegame.save"): + return + save_game.open("user://savegame.save", File.READ) + while save_game.get_position() < save_game.get_len(): + var data = parse_json(save_game.get_line()) + # lastscore = data["lastscore"] + hiscore = data["hiscore"] + +func _ready(): + load_game() + var ScoreLabel = Label.new() + add_child(ScoreLabel) + ScoreLabel.set_owner(get_tree().get_edited_scene_root()) + var HiScoreLabel = Label.new() + add_child(HiScoreLabel) + HiScoreLabel.set_owner(get_tree().get_edited_scene_root()) + + ScoreLabel.text = str(lastscore) + HiScoreLabel.text = str(hiscore) + + + print(ScoreLabel.text) + print (HiScoreLabel.text) + print(HiScoreLabel.rect_position) diff --git a/Scripts/PauseButton.gd b/Scripts/PauseButton.gd new file mode 100644 index 0000000..3ba191e --- /dev/null +++ b/Scripts/PauseButton.gd @@ -0,0 +1,4 @@ +extends Button + +func _process(delta): + diff --git a/Scripts/Rocket.gd b/Scripts/Rocket.gd index f01f549..0671f3f 100644 --- a/Scripts/Rocket.gd +++ b/Scripts/Rocket.gd @@ -7,6 +7,7 @@ var explosionObj = load("res://Objects/Explosion.tscn") var collided = false var isScreenPressed = false var screenPressLocation = get_viewport().get_rect().size/2 +var lastscore onready var gameNode = get_node("/root/Game") func _ready(): @@ -19,9 +20,8 @@ func _process(delta): var score = -position.y/10 var collision = move_and_collide(Vector2(difficulty * sin(angle) * delta, -difficulty * cos(angle) * delta)) if collision: - # $"Theme Music".stop() $Explosion.play() - var lastscore = score + lastscore = score if score > gameNode.hiscore: gameNode.hiscore = score score = 0 diff --git a/Scripts/ScoreLabel.gd b/Scripts/ScoreLabel.gd new file mode 100644 index 0000000..98e24fe --- /dev/null +++ b/Scripts/ScoreLabel.gd @@ -0,0 +1,17 @@ +extends Label + +var lastscore = 0 + +func load_game(): + var save_game = File.new() + if not save_game.file_exists("user://savegame.save"): + return + save_game.open("user://savegame.save", File.READ) + while save_game.get_position() < save_game.get_len(): + var data = parse_json(save_game.get_line()) + lastscore = data["lastscore"] + + +func _ready(): + load_game() + text="Score\n" + str(round(lastscore)) diff --git a/export_presets.cfg b/export_presets.cfg index af73e8c..b7fb65e 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -137,7 +137,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../iOS/Version 2.0/Build 2.0/astervoid.ipa" +export_path="../iOS Builds/2.8/astervoid.ipa" patch_list=PoolStringArray( ) script_export_mode=1 script_encryption_key="" @@ -158,7 +158,7 @@ application/info="Made with Godot Engine" application/identifier="com.ADAwesomeGames.AsterVoid" application/signature="" application/short_version="2.0" -application/version="2.3" +application/version="2.8" application/copyright="2021 AD Awesome Games" capabilities/arkit=false capabilities/camera=false diff --git a/project.godot b/project.godot index 385d5fb..e0296ed 100644 --- a/project.godot +++ b/project.godot @@ -25,6 +25,8 @@ config/icon="res://Images and Anims/Other/icon.png" window/size/width=828 window/size/height=1792 +window/stretch/mode="viewport" +window/stretch/aspect="expand" [input]