Added music. Main menu is almost totally functional.

This commit is contained in:
Sage Vaillancourt 2018-05-24 04:19:59 -04:00
parent 094633af4a
commit ba79254733
14 changed files with 149 additions and 29 deletions

View File

@ -23,6 +23,7 @@ radius = 171.26
position = Vector2( 947.34, 293.528 )
scale = Vector2( 0.15, 0.15 )
z_index = -1
input_pickable = true
gravity_vec = Vector2( 0, 1 )
gravity = 98.0

View File

@ -21,6 +21,7 @@ animations = [ {
[node name="Area2D" type="Area2D"]
scale = Vector2( 0.25, 0.25 )
z_index = -1
input_pickable = true
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
@ -30,7 +31,7 @@ collision_mask = 0
audio_bus_override = false
audio_bus_name = "Master"
script = ExtResource( 1 )
_sections_unfolded = [ "Collision", "Transform" ]
_sections_unfolded = [ "Collision", "Transform", "Z Index" ]
SPEED = 40
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="0"]

Binary file not shown.

View File

@ -10,6 +10,9 @@ var upgrade_cost = 50
const BADDIE_WAIT_TIME_DEFAULT = 5
func _ready():
var mainmenu = preload("res://MainMenu.tscn").instance()
add_child(mainmenu)
get_tree().paused = true
$BaddieTimer.wait_time = BADDIE_WAIT_TIME_DEFAULT
$BaddieTimer.start()
randomize()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://Main.gd" type="Script" id=1]
[ext_resource path="res://Bad1.tscn" type="PackedScene" id=2]
@ -7,14 +7,6 @@
[ext_resource path="res://Player.tscn" type="PackedScene" id=5]
[ext_resource path="res://Mothership.tscn" type="PackedScene" id=6]
[sub_resource type="ImageTexture" id=1]
flags = 7
storage = 0
lossy_quality = 0.7
flags = 7
size = Vector2( 0, 0 )
[sub_resource type="ImageTexture" id=2]
flags = 7
@ -23,36 +15,34 @@ lossy_quality = 0.7
flags = 7
size = Vector2( 0, 0 )
[node name="Main" type="Node"]
[node name="Main" type="Node" index="0"]
script = ExtResource( 1 )
_sections_unfolded = [ "Pause" ]
FirstBad = ExtResource( 2 )
BlobBad = ExtResource( 3 )
[node name="Sprite2" type="Sprite" parent="." index="0"]
texture = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="." index="1"]
[node name="Sprite" type="Sprite" parent="." index="0"]
z_index = -5
texture = SubResource( 2 )
_sections_unfolded = [ "Z Index" ]
[node name="bg" type="Sprite" parent="Sprite" index="0"]
position = Vector2( 544.657, 347.107 )
texture = ExtResource( 4 )
[node name="Player" parent="." index="2" instance=ExtResource( 5 )]
[node name="Player" parent="." index="1" instance=ExtResource( 5 )]
[node name="BaddieTimer" type="Timer" parent="." index="3"]
[node name="BaddieTimer" type="Timer" parent="." index="2"]
process_mode = 1
wait_time = 1.0
one_shot = false
autostart = false
[node name="Mothership" parent="." index="4" instance=ExtResource( 6 )]
[node name="Mothership" parent="." index="3" instance=ExtResource( 6 )]
[node name="Line2D" type="Line2D" parent="Mothership" index="2"]
@ -66,7 +56,7 @@ sharp_limit = 2.0
round_precision = 8
_sections_unfolded = [ "Z Index" ]
[node name="MoneyDisplay" type="Label" parent="." index="5"]
[node name="MoneyDisplay" type="Label" parent="." index="4"]
anchor_left = 0.0
anchor_top = 0.0
@ -89,7 +79,7 @@ lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
[node name="UpButton" type="Button" parent="." index="6"]
[node name="UpButton" type="Button" parent="." index="5"]
anchor_left = 0.0
anchor_top = 0.0
@ -113,7 +103,7 @@ flat = true
align = 1
_sections_unfolded = [ "Visibility" ]
[node name="DownButton" type="Button" parent="." index="7"]
[node name="DownButton" type="Button" parent="." index="6"]
anchor_left = 0.0
anchor_top = 0.0
@ -137,7 +127,7 @@ flat = true
align = 1
_sections_unfolded = [ "Visibility" ]
[node name="ShootButton" type="Button" parent="." index="8"]
[node name="ShootButton" type="Button" parent="." index="7"]
anchor_left = 0.0
anchor_top = 0.0
@ -162,7 +152,7 @@ flat = true
align = 1
_sections_unfolded = [ "Theme" ]
[node name="PauseButton" type="Button" parent="." index="9"]
[node name="PauseButton" type="Button" parent="." index="8"]
anchor_left = 0.0
anchor_top = 0.0
@ -191,10 +181,10 @@ align = 1
[connection signal="refund" from="Player" to="." method="_on_Player_refund"]
[connection signal="restart_game" from="Player" to="." method="_on_Player_restart_game"]
[connection signal="restart_game" from="Player" to="Mothership" method="_on_Player_restart_game"]
[connection signal="restart_game" from="Player" to="." method="_on_Player_restart_game"]
[connection signal="shooting_speed_upgrade" from="Player" to="." method="_on_Player_shooting_speed_upgrade"]
[connection signal="update_display" from="Player" to="." method="_on_Player_update_display"]

