Browse Source
The menu aligned weirdly on larger screens, so I completely redid it. I also fixed some music stuff.master
Abheek Dhawan
4 years ago
15 changed files with 340 additions and 30 deletions
@ -0,0 +1,140 @@ |
|||
[gd_scene load_steps=17 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://Images and Anims/In Game/coin.png" type="Texture" id=7] |
|||
[ext_resource path="res://Fonts/TurretRoad-Medium.ttf" type="DynamicFontData" id=8] |
|||
|
|||
[sub_resource type="DynamicFont" id=1] |
|||
size = 96 |
|||
use_filter = true |
|||
font_data = ExtResource( 4 ) |
|||
|
|||
[sub_resource type="DynamicFont" id=2] |
|||
size = 50 |
|||
use_filter = true |
|||
font_data = ExtResource( 8 ) |
|||
|
|||
[sub_resource type="AtlasTexture" id=3] |
|||
flags = 4 |
|||
atlas = ExtResource( 7 ) |
|||
region = Rect2( 0, 0, 16, 16 ) |
|||
|
|||
[sub_resource type="AtlasTexture" id=4] |
|||
flags = 4 |
|||
atlas = ExtResource( 7 ) |
|||
region = Rect2( 16, 0, 16, 16 ) |
|||
|
|||
[sub_resource type="AtlasTexture" id=5] |
|||
flags = 4 |
|||
atlas = ExtResource( 7 ) |
|||
region = Rect2( 32, 0, 16, 16 ) |
|||
|
|||
[sub_resource type="AtlasTexture" id=6] |
|||
flags = 4 |
|||
atlas = ExtResource( 7 ) |
|||
region = Rect2( 48, 0, 16, 16 ) |
|||
|
|||
[sub_resource type="AtlasTexture" id=7] |
|||
flags = 4 |
|||
atlas = ExtResource( 7 ) |
|||
region = Rect2( 64, 0, 16, 16 ) |
|||
|
|||
[sub_resource type="SpriteFrames" id=8] |
|||
animations = [ { |
|||
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ], |
|||
"loop": true, |
|||
"name": "spin", |
|||
"speed": 8.0 |
|||
} ] |
|||
|
|||
[node name="MarginContainer" type="MarginContainer"] |
|||
anchor_right = 1.0 |
|||
anchor_bottom = 1.0 |
|||
margin_left = 40.0 |
|||
margin_top = 60.0 |
|||
margin_right = -40.0 |
|||
margin_bottom = -60.0 |
|||
__meta__ = { |
|||
"_edit_use_anchors_": false |
|||
} |
|||
|
|||
[node name="HBoxContainer" type="HBoxContainer" parent="."] |
|||
margin_right = 748.0 |
|||
margin_bottom = 1672.0 |
|||
alignment = 1 |
|||
|
|||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] |
|||
margin_left = 374.0 |
|||
margin_right = 374.0 |
|||
margin_bottom = 1672.0 |
|||
alignment = 1 |
|||
|
|||
[node name="CenterContainer" type="CenterContainer" parent="HBoxContainer/VBoxContainer"] |
|||
margin_top = 836.0 |
|||
margin_bottom = 836.0 |
|||
|
|||
[node name="Rocket" parent="HBoxContainer/VBoxContainer/CenterContainer" instance=ExtResource( 2 )] |
|||
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"] |
|||
script = ExtResource( 1 ) |
|||
|
|||
[node name="Title" type="Label" parent="HBoxContainer/VBoxContainer/CenterContainer/TextContainer"] |
|||
margin_left = -314.373 |
|||
margin_top = -463.476 |
|||
margin_right = 298.627 |
|||
margin_bottom = -360.476 |
|||
custom_fonts/font = SubResource( 1 ) |
|||
text = "AsterVoid" |
|||
align = 1 |
|||
valign = 1 |
|||
__meta__ = { |
|||
"_edit_use_anchors_": false |
|||
} |
|||
|
|||
[node name="Tap" type="Label" parent="HBoxContainer/VBoxContainer/CenterContainer/TextContainer"] |
|||
margin_left = -145.271 |
|||
margin_top = 575.036 |
|||
margin_right = 133.729 |
|||
margin_bottom = 631.036 |
|||
custom_fonts/font = SubResource( 2 ) |
|||
text = "Tap to play!" |
|||
__meta__ = { |
|||
"_edit_use_anchors_": false |
|||
} |
|||
|
|||
[node name="Coin" type="AnimatedSprite" parent="HBoxContainer/VBoxContainer/CenterContainer"] |
|||
position = Vector2( 0, -576 ) |
|||
scale = Vector2( 3, 3 ) |
|||
frames = SubResource( 8 ) |
|||
animation = "spin" |
|||
frame = 3 |
|||
playing = true |
|||
|
|||
[node name="Label" type="Label" parent="HBoxContainer/VBoxContainer/CenterContainer/Coin"] |
|||
margin_left = -20.0941 |
|||
margin_top = 10.2118 |
|||
margin_right = 19.9059 |
|||
margin_bottom = 24.2118 |
|||
align = 1 |
|||
valign = 1 |
|||
script = ExtResource( 5 ) |
|||
__meta__ = { |
|||
"_edit_use_anchors_": false |
|||
} |
|||
|
|||
[node name="Background" type="Sprite" parent="."] |
|||
position = Vector2( -205.108, 755.715 ) |
|||
scale = Vector2( 4.46278, 4.46278 ) |
|||
z_index = -1 |
|||
texture = ExtResource( 3 ) |
@ -0,0 +1,15 @@ |
|||
[remap] |
|||
|
|||
importer="ogg_vorbis" |
|||
type="AudioStreamOGGVorbis" |
|||
path="res://.import/astervoid-theme.ogg-a19f6329a925ed04906f07d1cea27df9.oggstr" |
|||
|
|||
[deps] |
|||
|
|||
source_file="res://Music and Sounds/astervoid-theme.ogg" |
|||
dest_files=[ "res://.import/astervoid-theme.ogg-a19f6329a925ed04906f07d1cea27df9.oggstr" ] |
|||
|
|||
[params] |
|||
|
|||
loop=true |
|||
loop_offset=0 |
@ -0,0 +1,15 @@ |
|||
[remap] |
|||
|
|||
importer="ogg_vorbis" |
|||
type="AudioStreamOGGVorbis" |
|||
path="res://.import/explosion.ogg-4d556cc01747f8e6512723901c5a9895.oggstr" |
|||
|
|||
[deps] |
|||
|
|||
source_file="res://Music and Sounds/explosion.ogg" |
|||
dest_files=[ "res://.import/explosion.ogg-4d556cc01747f8e6512723901c5a9895.oggstr" ] |
|||
|
|||
[params] |
|||
|
|||
loop=false |
|||
loop_offset=0 |
@ -0,0 +1,15 @@ |
|||
[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 |
@ -0,0 +1,15 @@ |
|||
[remap] |
|||
|
|||
importer="ogg_vorbis" |
|||
type="AudioStreamOGGVorbis" |
|||
path="res://.import/rocket-launch.ogg-8d561e573504190ba6fe4ff074c316cf.oggstr" |
|||
|
|||
[deps] |
|||
|
|||
source_file="res://Music and Sounds/rocket-launch.ogg" |
|||
dest_files=[ "res://.import/rocket-launch.ogg-8d561e573504190ba6fe4ff074c316cf.oggstr" ] |
|||
|
|||
[params] |
|||
|
|||
loop=false |
|||
loop_offset=0 |
@ -1,6 +1,6 @@ |
|||
extends Label |
|||
|
|||
onready var gameNode = get_node("/root/Game") |
|||
onready var Game = get_node("/root/Game") |
|||
|
|||
func _process(delta): |
|||
text = str(gameNode.numOfCoins) |
|||
text = str(Game.numOfCoins) |
|||
|
@ -0,0 +1,19 @@ |
|||
extends Label |
|||
|
|||
var hiscore |
|||
var numOfCoins |
|||
|
|||
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"] |
|||
numOfCoins = data["numOfCoins"] |
|||
|
|||
func _ready(): |
|||
load_game() |
|||
text = str(numOfCoins) |
|||
|
Loading…
Reference in new issue