Hyperboosting

This commit is contained in:
ToasterPanic 2025-12-06 17:53:47 -05:00
parent 57d6826d5a
commit d4e5c47693
8 changed files with 154 additions and 8 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=39 format=4 uid="uid://bauklhpieuivd"]
[gd_scene load_steps=41 format=4 uid="uid://bauklhpieuivd"]
[ext_resource type="Script" uid="uid://d0qswyhwbhdua" path="res://scripts/game.gd" id="1_u5sy4"]
[ext_resource type="Texture2D" uid="uid://dtwo7g0ipc4k" path="res://textures/ship_1.png" id="1_uwrxv"]
@ -9,6 +9,7 @@
[ext_resource type="AudioStream" uid="uid://b6tyof2j3ytbv" path="res://sounds/concrete_halls.mp3" id="3_0tnpc"]
[ext_resource type="AudioStream" uid="uid://b1ung55xg31l3" path="res://sounds/boost_finish.mp3" id="3_p57ef"]
[ext_resource type="AudioStream" uid="uid://cwidt34ehvre4" path="res://sounds/ui_select.mp3" id="4_5newe"]
[ext_resource type="AudioStream" uid="uid://bff3l15ivkcyi" path="res://sounds/ui_back.mp3" id="5_37s47"]
[ext_resource type="PackedScene" uid="uid://gofibd3kwx3r" path="res://scenes/navigation_marker.tscn" id="5_264po"]
[ext_resource type="AudioStream" uid="uid://y7lhonymtk3t" path="res://sounds/fire.mp3" id="8_vtaks"]
[ext_resource type="Texture2D" uid="uid://dsdd1830ilu1" path="res://textures/navigation_ring.png" id="10_dinhu"]
@ -73,6 +74,9 @@ font_size = 12
[sub_resource type="LabelSettings" id="LabelSettings_bt5mj"]
font_size = 14
[sub_resource type="LabelSettings" id="LabelSettings_pl11u"]
font_size = 14
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_264po"]
bg_color = Color(0, 0, 0, 1)
border_color = Color(0.53333336, 0.53333336, 0.53333336, 1)
@ -112,6 +116,9 @@ bus = &"Music"
[node name="UiSelect" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_5newe")
[node name="UiBack" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_37s47")
[node name="Stars" type="Node2D" parent="."]
[node name="Unloadables" type="Node2D" parent="."]
@ -394,6 +401,12 @@ layout_mode = 2
size_flags_horizontal = 3
text = "new route"
[node name="Hyperboost" type="Button" parent="UI/Control/Navpanel/Navigation"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "hyperboost"
[node name="CancelRoute" type="Button" parent="UI/Control/Navpanel/Navigation"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
@ -426,7 +439,50 @@ layout_mode = 2
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
[node name="NavpanelBack" type="Button" parent="UI/Control/Navpanel/NavigationRoutes"]
[node name="NavigationBack" type="Button" parent="UI/Control/Navpanel/NavigationRoutes"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "back"
[node name="NavigationHyperboost" type="HFlowContainer" parent="UI/Control/Navpanel"]
visible = false
layout_mode = 2
theme_override_constants/v_separation = 0
[node name="Label3" type="Label" parent="UI/Control/Navpanel/NavigationHyperboost"]
layout_mode = 2
size_flags_horizontal = 3
text = "HYPERBOOST?"
label_settings = SubResource("LabelSettings_5newe")
horizontal_alignment = 1
[node name="Description" type="Label" parent="UI/Control/Navpanel/NavigationHyperboost"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "hyperboosting will allow you to reach your destination quicker. it uses your fuel."
label_settings = SubResource("LabelSettings_pl11u")
horizontal_alignment = 1
autowrap_mode = 3
[node name="FuelRequired" type="Label" parent="UI/Control/Navpanel/NavigationHyperboost"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "FUEL REQUIRED:
100%"
label_settings = SubResource("LabelSettings_37s47")
horizontal_alignment = 1
autowrap_mode = 3
[node name="EnableHyperboost" type="Button" parent="UI/Control/Navpanel/NavigationHyperboost"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "boost now"
[node name="NavigationBack" type="Button" parent="UI/Control/Navpanel/NavigationHyperboost"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
@ -565,7 +621,10 @@ color = Color(1, 1, 1, 0)
[connection signal="pressed" from="UI/Control/Navpanel/Start/Navigation" to="." method="_on_navigation_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Start/Quit" to="." method="_on_quit_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Navigation/NewRoute" to="." method="_on_new_route_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Navigation/Hyperboost" to="." method="_on_hyperboost_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Navigation/CancelRoute" to="." method="_on_cancel_route_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Navigation/NavpanelBack" to="." method="_on_navpanel_back_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/NavigationRoutes/NavpanelBack" to="." method="_on_navpanel_back_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/NavigationRoutes/NavigationBack" to="." method="_on_navigation_back_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/NavigationHyperboost/EnableHyperboost" to="." method="_on_enable_hyperboost_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/NavigationHyperboost/NavigationBack" to="." method="_on_navigation_back_pressed"]
[connection signal="pressed" from="UI/Control/PauseMenu/Panel/Flow/Resume" to="UI/Control/PauseMenu" method="_on_resume_pressed"]

View file

@ -86,6 +86,8 @@ shader_parameter/vignette_color = Color(0, 0, 0, 1)
[sub_resource type="LabelSettings" id="LabelSettings_5vwr8"]
font_size = 32
outline_size = 4
outline_color = Color(0, 0, 0, 1)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_jo68p"]
shader = ExtResource("7_vuhkc")

View file

@ -5,7 +5,7 @@
[node name="NavigationItem" type="VBoxContainer"]
script = ExtResource("1_vuhx2")
[node name="RichTextLabel" type="RichTextLabel" parent="."]
[node name="Label" type="RichTextLabel" parent="."]
layout_mode = 2
bbcode_enabled = true
text = "[font size=24]space station 1[/font]

View file

@ -125,11 +125,19 @@ func _process(delta: float) -> void:
$Navring.add_child(navigation_marker)
if $UI/Control/Navpanel/NavigationHyperboost.visible:
var distance_to_hyperboost = (global.stats.navigation_goal.point.global_position - $Player.global_position).length() - 3000
var fuel_cost = floori((distance_to_hyperboost / 4096) * 7)
$UI/Control/Navpanel/NavigationHyperboost/FuelRequired.text = "FUEL REQUIRED:\n"+ str(fuel_cost) + "%"
if $UI/Control/Navpanel/Navigation.visible:
$UI/Control/Navpanel/Navigation/CurrentRoute.visible = true
$UI/Control/Navpanel/Navigation/Destination.visible = true
$UI/Control/Navpanel/Navigation/Hyperboost.visible = true
var goal_distance = (global.stats.navigation_goal.point.position - $Player.position).length()
$UI/Control/Navpanel/Navigation/Destination.text = global.stats.navigation_goal.name + " (" + str(floori(goal_distance)) + "u)"
@ -141,6 +149,12 @@ func _process(delta: float) -> void:
$UI/Control/Navpanel/Navigation/CurrentRoute.visible = false
$UI/Control/Navpanel/Navigation/Destination.visible = false
$UI/Control/Navpanel/Navigation/Hyperboost.visible = false
if $UI/Control/Navpanel/NavigationRoutes.visible:
for n in $UI/Control/Navpanel/NavigationRoutes/Scroll/Box.get_children():
n.update()
$Navring.position = $Player.position
if current_atmospheric_track:
@ -240,16 +254,20 @@ func _input(event: InputEvent) -> void:
get_tree().paused = true
elif event.is_action_pressed("navpanel"):
if $UI/Control/Navpanel.visible:
$UiBack.play()
$UI/Control/Navpanel.visible = false
else:
$UiSelect.play()
$UI/Control/Navpanel.visible = true
_set_navpanel_menu("Start")
elif event.is_action_pressed("ui_back"):
if $UI/Control/Navpanel.visible:
$UiSelect.play()
$UiBack.play()
if $UI/Control/Navpanel/NavigationRoutes.visible:
if ($UI/Control/Navpanel/NavigationRoutes.visible) or ($UI/Control/Navpanel/NavigationHyperboost.visible):
_set_navpanel_menu("Navigation")
elif $UI/Control/Navpanel/Start.visible:
$UI/Control/Navpanel.visible = false
@ -268,7 +286,7 @@ func _on_navigation_pressed() -> void:
func _on_navpanel_back_pressed() -> void:
$UiSelect.play()
$UiBack.play()
_set_navpanel_menu("Start")
@ -283,7 +301,7 @@ func _on_cancel_route_pressed() -> void:
func _on_quit_pressed() -> void:
$UiSelect.play()
$UiBack.play()
$UI/Control/Navpanel.visible = false
@ -291,3 +309,19 @@ func _navigation_item_pressed(goal) -> void:
global.stats.navigation_goal = goal
$UiSelect.play()
_set_navpanel_menu("Navigation")
func _on_navigation_back_pressed() -> void:
$UiBack.play()
_set_navpanel_menu("Navigation")
func _on_hyperboost_pressed() -> void:
$UiSelect.play()
_set_navpanel_menu("NavigationHyperboost")
func _on_enable_hyperboost_pressed() -> void:
$UiSelect.play()
_set_navpanel_menu("Navigation")
$Player.hyperboosting = true

View file

@ -3,5 +3,13 @@ extends VBoxContainer
var goal = null
var game = null
func update() -> void:
var player = game.get_node("Player")
var distance = floori((goal.point.global_position - player.position).length())
$Label.text = """[font size=24]%s[/font]
%su away""" % [goal.name, str(distance)]
func _on_button_pressed() -> void:
game._navigation_item_pressed(goal)

View file

@ -6,6 +6,7 @@ var time_since_last_fire = 0
var time_since_last_collision = 1
var camera_shake_power = 0
var boosting = false
var hyperboosting = false
var laser_scene = preload("res://scenes/laser.tscn")
@ -77,6 +78,10 @@ func _process(delta: float) -> void:
if time_since_last_collision <= 1:
time_since_last_collision += delta
if hyperboosting:
if (global.stats.navigation_goal.point.global_position - global_position).length() < 3000:
hyperboosting = false
func _physics_process(delta: float) -> void:
var axis = Input.get_axis("turn_left", "turn_right")
var movement_axis = Input.get_axis("forward", "backward")
@ -89,6 +94,25 @@ func _physics_process(delta: float) -> void:
movement_axis = -1
final_speed = 1024
if hyperboosting:
movement_axis = -1
final_speed = 4096
angular_velocity = 0
look_at(global.stats.navigation_goal.point.global_position)
rotation_degrees += 90
global.stats.fuel -= delta * 7
$CollisionShape.disabled = true
$Hitbox.monitoring = false
else:
$CollisionShape.disabled = false
$Hitbox.monitoring = true
# Slow down on collision and gradually speed up
if time_since_last_collision < 0.85: final_speed *= (time_since_last_collision + 0.15)

BIN
sounds/ui_back.mp3 Normal file

Binary file not shown.

19
sounds/ui_back.mp3.import Normal file
View file

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://bff3l15ivkcyi"
path="res://.godot/imported/ui_back.mp3-bf66999dc419b2d6276594976ab37a57.mp3str"
[deps]
source_file="res://sounds/ui_back.mp3"
dest_files=["res://.godot/imported/ui_back.mp3-bf66999dc419b2d6276594976ab37a57.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4