41
MainMenu.gd Normal file
View File

@ -0,0 +1,41 @@
extends Node
var clockwise = false
var rotation_multiplier = 1
const PEAK_ANGLE = -15
const TROUGH_ANGLE = -5
const SLOW_ROTATION = 0.8
const REGULAR_ROTATION = 1
func _ready():
$Music.play()
pass
func _process(delta):
# if clockwise == true:
# $Ship.rotation_degrees += (($Ship.rotation_degrees - TROUGH_ANGLE)*delta*0.2) + (delta/10)
# if $Ship.rotation_degrees < TROUGH_ANGLE:
# clockwise = false
# else:
# $Ship.rotation_degrees -= (($Ship.rotation_degrees - PEAK_ANGLE)*delta*0.2) + (delta/10)
# if $Ship.rotation_degrees > PEAK_ANGLE:
# clockwise = true
if ($Ship.rotation_degrees > -7 || $Ship.rotation_degrees < -13):
rotation_multiplier = SLOW_ROTATION
else:
rotation_multiplier = REGULAR_ROTATION
if clockwise == true:
$Ship.rotation_degrees += delta
if $Ship.rotation_degrees > TROUGH_ANGLE:
clockwise = false
else:
$Ship.rotation_degrees -= delta
if $Ship.rotation_degrees < PEAK_ANGLE:
clockwise = true
func _on_Button_pressed():
get_tree().paused = false
queue_free()
pass # replace with function body

82
MainMenu.tscn Normal file
View File

@ -0,0 +1,82 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://MainMenu.gd" type="Script" id=1]
[ext_resource path="res://mainmenu.png" type="Texture" id=2]
[ext_resource path="res://menu_music.ogg" type="AudioStream" id=3]
[ext_resource path="res://art/player/Rocket1.png" type="Texture" id=4]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 2 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[sub_resource type="SpriteFrames" id=2]
animations = [ {
"frames": [ ExtResource( 4 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[node name="Node" type="Node"]
pause_mode = 2
script = ExtResource( 1 )
_sections_unfolded = [ "Pause" ]
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
position = Vector2( 510, 300 )
scale = Vector2( 0.557292, 0.557292 )
frames = SubResource( 1 )
animation = "default"
[node name="Music" type="AudioStreamPlayer" parent="." index="1"]
stream = ExtResource( 3 )
volume_db = 0.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="Ship" type="AnimatedSprite" parent="." index="2"]
position = Vector2( 540, 310 )
rotation = -0.0872665
scale = Vector2( 0.65, 0.65 )
frames = SubResource( 2 )
animation = "default"
_sections_unfolded = [ "Transform" ]
[node name="Button" type="Button" parent="." index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 210.0
margin_top = 430.0
margin_right = 570.0
margin_bottom = 580.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
flat = true
align = 1
[connection signal="pressed" from="Button" to="." method="_on_Button_pressed"]

View File

@ -35,7 +35,7 @@ const SHIP_SPEED_TIER3_COST = 400
const SHIP_SPEED_TIER4_COST = 600
const SHIP_SPEED_TIER5_COST = 800
const STARTING_MONEY = 100000
const STARTING_MONEY = 100
var screensize

View File

@ -20,7 +20,7 @@ custom_solver_bias = 0.0
radius = 19.3222
height = 76.5834
[node name="Player" type="Area2D" index="0"]
[node name="Player" type="Area2D"]
input_pickable = true
gravity_point = true

View File

@ -12,7 +12,8 @@ var ship_speed_tier
var double_lasers
func _ready():
pass
bullet_delay_tier = get_parent().bullet_delay_tier
$ShootingSpeedIcon.frame = bullet_delay_tier
func _process(delta):
$ShootingSpeedIcon.frame = bullet_delay_tier

BIN
bootsplash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
mainmenu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
menu_music.ogg Normal file

Binary file not shown.

View File

@ -12,6 +12,7 @@ config_version=3
config/name="Fronter"
run/main_scene="res://Main.tscn"
boot_splash/image="res://bootsplash.png"
config/icon="res://icon.png"
[display]