generated from krampus/template-godot4
Compare commits
6 Commits
1101ed4b3d
...
478b1e0849
Author | SHA1 | Date |
---|---|---|
Rob Kelly | 478b1e0849 | |
Rob Kelly | 0952cd7486 | |
Rob Kelly | db78cec5a5 | |
Rob Kelly | ddef4c8736 | |
Rob Kelly | a5bbb098c0 | |
Rob Kelly | ed0028898f |
|
@ -31,6 +31,9 @@ DM_PLAYERS,Gfolfers
|
|||
DM_ADD_PLAYER,"Add a Gfolfer"
|
||||
DM_NAME_PLACEHOLDER,"Enter a name"
|
||||
,
|
||||
PRACTICE_HEADING,"Practice your GFOLFing"
|
||||
PRACTICE_MAP,"Select a Map"
|
||||
,
|
||||
PAUSE_HEADING,Paused
|
||||
PAUSE_RESUME,Resume
|
||||
PAUSE_SETTINGS,Settings
|
||||
|
|
|
|
@ -1,9 +1,11 @@
|
|||
[gd_resource type="Resource" script_class="Level" load_steps=3 format=3 uid="uid://cfsy1nlfo4inx"]
|
||||
[gd_resource type="Resource" script_class="Level" load_steps=4 format=3 uid="uid://cfsy1nlfo4inx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://x2bqqlrnno28" path="res://levels/oneill/oneill.tscn" id="1_431yv"]
|
||||
[ext_resource type="Texture2D" uid="uid://dlq6b8frq21o2" path="res://levels/oneill/preview.jpg" id="1_n552e"]
|
||||
[ext_resource type="Script" path="res://src/world/level/level.gd" id="2_fnj1e"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_fnj1e")
|
||||
scene = ExtResource("1_431yv")
|
||||
level_name = "MAP_ONEILL"
|
||||
preview = ExtResource("1_n552e")
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dlq6b8frq21o2"
|
||||
path="res://.godot/imported/preview.jpg-15d3a679d46e9934ca032ccdfbdfe6af.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://levels/oneill/preview.jpg"
|
||||
dest_files=["res://.godot/imported/preview.jpg-15d3a679d46e9934ca032ccdfbdfe6af.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
|
@ -79,6 +79,9 @@ func _unload_content() -> void:
|
|||
|
||||
|
||||
func _finish_scene_load(instance: Node) -> void:
|
||||
# Unpause in case the previous scene was paused.
|
||||
get_tree().paused = false
|
||||
|
||||
content.add_child(instance)
|
||||
instance.reparent(content)
|
||||
|
||||
|
|
|
@ -119,7 +119,6 @@ _data = {
|
|||
[node name="Game" type="Node" groups=["GameGroup"]]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_4qa87")
|
||||
start_scene = "res://src/world/world.tscn"
|
||||
|
||||
[node name="RootControl" type="Control" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
|
|
@ -103,7 +103,8 @@ var club: Club:
|
|||
var ball_type: GameBall.Type:
|
||||
set(value):
|
||||
if value != ball_type:
|
||||
hud.ball_selector.value = value
|
||||
if hud:
|
||||
hud.ball_selector.value = value
|
||||
ball_point.spawn_ball(value)
|
||||
ball_type = value
|
||||
|
||||
|
@ -180,10 +181,11 @@ func _ready() -> void:
|
|||
player.on_life_changed.connect(_on_life_changed)
|
||||
|
||||
# Create & set up HUD
|
||||
hud = ShotHUD.create(player)
|
||||
world.ui.add_player_hud(hud)
|
||||
ball_type = initial_ball
|
||||
club_type = initial_club_type
|
||||
|
||||
hud = ShotHUD.create(player)
|
||||
world.ui.add_player_hud(hud)
|
||||
character.set_color(player.color)
|
||||
|
||||
# Set up player 3D label
|
||||
|
@ -191,7 +193,7 @@ func _ready() -> void:
|
|||
player_label.modulate = player.color
|
||||
player_label.outline_modulate = ColorTools.get_bg_color(player.color)
|
||||
|
||||
_on_phase_change(phase)
|
||||
#_on_phase_change(phase)
|
||||
|
||||
|
||||
func _on_tree_exiting() -> void:
|
||||
|
@ -424,7 +426,6 @@ func finish_death() -> void:
|
|||
print_debug("finishing death sequence")
|
||||
get_tree().paused = false
|
||||
player.die()
|
||||
queue_free()
|
||||
|
||||
|
||||
func _set_club_type(new_club_type: Club.Type) -> void:
|
||||
|
@ -443,7 +444,8 @@ func _set_club_type(new_club_type: Club.Type) -> void:
|
|||
wedge_arrow.hide()
|
||||
iron_arrow.hide()
|
||||
putt_arrow.hide()
|
||||
hud.club_selector.value = new_club_type
|
||||
if hud:
|
||||
hud.club_selector.value = new_club_type
|
||||
# TODO club change animation
|
||||
character.hold_right(new_club.get_model())
|
||||
match new_club_type:
|
||||
|
@ -527,6 +529,8 @@ func _process(delta: float) -> void:
|
|||
# REMOVEME
|
||||
if Input.is_action_just_pressed("ui_menu"):
|
||||
print("Debugging...")
|
||||
if Input.is_action_just_pressed("debug_2"):
|
||||
player.life -= 90
|
||||
|
||||
## Visual updates
|
||||
# Rotation
|
||||
|
@ -642,6 +646,7 @@ func _process(delta: float) -> void:
|
|||
phase = Phase.AIM
|
||||
Phase.DEAD:
|
||||
start_death()
|
||||
phase = Phase.FINISHED
|
||||
|
||||
|
||||
func _on_ball_sleeping_state_changed() -> void:
|
||||
|
|
|
@ -101,6 +101,11 @@ func die() -> void:
|
|||
on_death.emit(self)
|
||||
|
||||
|
||||
func deconstruct() -> void:
|
||||
if is_instance_valid(shot_setup):
|
||||
shot_setup.queue_free()
|
||||
|
||||
|
||||
## Create a debug player instance
|
||||
static func create_debug() -> WorldPlayer:
|
||||
var instance := WorldPlayer.new()
|
||||
|
|
|
@ -30,36 +30,36 @@ vec2 rotate_uv(vec2 uv, vec2 center, float rotation, bool use_degrees){
|
|||
}
|
||||
|
||||
void fragment() {
|
||||
|
||||
|
||||
vec2 center_uv = UV - vec2(0.5, 0.5);
|
||||
float gradient_to_edge = max(abs(center_uv.x), abs(center_uv.y));
|
||||
gradient_to_edge = gradient_to_edge * Distortion;
|
||||
gradient_to_edge = 1.0 - gradient_to_edge;
|
||||
vec2 rotaded_uv = rotate_uv(UV, vec2(0.5, 0.5), Rotation_deg, true);
|
||||
|
||||
|
||||
float remapped_position;
|
||||
{
|
||||
float output_range = Position_Max - Position_Min;
|
||||
remapped_position = Position_Min + output_range * Position;
|
||||
}
|
||||
|
||||
|
||||
float remapped_time = TIME * Speed + remapped_position;
|
||||
remapped_time = fract(remapped_time);
|
||||
{
|
||||
float output_range = 2.0 - (-2.0);
|
||||
remapped_time = -2.0 + output_range * remapped_time;
|
||||
}
|
||||
|
||||
|
||||
vec2 offset_uv = vec2(rotaded_uv.xy) + vec2(remapped_time, 0.0);
|
||||
float line = vec3(offset_uv, 0.0).x;
|
||||
line = abs(line);
|
||||
line = gradient_to_edge * line;
|
||||
line = sqrt(line);
|
||||
|
||||
|
||||
float line_smoothness = clamp(Line_Smoothness, 0.001, 1.0);
|
||||
float offset_plus = Line_Width + line_smoothness;
|
||||
float offset_minus = Line_Width - line_smoothness;
|
||||
|
||||
|
||||
float remapped_line;
|
||||
{
|
||||
float input_range = offset_minus - offset_plus;
|
||||
|
|
|
@ -28,6 +28,7 @@ var _force_visible := false
|
|||
|
||||
func _init(force_visible_signal: Variant = null) -> void:
|
||||
if force_visible_signal is Signal:
|
||||
@warning_ignore("unsafe_cast")
|
||||
(force_visible_signal as Signal).connect(_set_force_visible)
|
||||
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ var _freeze_input := false
|
|||
@onready var end_game_confirm: CenterContainer = %EndGameConfirm
|
||||
@onready var settings_container: MarginContainer = %SettingsContainer
|
||||
|
||||
@onready var transition_animation: AnimationPlayer = %TransitionAnimation
|
||||
|
||||
@onready var world: World = get_tree().get_first_node_in_group(World.group)
|
||||
@onready var game: Game = get_tree().get_first_node_in_group(Game.group)
|
||||
|
||||
|
||||
|
@ -65,9 +64,5 @@ func cancel_end_game() -> void:
|
|||
end_game_confirm.hide()
|
||||
|
||||
|
||||
func _return_to_title() -> void:
|
||||
game.queue_scene(TitleScreen.SCENE)
|
||||
|
||||
|
||||
func confirm_end_game() -> void:
|
||||
transition_animation.play("fade_to_black")
|
||||
world.fade_to_title()
|
||||
|
|
|
@ -1,84 +1,9 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://byvjsvavbg5xe"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://byvjsvavbg5xe"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://b6gxwgomstkgu" path="res://assets/fonts/Geo/Geo-Italic.ttf" id="1_4nw1f"]
|
||||
[ext_resource type="Script" path="res://src/ui/menus/pause_menu/pause_menu.gd" id="1_rd0j2"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3eaqw2rdurct" path="res://src/ui/menus/settings_menu/settings_menu.tscn" id="2_kjr35"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_qmmn2"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("TransitionAnimation/TransitionShade:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("TransitionAnimation/TransitionShade:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_rq4bw"]
|
||||
resource_name = "fade_to_black"
|
||||
length = 0.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("TransitionAnimation/TransitionShade:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.6),
|
||||
"transitions": PackedFloat32Array(1.618, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0.6),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"_return_to_title"
|
||||
}]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("TransitionAnimation/TransitionShade:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7b7fo"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_qmmn2"),
|
||||
"fade_to_black": SubResource("Animation_rq4bw")
|
||||
}
|
||||
|
||||
[node name="PauseMenu" type="Control"]
|
||||
process_mode = 3
|
||||
layout_mode = 3
|
||||
|
@ -252,21 +177,6 @@ size_flags_horizontal = 3
|
|||
theme_type_variation = &"AlertButton"
|
||||
text = "PAUSE_END"
|
||||
|
||||
[node name="TransitionAnimation" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_7b7fo")
|
||||
}
|
||||
|
||||
[node name="TransitionShade" type="ColorRect" parent="TransitionAnimation"]
|
||||
visible = false
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0)
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/MenuList/ResumeButton" to="." method="resume"]
|
||||
[connection signal="pressed" from="MarginContainer/MenuList/SettingsButton" to="." method="settings"]
|
||||
[connection signal="pressed" from="MarginContainer/MenuList/EndGameButton" to="." method="end_game"]
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
extends PanelContainer
|
||||
|
||||
const WORLD_SCENE_PATH := "res://src/world/world.tscn"
|
||||
|
||||
const RANDOM_PLAYER_COLORS := [
|
||||
Color.LIGHT_CORAL,
|
||||
Color.GOLDENROD,
|
||||
|
@ -54,7 +52,7 @@ func start() -> void:
|
|||
world.manager = RoundRobinManager.new()
|
||||
world.manager.players = player_list
|
||||
world.initial_level = level.scene
|
||||
game.queue_scene(WORLD_SCENE_PATH).then(init_world)
|
||||
game.queue_scene(World.SCENE).then(init_world)
|
||||
|
||||
|
||||
## Returns the `Level` selected by the user if there is one, or `null` if no level is selected.
|
||||
|
|
|
@ -66,6 +66,33 @@ _data = {
|
|||
"rotate": SubResource("Animation_c3p73")
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_x4wqc"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:disabled")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:modulate")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_560ro"]
|
||||
resource_name = "fade_out"
|
||||
length = 0.6
|
||||
|
@ -111,33 +138,6 @@ tracks/2/keys = {
|
|||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_x4wqc"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:disabled")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:modulate")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_s1eyj"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_x4wqc"),
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
extends PanelContainer
|
||||
|
||||
@export var practice_player: WorldPlayer
|
||||
|
||||
@onready var map_select: ItemList = %MapSelect
|
||||
|
||||
@onready var start_button: Button = %Start
|
||||
|
||||
@onready var game: Game = get_tree().get_first_node_in_group(Game.group)
|
||||
|
||||
|
||||
func play_chime() -> void:
|
||||
game.sfx.chime.play()
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Populate map selection
|
||||
for level: Level in Level.catalog.levels:
|
||||
map_select.add_item(level.level_name, level.preview)
|
||||
|
||||
check_start_conditions()
|
||||
|
||||
|
||||
## Close menu without starting game.
|
||||
func cancel() -> void:
|
||||
queue_free()
|
||||
|
||||
|
||||
## Start with the current game configuration.
|
||||
func start() -> void:
|
||||
var manager := PracticeManager.new()
|
||||
manager.players = [practice_player]
|
||||
var level := selected_level()
|
||||
var init_world := func(world: World) -> void:
|
||||
world.manager = manager
|
||||
world.initial_level = level.scene
|
||||
game.queue_scene(World.SCENE).then(init_world)
|
||||
|
||||
|
||||
## Returns the `Level` selected by the user if there is one, or `null` if no level is selected.
|
||||
func selected_level() -> Level:
|
||||
var selections := map_select.get_selected_items()
|
||||
if selections:
|
||||
return Level.catalog.levels[selections[0]]
|
||||
return null
|
||||
|
||||
|
||||
func _can_start() -> bool:
|
||||
return selected_level() != null
|
||||
|
||||
|
||||
## Check if the game can be started with the current selection,
|
||||
## and set the start button status appropriately.
|
||||
func check_start_conditions() -> void:
|
||||
start_button.disabled = not _can_start()
|
|
@ -0,0 +1,197 @@
|
|||
[gd_scene load_steps=11 format=3 uid="uid://5soelwtn4v34"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/ui/menus/title_screen/practice_setup/practice_setup.gd" id="1_jgggo"]
|
||||
[ext_resource type="Resource" uid="uid://c1pnqsddvey3m" path="res://src/equipment/clubs/drivers/debug_driver.tres" id="2_47376"]
|
||||
[ext_resource type="Resource" uid="uid://ck17u5yn6k0bi" path="res://src/equipment/clubs/irons/debug_iron.tres" id="3_veaoo"]
|
||||
[ext_resource type="Resource" uid="uid://dagld0q5krapu" path="res://src/equipment/clubs/putters/debug_putter.tres" id="4_mixgr"]
|
||||
[ext_resource type="Script" path="res://src/player/world_player.gd" id="5_btf7p"]
|
||||
[ext_resource type="Resource" uid="uid://dthtc1no2c4wy" path="res://src/equipment/clubs/wedges/debug_wedge.tres" id="6_8yfm7"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4ls7o"]
|
||||
script = ExtResource("5_btf7p")
|
||||
life = 100.0
|
||||
name = "Practice Gfolfer"
|
||||
color = Color(0.955, 0.7, 1, 1)
|
||||
driver = ExtResource("2_47376")
|
||||
iron = ExtResource("3_veaoo")
|
||||
wedge = ExtResource("6_8yfm7")
|
||||
putter = ExtResource("4_mixgr")
|
||||
_balls = {
|
||||
1: -1,
|
||||
2: -1,
|
||||
3: -1,
|
||||
4: -1,
|
||||
5: -1
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_x4wqc"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:disabled")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:modulate")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_560ro"]
|
||||
resource_name = "fade_out"
|
||||
length = 0.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.0666667, 0.133333, 0.2, 0.266667, 0.333333, 0.4, 0.466667, 0.533333, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 0.5), Color(1, 1, 1, 0), Color(1, 1, 1, 0.25), Color(1, 1, 1, 0), Color(1, 1, 1, 0.125), Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("../../..")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"play_chime"
|
||||
}, {
|
||||
"args": [],
|
||||
"method": &"start"
|
||||
}]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath(".:disabled")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_s1eyj"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_x4wqc"),
|
||||
"fade_out": SubResource("Animation_560ro")
|
||||
}
|
||||
|
||||
[node name="PracticeSetup" type="PanelContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_jgggo")
|
||||
practice_player = SubResource("Resource_4ls7o")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 32
|
||||
theme_override_constants/margin_top = 32
|
||||
theme_override_constants/margin_right = 32
|
||||
theme_override_constants/margin_bottom = 80
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderXLarge"
|
||||
text = "PRACTICE_HEADING"
|
||||
|
||||
[node name="MapSelectContainer" type="PanelContainer" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/MapSelectContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 16
|
||||
theme_override_constants/margin_top = 16
|
||||
theme_override_constants/margin_right = 16
|
||||
theme_override_constants/margin_bottom = 16
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "PRACTICE_MAP"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MapSelect" type="ItemList" parent="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 130)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/v_separation = 32
|
||||
theme_override_constants/h_separation = 32
|
||||
max_columns = 8
|
||||
icon_mode = 0
|
||||
fixed_icon_size = Vector2i(64, 64)
|
||||
|
||||
[node name="SouthEast" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 8
|
||||
theme_override_constants/margin_left = 16
|
||||
theme_override_constants/margin_top = 16
|
||||
theme_override_constants/margin_right = 32
|
||||
theme_override_constants/margin_bottom = 16
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="SouthEast"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 16
|
||||
|
||||
[node name="Cancel" type="Button" parent="SouthEast/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"CancelButton"
|
||||
text = "UI_CANCEL"
|
||||
|
||||
[node name="Start" type="Button" parent="SouthEast/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"AlertButton"
|
||||
text = "UI_START"
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="SouthEast/HBoxContainer/Start"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_s1eyj")
|
||||
}
|
||||
|
||||
[connection signal="item_selected" from="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer/MapSelect" to="." method="check_start_conditions" unbinds=1]
|
||||
[connection signal="pressed" from="SouthEast/HBoxContainer/Cancel" to="." method="cancel"]
|
||||
[connection signal="pressed" from="SouthEast/HBoxContainer/Start" to="SouthEast/HBoxContainer/Start/AnimationPlayer" method="play" binds= ["fade_out"]]
|
|
@ -5,6 +5,7 @@ const SCENE := "res://src/ui/menus/title_screen/title_screen.tscn"
|
|||
@export var title_crawl_scene: PackedScene
|
||||
@export var settings_scene: PackedScene
|
||||
@export var local_deathmatch_setup_scene: PackedScene
|
||||
@export var practice_setup_scene: PackedScene
|
||||
|
||||
@onready var menu: Control = %Menu
|
||||
@onready var settings_container: MarginContainer = %SettingsContainer
|
||||
|
@ -19,6 +20,10 @@ const SCENE := "res://src/ui/menus/title_screen/title_screen.tscn"
|
|||
@onready var game: Game = get_tree().get_first_node_in_group(Game.group)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
|
||||
func play_chime() -> void:
|
||||
game.sfx.chime.play()
|
||||
|
||||
|
@ -80,3 +85,10 @@ func _open_local_deathmatch_setup() -> void:
|
|||
deathmatch_setup_container.add_child(instance)
|
||||
instance.tree_exited.connect(_unhide)
|
||||
_hide()
|
||||
|
||||
|
||||
func _open_practice_setup() -> void:
|
||||
var instance: Control = practice_setup_scene.instantiate()
|
||||
deathmatch_setup_container.add_child(instance)
|
||||
instance.tree_exited.connect(_unhide)
|
||||
_hide()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=86 format=3 uid="uid://7fsgocmdas7i"]
|
||||
[gd_scene load_steps=87 format=3 uid="uid://7fsgocmdas7i"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/ui/menus/title_screen/title_screen.gd" id="1_2qtlb"]
|
||||
[ext_resource type="Texture2D" uid="uid://880x5n8j3b5l" path="res://assets/logo/title.png" id="1_pm82i"]
|
||||
|
@ -6,6 +6,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://clesl8lljs6of" path="res://assets/logo/subtitle.png" id="2_y0ulk"]
|
||||
[ext_resource type="PackedScene" uid="uid://ccx2u5oli6men" path="res://src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn" id="3_bo4ty"]
|
||||
[ext_resource type="Material" uid="uid://dpsmjlhjpc7vs" path="res://assets/materials/basic_ball_material.tres" id="5_5q83g"]
|
||||
[ext_resource type="PackedScene" uid="uid://5soelwtn4v34" path="res://src/ui/menus/title_screen/practice_setup/practice_setup.tscn" id="5_hws1o"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqu315hviu72n" path="res://src/ui/menus/title_screen/title_crawl.tscn" id="7_r26eu"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_ardux"]
|
||||
|
@ -18,6 +19,21 @@ ssil_intensity = 0.4
|
|||
glow_enabled = true
|
||||
glow_intensity = 2.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_vci0b"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.785398, -3.14159, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_bby3k"]
|
||||
resource_name = "rotate"
|
||||
length = 180.0
|
||||
|
@ -35,21 +51,6 @@ tracks/0/keys = {
|
|||
"values": [Vector3(-0.785398, 0, 0), Vector3(-0.785398, 6.28319, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_vci0b"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.785398, -3.14159, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_g0lq7"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_vci0b"),
|
||||
|
@ -1362,6 +1363,7 @@ script = ExtResource("1_2qtlb")
|
|||
title_crawl_scene = ExtResource("7_r26eu")
|
||||
settings_scene = ExtResource("2_g5q2v")
|
||||
local_deathmatch_setup_scene = ExtResource("3_bo4ty")
|
||||
practice_setup_scene = ExtResource("5_hws1o")
|
||||
|
||||
[node name="SceneRoot" type="Node3D" parent="."]
|
||||
|
||||
|
@ -1372,7 +1374,7 @@ environment = SubResource("Environment_ardux")
|
|||
transform = Transform3D(-0.5, 0, 0.866025, 0, 1, 0, -0.866025, 0, -0.5, 0, 0, 0)
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="SceneRoot/LightRotationRoot"]
|
||||
transform = Transform3D(-1, -6.18172e-08, 6.18172e-08, 0, 0.707107, 0.707107, -8.74228e-08, 0.707107, -0.707107, 0, 0, 0)
|
||||
transform = Transform3D(-1, 1.79264e-06, -1.79264e-06, 0, 0.707107, 0.707107, 2.53518e-06, 0.707107, -0.707107, 0, 0, 0)
|
||||
light_color = Color(0.95, 1, 0.989167, 1)
|
||||
light_energy = 1.2
|
||||
|
||||
|
@ -1480,7 +1482,7 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
|
||||
[node name="PressStart" type="Label" parent="Menu"]
|
||||
modulate = Color(1, 1, 1, 0.0282702)
|
||||
modulate = Color(1, 1, 1, 0.124112)
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
|
@ -1576,7 +1578,6 @@ text = "TITLE_ROGUELIKE"
|
|||
[node name="Practice" type="Button" parent="Menu/SingleplayerMenu"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"PauseMenuButton"
|
||||
disabled = true
|
||||
text = "TITLE_PRACTICE"
|
||||
|
||||
[node name="Back" type="Button" parent="Menu/SingleplayerMenu"]
|
||||
|
@ -1743,6 +1744,7 @@ autostart = true
|
|||
[connection signal="pressed" from="Menu/MainMenu/MultiPlayer" to="." method="_to_multi_player"]
|
||||
[connection signal="pressed" from="Menu/MainMenu/Settings" to="." method="_open_settings"]
|
||||
[connection signal="pressed" from="Menu/MainMenu/Quit" to="Menu/MainMenu/Quit/AnimationPlayer" method="play" binds= ["fade_out"]]
|
||||
[connection signal="pressed" from="Menu/SingleplayerMenu/Practice" to="." method="_open_practice_setup"]
|
||||
[connection signal="pressed" from="Menu/SingleplayerMenu/Back" to="." method="_to_main_menu"]
|
||||
[connection signal="pressed" from="Menu/MultiplayerMenu/LocalMultiplayer" to="." method="_to_local_multi"]
|
||||
[connection signal="pressed" from="Menu/MultiplayerMenu/NetMultiplayer" to="." method="_to_network_multi"]
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
class_name ShotHUD extends Control
|
||||
## HUD for main gameplay loop
|
||||
|
||||
const NICE_ALERT_SCENE := preload("res://src/ui/shot_hud/nice_alert.tscn")
|
||||
|
||||
## Scale factor for the life bar rumble intensity on taking damage
|
||||
const LIFE_BAR_DAMAGE_RUMBLE_SCALE := 0.2
|
||||
## Time it takes to dampen the life bar rumble on taking damage, in seconds
|
||||
|
@ -12,6 +10,8 @@ const LIFE_BAR_HEAL_DELAY := 0.8
|
|||
## Time it takes the life bar to fill when restoring life, in seconds
|
||||
const LIFE_BAR_HEAL_TIME := 1.0
|
||||
|
||||
@export var nice_alert_scene: PackedScene
|
||||
|
||||
var player: WorldPlayer
|
||||
|
||||
@onready var power_bar: TextureProgressBar = %PowerBar
|
||||
|
@ -103,7 +103,7 @@ func gauge_flourish() -> void:
|
|||
|
||||
|
||||
func play_nice_animation() -> void:
|
||||
_alert_container.add_child(NICE_ALERT_SCENE.instantiate())
|
||||
_alert_container.add_child(nice_alert_scene.instantiate())
|
||||
|
||||
|
||||
func play_wasted_animation() -> void:
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
[gd_scene load_steps=46 format=3 uid="uid://c4ifdiohng830"]
|
||||
[gd_scene load_steps=47 format=3 uid="uid://c4ifdiohng830"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/ui/shot_hud/shot_hud.gd" id="1_x5b4c"]
|
||||
[ext_resource type="Shader" path="res://src/shaders/canvas_retro.gdshader" id="1_ybxxp"]
|
||||
[ext_resource type="PackedScene" uid="uid://445qd7m4qe2j" path="res://src/ui/shot_hud/club_selector/club_selector.tscn" id="2_1hdub"]
|
||||
[ext_resource type="PackedScene" uid="uid://g8yw4bersece" path="res://src/ui/shot_hud/nice_alert.tscn" id="2_rnndf"]
|
||||
[ext_resource type="Script" path="res://src/ui/decorations/rumbler.gd" id="3_6groq"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5812y3pmmgg5" path="res://assets/ui/gauge_patch.png" id="4_5kcpe"]
|
||||
[ext_resource type="Texture2D" uid="uid://76fjx2ukavqe" path="res://assets/ui/power_gauge_fill.png" id="5_3i1yq"]
|
||||
|
@ -266,7 +267,7 @@ tracks/0/keys = {
|
|||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
"values": [-1.5708]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_w7dmn"]
|
||||
|
@ -334,26 +335,14 @@ length = 0.001
|
|||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("SouthWest:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/path = NodePath("SouthWest:offset_top")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("SouthWest:offset_top")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-98.0]
|
||||
"values": [20.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_yis4x"]
|
||||
|
@ -363,22 +352,10 @@ step = 0.02
|
|||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("SouthWest:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/path = NodePath("SouthWest:offset_top")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.4),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("SouthWest:offset_top")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.4),
|
||||
"transitions": PackedFloat32Array(1.618, 1.618, 1),
|
||||
"update": 0,
|
||||
|
@ -392,22 +369,10 @@ step = 0.02
|
|||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("SouthWest:visible")
|
||||
tracks/0/path = NodePath("SouthWest:offset_top")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 2.4),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [true, false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("SouthWest:offset_top")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 2.3, 2.4),
|
||||
"transitions": PackedFloat32Array(1.618, 1, 1.618, 1),
|
||||
"update": 0,
|
||||
|
@ -421,22 +386,10 @@ step = 0.02
|
|||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("SouthWest:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/path = NodePath("SouthWest:offset_top")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("SouthWest:offset_top")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.34, 0.4),
|
||||
"transitions": PackedFloat32Array(1.618, 1.618, 1),
|
||||
"update": 0,
|
||||
|
@ -568,6 +521,7 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1_x5b4c")
|
||||
nice_alert_scene = ExtResource("2_rnndf")
|
||||
|
||||
[node name="WastedFeedback" type="RichTextLabel" parent="."]
|
||||
visible = false
|
||||
|
@ -642,6 +596,7 @@ script = ExtResource("3_6groq")
|
|||
|
||||
[node name="PowerBar" type="TextureProgressBar" parent="ShotGauges/PowerGauge/Rumbler"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
texture_filter = 5
|
||||
custom_minimum_size = Vector2(64, 0)
|
||||
layout_mode = 1
|
||||
|
@ -691,6 +646,7 @@ mouse_filter = 1
|
|||
|
||||
[node name="CurveBar" parent="ShotGauges/CurveGauge" instance=ExtResource("7_kqi7w")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
||||
[node name="CurveAnimation" type="AnimationPlayer" parent="ShotGauges/CurveGauge"]
|
||||
|
@ -712,6 +668,7 @@ offset_right = 50.0
|
|||
offset_bottom = 50.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
rotation = 4.71239
|
||||
pivot_offset = Vector2(-400, 0)
|
||||
|
||||
[node name="ClubSelectorAnimation" type="AnimationPlayer" parent="ClubSelector"]
|
||||
|
@ -756,7 +713,7 @@ anchors_preset = -1
|
|||
anchor_top = 1.0
|
||||
anchor_right = 0.333
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -98.0
|
||||
offset_top = 20.0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 278.665
|
||||
grow_vertical = 0
|
||||
|
|
|
@ -1,10 +1,22 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://dwyy7tt3nose1"]
|
||||
[gd_scene load_steps=18 format=3 uid="uid://dwyy7tt3nose1"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://dsa0oh7c0h4pu" path="res://assets/fonts/Racing_Sans_One/RacingSansOne-Regular.ttf" id="1_mxxhu"]
|
||||
[ext_resource type="Texture2D" uid="uid://blfths5fy3a5u" path="res://assets/textures/pip_pattern.png" id="2_plyo3"]
|
||||
[ext_resource type="Script" path="res://src/ui/decorations/text_effects/typewriter/typewriter_label.gd" id="3_vuo1w"]
|
||||
[ext_resource type="AudioStream" uid="uid://c8bxu5lusqevv" path="res://assets/sound/sfx/ui/ecofuture3.wav" id="4_5f42w"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_wc65j"]
|
||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_14byh"]
|
||||
gradient = SubResource("Gradient_wc65j")
|
||||
width = 256
|
||||
height = 256
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(1, 0.5)
|
||||
metadata/_snap_enabled = true
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_rgpi4"]
|
||||
colors = PackedColorArray(0.49, 1, 0.643, 1, 1, 1, 1, 1)
|
||||
|
||||
|
@ -14,6 +26,21 @@ fill_from = Vector2(0.5, 0)
|
|||
fill_to = Vector2(0.5, 0.7)
|
||||
metadata/_snap_enabled = true
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7bus8"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(-800, -400)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ds0lb"]
|
||||
resource_name = "pan"
|
||||
length = 10.0
|
||||
|
@ -31,35 +58,166 @@ tracks/0/keys = {
|
|||
"values": [Vector2(-800, -400), Vector2(-901, -299)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7bus8"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(-800, -400)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_egd4v"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_7bus8"),
|
||||
"pan": SubResource("Animation_ds0lb")
|
||||
}
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_8cbqr"]
|
||||
offsets = PackedFloat32Array(0.1, 0.3, 0.7, 0.9)
|
||||
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0)
|
||||
metadata/_snap_enabled = true
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_thnrn"]
|
||||
gradient = SubResource("Gradient_8cbqr")
|
||||
fill_from = Vector2(0, 0.4)
|
||||
fill_to = Vector2(1, 0.7)
|
||||
metadata/_snap_enabled = true
|
||||
|
||||
[sub_resource type="Curve" id="Curve_ghy8a"]
|
||||
_data = [Vector2(0, 0), 0.0, 1.68564, 0, 0, Vector2(1, 1), -4.89573, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="Animation" id="Animation_cm2ua"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("VerticalCenter/GameLabelRoot:anchor_left")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-0.5]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("VerticalCenter/GameLabelRoot:anchor_right")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-0.5]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("CaptionLabel:anchor_top")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.5]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("CaptionLabel:anchor_bottom")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.5]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("VerticalCenter/LabelBack:anchor_left")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [1.5]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("VerticalCenter/LabelBack:anchor_right")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [1.5]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("AudioStreamPlayer:playing")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("CaptionLabel:rotation")
|
||||
tracks/7/interp = 3
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
tracks/8/type = "value"
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/path = NodePath("VerticalCenter/RadialGradient:modulate")
|
||||
tracks/8/interp = 1
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/9/type = "value"
|
||||
tracks/9/imported = false
|
||||
tracks/9/enabled = true
|
||||
tracks/9/path = NodePath("VerticalCenter/GameLabelRoot/LabelGlintClip/TextureRect:anchor_left")
|
||||
tracks/9/interp = 1
|
||||
tracks/9/loop_wrap = true
|
||||
tracks/9/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-0.5]
|
||||
}
|
||||
tracks/10/type = "value"
|
||||
tracks/10/imported = false
|
||||
tracks/10/enabled = true
|
||||
tracks/10/path = NodePath("VerticalCenter/GameLabelRoot/LabelGlintClip/TextureRect:anchor_right")
|
||||
tracks/10/interp = 1
|
||||
tracks/10/loop_wrap = true
|
||||
tracks/10/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-0.5]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_f8nc2"]
|
||||
resource_name = "play"
|
||||
length = 6.0
|
||||
loop_mode = 1
|
||||
length = 5.0
|
||||
loop_mode = 2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
|
@ -170,104 +328,55 @@ tracks/8/keys = {
|
|||
"update": 0,
|
||||
"values": [0.0, 0.0, 0.0872665, -0.0872665]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_cm2ua"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("VerticalCenter/GameLabelRoot:anchor_left")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
tracks/9/type = "value"
|
||||
tracks/9/imported = false
|
||||
tracks/9/enabled = true
|
||||
tracks/9/path = NodePath("VerticalCenter/RadialGradient:modulate")
|
||||
tracks/9/interp = 1
|
||||
tracks/9/loop_wrap = true
|
||||
tracks/9/keys = {
|
||||
"times": PackedFloat32Array(0, 0.6, 1.6, 2.2, 3.2),
|
||||
"transitions": PackedFloat32Array(1, 1.618, 1, 0.618, 1),
|
||||
"update": 0,
|
||||
"values": [-0.5]
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 0.470588), Color(1, 1, 1, 0.470588), Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("VerticalCenter/GameLabelRoot:anchor_right")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
tracks/10/type = "value"
|
||||
tracks/10/imported = false
|
||||
tracks/10/enabled = true
|
||||
tracks/10/path = NodePath("VerticalCenter/GameLabelRoot/LabelGlintClip/TextureRect:anchor_left")
|
||||
tracks/10/interp = 1
|
||||
tracks/10/loop_wrap = true
|
||||
tracks/10/keys = {
|
||||
"times": PackedFloat32Array(2.1, 2.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [-0.5]
|
||||
"values": [-0.5, 1.5]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("CaptionLabel:anchor_top")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
tracks/11/type = "value"
|
||||
tracks/11/imported = false
|
||||
tracks/11/enabled = true
|
||||
tracks/11/path = NodePath("VerticalCenter/GameLabelRoot/LabelGlintClip/TextureRect:anchor_right")
|
||||
tracks/11/interp = 1
|
||||
tracks/11/loop_wrap = true
|
||||
tracks/11/keys = {
|
||||
"times": PackedFloat32Array(2.1, 2.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [0.5]
|
||||
"values": [-0.5, 1.5]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("CaptionLabel:anchor_bottom")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
tracks/12/type = "method"
|
||||
tracks/12/imported = false
|
||||
tracks/12/enabled = true
|
||||
tracks/12/path = NodePath(".")
|
||||
tracks/12/interp = 1
|
||||
tracks/12/loop_wrap = true
|
||||
tracks/12/keys = {
|
||||
"times": PackedFloat32Array(5),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.5]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("VerticalCenter/LabelBack:anchor_left")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [1.5]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("VerticalCenter/LabelBack:anchor_right")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [1.5]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("AudioStreamPlayer:playing")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("CaptionLabel:rotation")
|
||||
tracks/7/interp = 1
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"queue_free"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_x18w1"]
|
||||
|
@ -297,6 +406,18 @@ offset_bottom = 150.0
|
|||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="RadialGradient" type="TextureRect" parent="VerticalCenter"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.2
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("GradientTexture2D_14byh")
|
||||
|
||||
[node name="LabelBack" type="Label" parent="VerticalCenter"]
|
||||
texture_filter = 4
|
||||
layout_mode = 1
|
||||
|
@ -401,6 +522,44 @@ libraries = {
|
|||
}
|
||||
autoplay = "pan"
|
||||
|
||||
[node name="LabelGlintClip" type="Label" parent="VerticalCenter/GameLabelRoot"]
|
||||
clip_children = 1
|
||||
texture_filter = 4
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -433.0
|
||||
offset_top = -191.0
|
||||
offset_right = 433.0
|
||||
offset_bottom = 191.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 9
|
||||
theme_override_fonts/font = ExtResource("1_mxxhu")
|
||||
theme_override_font_sizes/font_size = 300
|
||||
text = "GAME!"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="VerticalCenter/GameLabelRoot/LabelGlintClip"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = -0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = -0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("GradientTexture2D_thnrn")
|
||||
|
||||
[node name="CaptionLabel" type="RichTextLabel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
|
@ -433,3 +592,4 @@ autoplay = "play"
|
|||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("4_5f42w")
|
||||
bus = &"SFX"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
class_name WorldUI extends Control
|
||||
## Container & accessor for the world UI.
|
||||
|
||||
const DEATH_ALERT_SCENE := preload("res://src/ui/shot_hud/death_alert.tscn")
|
||||
|
||||
const DEMO_CAMERA_GROUP := "DemoCamera"
|
||||
|
||||
@export var pause_scene := preload("res://src/ui/menus/pause_menu/pause_menu.tscn")
|
||||
@export var pause_scene: PackedScene
|
||||
@export var death_alert_scene: PackedScene
|
||||
@export var winner_alert_scene: PackedScene
|
||||
|
||||
var _prev_camera: Camera3D
|
||||
var _pre_death_camera: Camera3D
|
||||
|
@ -14,6 +14,8 @@ var _pre_death_camera: Camera3D
|
|||
@onready var effect_container: Control = %EffectContainer
|
||||
@onready var pause_container: Control = %PauseContainer
|
||||
|
||||
@onready var world: World = $".."
|
||||
|
||||
|
||||
func _unhandled_key_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("pause"):
|
||||
|
@ -28,7 +30,7 @@ func add_player_hud(hud: ShotHUD) -> void:
|
|||
func play_death_sequence() -> void:
|
||||
_pre_death_camera = get_viewport().get_camera_3d()
|
||||
hud_container.hide()
|
||||
var alert := DEATH_ALERT_SCENE.instantiate()
|
||||
var alert := death_alert_scene.instantiate()
|
||||
alert.tree_exiting.connect(_finish_death_sequence)
|
||||
effect_container.add_child(alert)
|
||||
|
||||
|
@ -38,6 +40,17 @@ func _finish_death_sequence() -> void:
|
|||
_pre_death_camera.make_current()
|
||||
|
||||
|
||||
func play_winner_sequence() -> void:
|
||||
hud_container.hide()
|
||||
var alert := winner_alert_scene.instantiate()
|
||||
alert.tree_exiting.connect(_finish_winner_sequence)
|
||||
effect_container.add_child(alert)
|
||||
|
||||
|
||||
func _finish_winner_sequence() -> void:
|
||||
world.fade_to_title()
|
||||
|
||||
|
||||
func pause() -> void:
|
||||
# Switch to demo cam, if there is one.
|
||||
var democams: Array[Node] = get_tree().get_nodes_in_group(DEMO_CAMERA_GROUP)
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
class_name PlayManager extends Resource
|
||||
## Abstract base type for strategies to manage the flow of gameplay
|
||||
|
||||
## Emitted when a player should be spawned in the world
|
||||
@warning_ignore("unused_signal")
|
||||
signal spawning(player: WorldPlayer)
|
||||
|
||||
## Emitted at the start of each new turn
|
||||
@warning_ignore("unused_signal")
|
||||
signal turn_started(player: WorldPlayer)
|
||||
|
||||
## Emitted when a player has won the game
|
||||
@warning_ignore("unused_signal")
|
||||
signal winner(player: WorldPlayer)
|
||||
|
||||
## List of game player instances
|
||||
@export var players: Array[WorldPlayer] = []
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
class_name PracticeManager extends PlayManager
|
||||
## A single player can just kind of chill out and vibe...
|
||||
|
||||
var player: WorldPlayer:
|
||||
get:
|
||||
return players[0]
|
||||
set(value):
|
||||
players[0] = value
|
||||
|
||||
|
||||
func on_initialization() -> void:
|
||||
# Spawn practice player
|
||||
spawning.emit(player)
|
||||
|
||||
# Set first player as active
|
||||
player.shot_setup.phase = ShotSetup.Phase.AIM
|
||||
|
||||
|
||||
func on_turn_finished(_source: ShotSetup) -> void:
|
||||
player.shot_setup.queue_restart()
|
||||
turn_started.emit(player)
|
||||
|
||||
|
||||
func on_player_death(source: WorldPlayer) -> void:
|
||||
# Respawn player
|
||||
source.life = WorldPlayer.MAX_LIFE
|
||||
spawning.emit(source)
|
|
@ -3,6 +3,11 @@ class_name RoundRobinManager extends PlayManager
|
|||
|
||||
|
||||
func on_initialization() -> void:
|
||||
# Spawn all players
|
||||
for p: WorldPlayer in players:
|
||||
print("Emitting spawn signal for player ", p)
|
||||
spawning.emit(p)
|
||||
|
||||
# Set first player as active
|
||||
players[0].shot_setup.phase = ShotSetup.Phase.AIM
|
||||
|
||||
|
@ -20,10 +25,11 @@ func on_player_death(player: WorldPlayer) -> void:
|
|||
on_turn_finished(player.shot_setup)
|
||||
|
||||
players.erase(player)
|
||||
player.deconstruct()
|
||||
print("Player 0 phase: ", ShotSetup.Phase.keys()[players[0].shot_setup.phase])
|
||||
if len(players) == 1:
|
||||
on_win_condition()
|
||||
|
||||
|
||||
func on_win_condition() -> void:
|
||||
pass # TODO
|
||||
winner.emit(players[0])
|
||||
|
|
|
@ -4,6 +4,8 @@ class_name World extends Node
|
|||
## A world contains player(s) and the active level, manages player states,
|
||||
## and transitions between active levels.
|
||||
|
||||
const SCENE := "res://src/world/world.tscn"
|
||||
|
||||
@export var initial_level: PackedScene
|
||||
|
||||
@export var manager: PlayManager
|
||||
|
@ -15,17 +17,21 @@ var _spawns_available: Array[Node3D] = []
|
|||
@onready var level: Node3D = %Level
|
||||
@onready var ui: WorldUI = %UI
|
||||
|
||||
@onready var world_transition: AnimationPlayer = %WorldTransition
|
||||
|
||||
@onready var game: Game = get_tree().get_first_node_in_group(Game.group)
|
||||
|
||||
static var group := "WorldGroup"
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
load_level(initial_level)
|
||||
|
||||
# Spawn players in the level
|
||||
for player: WorldPlayer in manager.players:
|
||||
_spawn_player(player)
|
||||
manager.spawning.connect(_spawn_player)
|
||||
manager.winner.connect(_on_winner)
|
||||
|
||||
manager.initialize()
|
||||
|
||||
if not manager.players:
|
||||
push_warning("Warning: Starting game world with no players!")
|
||||
|
||||
|
@ -42,10 +48,26 @@ func _random_spawn() -> Node3D:
|
|||
|
||||
|
||||
func _spawn_player(player: WorldPlayer) -> void:
|
||||
print_debug("Spawning player: ", player)
|
||||
var spawn_point := _random_spawn()
|
||||
var shot_setup := player.shot_setup
|
||||
shot_setup.global_transform = spawn_point.global_transform
|
||||
spawn_point.add_sibling(shot_setup)
|
||||
if not shot_setup.get_parent():
|
||||
spawn_point.add_sibling(shot_setup)
|
||||
|
||||
|
||||
func _on_winner(_player: WorldPlayer) -> void:
|
||||
get_tree().paused = true
|
||||
ui.play_winner_sequence()
|
||||
# TODO announce winner?
|
||||
|
||||
|
||||
func fade_to_title() -> void:
|
||||
world_transition.play("fade_to_title")
|
||||
|
||||
|
||||
func _load_title() -> void:
|
||||
game.queue_scene(TitleScreen.SCENE)
|
||||
|
||||
|
||||
## Instantiate and mantle the given level scene.
|
||||
|
|
|
@ -1,19 +1,109 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://cwnwcd8kushl3"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://cwnwcd8kushl3"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/world/world.gd" id="1_ybjyx"]
|
||||
[ext_resource type="Script" path="res://src/player/world_player.gd" id="2_e743i"]
|
||||
[ext_resource type="PackedScene" uid="uid://bm2o3mex10v11" path="res://levels/debug_level/debug_level.tscn" id="2_hn84b"]
|
||||
[ext_resource type="Script" path="res://src/ui/world_ui.gd" id="2_imewa"]
|
||||
[ext_resource type="PackedScene" uid="uid://x2bqqlrnno28" path="res://levels/oneill/oneill.tscn" id="2_w576d"]
|
||||
[ext_resource type="Resource" uid="uid://crock3revdn73" path="res://src/player/debug_player.tres" id="3_pyw81"]
|
||||
[ext_resource type="Resource" uid="uid://c1pnqsddvey3m" path="res://src/equipment/clubs/drivers/debug_driver.tres" id="5_28hal"]
|
||||
[ext_resource type="Script" path="res://src/world/play_manager/round_robin_manager.gd" id="5_h6mje"]
|
||||
[ext_resource type="PackedScene" uid="uid://byvjsvavbg5xe" path="res://src/ui/menus/pause_menu/pause_menu.tscn" id="7_0gd42"]
|
||||
[ext_resource type="PackedScene" uid="uid://biokiug3e0ipk" path="res://src/ui/shot_hud/death_alert.tscn" id="8_fuyxc"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwyy7tt3nose1" path="res://src/ui/shot_hud/winner_alert.tscn" id="9_lln1k"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mbhdy"]
|
||||
script = ExtResource("2_e743i")
|
||||
life = 3.0
|
||||
name = "DeadGfolfer"
|
||||
color = Color(1, 0.439216, 0.439216, 1)
|
||||
driver = ExtResource("5_28hal")
|
||||
_balls = {
|
||||
1: -1,
|
||||
2: -1
|
||||
}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_rdjhi"]
|
||||
script = ExtResource("5_h6mje")
|
||||
players = Array[ExtResource("2_e743i")]([ExtResource("3_pyw81")])
|
||||
players = Array[ExtResource("2_e743i")]([ExtResource("3_pyw81"), SubResource("Resource_mbhdy")])
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ihq1m"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_0v2so"]
|
||||
resource_name = "fade_to_black"
|
||||
length = 0.8
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:color")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = false
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.8),
|
||||
"transitions": PackedFloat32Array(0.618, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/2/type = "method"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("%UI/..")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0.8),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"_load_title"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_s6tn7"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_ihq1m"),
|
||||
"fade_to_title": SubResource("Animation_0v2so")
|
||||
}
|
||||
|
||||
[node name="World" type="Node" groups=["WorldGroup"]]
|
||||
script = ExtResource("1_ybjyx")
|
||||
initial_level = ExtResource("2_w576d")
|
||||
initial_level = ExtResource("2_hn84b")
|
||||
manager = SubResource("Resource_rdjhi")
|
||||
|
||||
[node name="Level" type="Node3D" parent="."]
|
||||
|
@ -29,6 +119,9 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
script = ExtResource("2_imewa")
|
||||
pause_scene = ExtResource("7_0gd42")
|
||||
death_alert_scene = ExtResource("8_fuyxc")
|
||||
winner_alert_scene = ExtResource("9_lln1k")
|
||||
|
||||
[node name="HUDContainer" type="Control" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
|
@ -59,3 +152,21 @@ anchor_bottom = 1.0
|
|||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="Whiteout" type="ColorRect" parent="UI"]
|
||||
process_mode = 3
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="WorldTransition" type="AnimationPlayer" parent="UI/Whiteout"]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_s6tn7")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue