generated from krampus/template-godot4
	Compare commits
	
		
			No commits in common. "478b1e0849719f34912b1469318e4840931ae4a1" and "1101ed4b3d1a904617d330a7ddf2fba090b748a1" have entirely different histories.
		
	
	
		
			478b1e0849
			...
			1101ed4b3d
		
	
		
| @ -31,9 +31,6 @@ DM_PLAYERS,Gfolfers | |||||||
| DM_ADD_PLAYER,"Add a Gfolfer" | DM_ADD_PLAYER,"Add a Gfolfer" | ||||||
| DM_NAME_PLACEHOLDER,"Enter a name" | DM_NAME_PLACEHOLDER,"Enter a name" | ||||||
| , | , | ||||||
| PRACTICE_HEADING,"Practice your GFOLFing" |  | ||||||
| PRACTICE_MAP,"Select a Map" |  | ||||||
| , |  | ||||||
| PAUSE_HEADING,Paused | PAUSE_HEADING,Paused | ||||||
| PAUSE_RESUME,Resume | PAUSE_RESUME,Resume | ||||||
| PAUSE_SETTINGS,Settings | PAUSE_SETTINGS,Settings | ||||||
|  | |||||||
| 
 | 
| @ -1,11 +1,9 @@ | |||||||
| [gd_resource type="Resource" script_class="Level" load_steps=4 format=3 uid="uid://cfsy1nlfo4inx"] | [gd_resource type="Resource" script_class="Level" load_steps=3 format=3 uid="uid://cfsy1nlfo4inx"] | ||||||
| 
 | 
 | ||||||
| [ext_resource type="PackedScene" uid="uid://x2bqqlrnno28" path="res://levels/oneill/oneill.tscn" id="1_431yv"] | [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"] | [ext_resource type="Script" path="res://src/world/level/level.gd" id="2_fnj1e"] | ||||||
| 
 | 
 | ||||||
| [resource] | [resource] | ||||||
| script = ExtResource("2_fnj1e") | script = ExtResource("2_fnj1e") | ||||||
| scene = ExtResource("1_431yv") | scene = ExtResource("1_431yv") | ||||||
| level_name = "MAP_ONEILL" | level_name = "MAP_ONEILL" | ||||||
| preview = ExtResource("1_n552e") |  | ||||||
|  | |||||||
							
								
								
									
										
											BIN
										
									
								
								levels/oneill/preview.jpg
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								levels/oneill/preview.jpg
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -1,34 +0,0 @@ | |||||||
| [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,9 +79,6 @@ func _unload_content() -> void: | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func _finish_scene_load(instance: Node) -> void: | func _finish_scene_load(instance: Node) -> void: | ||||||
| 	# Unpause in case the previous scene was paused. |  | ||||||
| 	get_tree().paused = false |  | ||||||
| 
 |  | ||||||
| 	content.add_child(instance) | 	content.add_child(instance) | ||||||
| 	instance.reparent(content) | 	instance.reparent(content) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -119,6 +119,7 @@ _data = { | |||||||
| [node name="Game" type="Node" groups=["GameGroup"]] | [node name="Game" type="Node" groups=["GameGroup"]] | ||||||
| process_mode = 3 | process_mode = 3 | ||||||
| script = ExtResource("1_4qa87") | script = ExtResource("1_4qa87") | ||||||
|  | start_scene = "res://src/world/world.tscn" | ||||||
| 
 | 
 | ||||||
| [node name="RootControl" type="Control" parent="."] | [node name="RootControl" type="Control" parent="."] | ||||||
| unique_name_in_owner = true | unique_name_in_owner = true | ||||||
|  | |||||||
| @ -103,8 +103,7 @@ var club: Club: | |||||||
| var ball_type: GameBall.Type: | var ball_type: GameBall.Type: | ||||||
| 	set(value): | 	set(value): | ||||||
| 		if value != ball_type: | 		if value != ball_type: | ||||||
| 			if hud: | 			hud.ball_selector.value = value | ||||||
| 				hud.ball_selector.value = value |  | ||||||
| 			ball_point.spawn_ball(value) | 			ball_point.spawn_ball(value) | ||||||
| 		ball_type = value | 		ball_type = value | ||||||
| 
 | 
 | ||||||
| @ -181,11 +180,10 @@ func _ready() -> void: | |||||||
| 		player.on_life_changed.connect(_on_life_changed) | 		player.on_life_changed.connect(_on_life_changed) | ||||||
| 
 | 
 | ||||||
| 		# Create & set up HUD | 		# Create & set up HUD | ||||||
| 		ball_type = initial_ball |  | ||||||
| 		club_type = initial_club_type |  | ||||||
| 
 |  | ||||||
| 		hud = ShotHUD.create(player) | 		hud = ShotHUD.create(player) | ||||||
| 		world.ui.add_player_hud(hud) | 		world.ui.add_player_hud(hud) | ||||||
|  | 		ball_type = initial_ball | ||||||
|  | 		club_type = initial_club_type | ||||||
| 		character.set_color(player.color) | 		character.set_color(player.color) | ||||||
| 
 | 
 | ||||||
| 		# Set up player 3D label | 		# Set up player 3D label | ||||||
| @ -193,7 +191,7 @@ func _ready() -> void: | |||||||
| 		player_label.modulate = player.color | 		player_label.modulate = player.color | ||||||
| 		player_label.outline_modulate = ColorTools.get_bg_color(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: | func _on_tree_exiting() -> void: | ||||||
| @ -426,6 +424,7 @@ func finish_death() -> void: | |||||||
| 	print_debug("finishing death sequence") | 	print_debug("finishing death sequence") | ||||||
| 	get_tree().paused = false | 	get_tree().paused = false | ||||||
| 	player.die() | 	player.die() | ||||||
|  | 	queue_free() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func _set_club_type(new_club_type: Club.Type) -> void: | func _set_club_type(new_club_type: Club.Type) -> void: | ||||||
| @ -444,8 +443,7 @@ func _set_club_type(new_club_type: Club.Type) -> void: | |||||||
| 	wedge_arrow.hide() | 	wedge_arrow.hide() | ||||||
| 	iron_arrow.hide() | 	iron_arrow.hide() | ||||||
| 	putt_arrow.hide() | 	putt_arrow.hide() | ||||||
| 	if hud: | 	hud.club_selector.value = new_club_type | ||||||
| 		hud.club_selector.value = new_club_type |  | ||||||
| 	# TODO club change animation | 	# TODO club change animation | ||||||
| 	character.hold_right(new_club.get_model()) | 	character.hold_right(new_club.get_model()) | ||||||
| 	match new_club_type: | 	match new_club_type: | ||||||
| @ -529,8 +527,6 @@ func _process(delta: float) -> void: | |||||||
| 	# REMOVEME | 	# REMOVEME | ||||||
| 	if Input.is_action_just_pressed("ui_menu"): | 	if Input.is_action_just_pressed("ui_menu"): | ||||||
| 		print("Debugging...") | 		print("Debugging...") | ||||||
| 	if Input.is_action_just_pressed("debug_2"): |  | ||||||
| 		player.life -= 90 |  | ||||||
| 
 | 
 | ||||||
| 	## Visual updates | 	## Visual updates | ||||||
| 	# Rotation | 	# Rotation | ||||||
| @ -646,7 +642,6 @@ func _process(delta: float) -> void: | |||||||
| 				phase = Phase.AIM | 				phase = Phase.AIM | ||||||
| 		Phase.DEAD: | 		Phase.DEAD: | ||||||
| 			start_death() | 			start_death() | ||||||
| 			phase = Phase.FINISHED |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func _on_ball_sleeping_state_changed() -> void: | func _on_ball_sleeping_state_changed() -> void: | ||||||
|  | |||||||
| @ -101,11 +101,6 @@ func die() -> void: | |||||||
| 	on_death.emit(self) | 	on_death.emit(self) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func deconstruct() -> void: |  | ||||||
| 	if is_instance_valid(shot_setup): |  | ||||||
| 		shot_setup.queue_free() |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| ## Create a debug player instance | ## Create a debug player instance | ||||||
| static func create_debug() -> WorldPlayer: | static func create_debug() -> WorldPlayer: | ||||||
| 	var instance := WorldPlayer.new() | 	var instance := WorldPlayer.new() | ||||||
|  | |||||||
| @ -28,7 +28,6 @@ var _force_visible := false | |||||||
| 
 | 
 | ||||||
| func _init(force_visible_signal: Variant = null) -> void: | func _init(force_visible_signal: Variant = null) -> void: | ||||||
| 	if force_visible_signal is Signal: | 	if force_visible_signal is Signal: | ||||||
| 		@warning_ignore("unsafe_cast") |  | ||||||
| 		(force_visible_signal as Signal).connect(_set_force_visible) | 		(force_visible_signal as Signal).connect(_set_force_visible) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -10,7 +10,8 @@ var _freeze_input := false | |||||||
| @onready var end_game_confirm: CenterContainer = %EndGameConfirm | @onready var end_game_confirm: CenterContainer = %EndGameConfirm | ||||||
| @onready var settings_container: MarginContainer = %SettingsContainer | @onready var settings_container: MarginContainer = %SettingsContainer | ||||||
| 
 | 
 | ||||||
| @onready var world: World = get_tree().get_first_node_in_group(World.group) | @onready var transition_animation: AnimationPlayer = %TransitionAnimation | ||||||
|  | 
 | ||||||
| @onready var game: Game = get_tree().get_first_node_in_group(Game.group) | @onready var game: Game = get_tree().get_first_node_in_group(Game.group) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -64,5 +65,9 @@ func cancel_end_game() -> void: | |||||||
| 	end_game_confirm.hide() | 	end_game_confirm.hide() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | func _return_to_title() -> void: | ||||||
|  | 	game.queue_scene(TitleScreen.SCENE) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| func confirm_end_game() -> void: | func confirm_end_game() -> void: | ||||||
| 	world.fade_to_title() | 	transition_animation.play("fade_to_black") | ||||||
|  | |||||||
| @ -1,9 +1,84 @@ | |||||||
| [gd_scene load_steps=4 format=3 uid="uid://byvjsvavbg5xe"] | [gd_scene load_steps=7 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="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="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"] | [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"] | [node name="PauseMenu" type="Control"] | ||||||
| process_mode = 3 | process_mode = 3 | ||||||
| layout_mode = 3 | layout_mode = 3 | ||||||
| @ -177,6 +252,21 @@ size_flags_horizontal = 3 | |||||||
| theme_type_variation = &"AlertButton" | theme_type_variation = &"AlertButton" | ||||||
| text = "PAUSE_END" | 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/ResumeButton" to="." method="resume"] | ||||||
| [connection signal="pressed" from="MarginContainer/MenuList/SettingsButton" to="." method="settings"] | [connection signal="pressed" from="MarginContainer/MenuList/SettingsButton" to="." method="settings"] | ||||||
| [connection signal="pressed" from="MarginContainer/MenuList/EndGameButton" to="." method="end_game"] | [connection signal="pressed" from="MarginContainer/MenuList/EndGameButton" to="." method="end_game"] | ||||||
|  | |||||||
| @ -1,5 +1,7 @@ | |||||||
| extends PanelContainer | extends PanelContainer | ||||||
| 
 | 
 | ||||||
|  | const WORLD_SCENE_PATH := "res://src/world/world.tscn" | ||||||
|  | 
 | ||||||
| const RANDOM_PLAYER_COLORS := [ | const RANDOM_PLAYER_COLORS := [ | ||||||
| 	Color.LIGHT_CORAL, | 	Color.LIGHT_CORAL, | ||||||
| 	Color.GOLDENROD, | 	Color.GOLDENROD, | ||||||
| @ -52,7 +54,7 @@ func start() -> void: | |||||||
| 		world.manager = RoundRobinManager.new() | 		world.manager = RoundRobinManager.new() | ||||||
| 		world.manager.players = player_list | 		world.manager.players = player_list | ||||||
| 		world.initial_level = level.scene | 		world.initial_level = level.scene | ||||||
| 	game.queue_scene(World.SCENE).then(init_world) | 	game.queue_scene(WORLD_SCENE_PATH).then(init_world) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ## Returns the `Level` selected by the user if there is one, or `null` if no level is selected. | ## Returns the `Level` selected by the user if there is one, or `null` if no level is selected. | ||||||
|  | |||||||
| @ -66,33 +66,6 @@ _data = { | |||||||
| "rotate": SubResource("Animation_c3p73") | "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"] | [sub_resource type="Animation" id="Animation_560ro"] | ||||||
| resource_name = "fade_out" | resource_name = "fade_out" | ||||||
| length = 0.6 | length = 0.6 | ||||||
| @ -138,6 +111,33 @@ tracks/2/keys = { | |||||||
| "values": [true] | "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"] | [sub_resource type="AnimationLibrary" id="AnimationLibrary_s1eyj"] | ||||||
| _data = { | _data = { | ||||||
| "RESET": SubResource("Animation_x4wqc"), | "RESET": SubResource("Animation_x4wqc"), | ||||||
|  | |||||||
| @ -1,55 +0,0 @@ | |||||||
| 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() |  | ||||||
| @ -1,197 +0,0 @@ | |||||||
| [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,7 +5,6 @@ const SCENE := "res://src/ui/menus/title_screen/title_screen.tscn" | |||||||
| @export var title_crawl_scene: PackedScene | @export var title_crawl_scene: PackedScene | ||||||
| @export var settings_scene: PackedScene | @export var settings_scene: PackedScene | ||||||
| @export var local_deathmatch_setup_scene: PackedScene | @export var local_deathmatch_setup_scene: PackedScene | ||||||
| @export var practice_setup_scene: PackedScene |  | ||||||
| 
 | 
 | ||||||
| @onready var menu: Control = %Menu | @onready var menu: Control = %Menu | ||||||
| @onready var settings_container: MarginContainer = %SettingsContainer | @onready var settings_container: MarginContainer = %SettingsContainer | ||||||
| @ -20,10 +19,6 @@ const SCENE := "res://src/ui/menus/title_screen/title_screen.tscn" | |||||||
| @onready var game: Game = get_tree().get_first_node_in_group(Game.group) | @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: | func play_chime() -> void: | ||||||
| 	game.sfx.chime.play() | 	game.sfx.chime.play() | ||||||
| 
 | 
 | ||||||
| @ -85,10 +80,3 @@ func _open_local_deathmatch_setup() -> void: | |||||||
| 	deathmatch_setup_container.add_child(instance) | 	deathmatch_setup_container.add_child(instance) | ||||||
| 	instance.tree_exited.connect(_unhide) | 	instance.tree_exited.connect(_unhide) | ||||||
| 	_hide() | 	_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=87 format=3 uid="uid://7fsgocmdas7i"] | [gd_scene load_steps=86 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="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"] | [ext_resource type="Texture2D" uid="uid://880x5n8j3b5l" path="res://assets/logo/title.png" id="1_pm82i"] | ||||||
| @ -6,7 +6,6 @@ | |||||||
| [ext_resource type="Texture2D" uid="uid://clesl8lljs6of" path="res://assets/logo/subtitle.png" id="2_y0ulk"] | [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="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="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"] | [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"] | [sub_resource type="Environment" id="Environment_ardux"] | ||||||
| @ -19,21 +18,6 @@ ssil_intensity = 0.4 | |||||||
| glow_enabled = true | glow_enabled = true | ||||||
| glow_intensity = 2.0 | 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"] | [sub_resource type="Animation" id="Animation_bby3k"] | ||||||
| resource_name = "rotate" | resource_name = "rotate" | ||||||
| length = 180.0 | length = 180.0 | ||||||
| @ -51,6 +35,21 @@ tracks/0/keys = { | |||||||
| "values": [Vector3(-0.785398, 0, 0), Vector3(-0.785398, 6.28319, 0)] | "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"] | [sub_resource type="AnimationLibrary" id="AnimationLibrary_g0lq7"] | ||||||
| _data = { | _data = { | ||||||
| "RESET": SubResource("Animation_vci0b"), | "RESET": SubResource("Animation_vci0b"), | ||||||
| @ -1363,7 +1362,6 @@ script = ExtResource("1_2qtlb") | |||||||
| title_crawl_scene = ExtResource("7_r26eu") | title_crawl_scene = ExtResource("7_r26eu") | ||||||
| settings_scene = ExtResource("2_g5q2v") | settings_scene = ExtResource("2_g5q2v") | ||||||
| local_deathmatch_setup_scene = ExtResource("3_bo4ty") | local_deathmatch_setup_scene = ExtResource("3_bo4ty") | ||||||
| practice_setup_scene = ExtResource("5_hws1o") |  | ||||||
| 
 | 
 | ||||||
| [node name="SceneRoot" type="Node3D" parent="."] | [node name="SceneRoot" type="Node3D" parent="."] | ||||||
| 
 | 
 | ||||||
| @ -1374,7 +1372,7 @@ environment = SubResource("Environment_ardux") | |||||||
| transform = Transform3D(-0.5, 0, 0.866025, 0, 1, 0, -0.866025, 0, -0.5, 0, 0, 0) | 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"] | [node name="DirectionalLight3D" type="DirectionalLight3D" parent="SceneRoot/LightRotationRoot"] | ||||||
| transform = Transform3D(-1, 1.79264e-06, -1.79264e-06, 0, 0.707107, 0.707107, 2.53518e-06, 0.707107, -0.707107, 0, 0, 0) | transform = Transform3D(-1, -6.18172e-08, 6.18172e-08, 0, 0.707107, 0.707107, -8.74228e-08, 0.707107, -0.707107, 0, 0, 0) | ||||||
| light_color = Color(0.95, 1, 0.989167, 1) | light_color = Color(0.95, 1, 0.989167, 1) | ||||||
| light_energy = 1.2 | light_energy = 1.2 | ||||||
| 
 | 
 | ||||||
| @ -1482,7 +1480,7 @@ grow_horizontal = 2 | |||||||
| grow_vertical = 2 | grow_vertical = 2 | ||||||
| 
 | 
 | ||||||
| [node name="PressStart" type="Label" parent="Menu"] | [node name="PressStart" type="Label" parent="Menu"] | ||||||
| modulate = Color(1, 1, 1, 0.124112) | modulate = Color(1, 1, 1, 0.0282702) | ||||||
| layout_mode = 1 | layout_mode = 1 | ||||||
| anchors_preset = 8 | anchors_preset = 8 | ||||||
| anchor_left = 0.5 | anchor_left = 0.5 | ||||||
| @ -1578,6 +1576,7 @@ text = "TITLE_ROGUELIKE" | |||||||
| [node name="Practice" type="Button" parent="Menu/SingleplayerMenu"] | [node name="Practice" type="Button" parent="Menu/SingleplayerMenu"] | ||||||
| layout_mode = 2 | layout_mode = 2 | ||||||
| theme_type_variation = &"PauseMenuButton" | theme_type_variation = &"PauseMenuButton" | ||||||
|  | disabled = true | ||||||
| text = "TITLE_PRACTICE" | text = "TITLE_PRACTICE" | ||||||
| 
 | 
 | ||||||
| [node name="Back" type="Button" parent="Menu/SingleplayerMenu"] | [node name="Back" type="Button" parent="Menu/SingleplayerMenu"] | ||||||
| @ -1744,7 +1743,6 @@ autostart = true | |||||||
| [connection signal="pressed" from="Menu/MainMenu/MultiPlayer" to="." method="_to_multi_player"] | [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/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/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/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/LocalMultiplayer" to="." method="_to_local_multi"] | ||||||
| [connection signal="pressed" from="Menu/MultiplayerMenu/NetMultiplayer" to="." method="_to_network_multi"] | [connection signal="pressed" from="Menu/MultiplayerMenu/NetMultiplayer" to="." method="_to_network_multi"] | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| class_name ShotHUD extends Control | class_name ShotHUD extends Control | ||||||
| ## HUD for main gameplay loop | ## 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 | ## Scale factor for the life bar rumble intensity on taking damage | ||||||
| const LIFE_BAR_DAMAGE_RUMBLE_SCALE := 0.2 | const LIFE_BAR_DAMAGE_RUMBLE_SCALE := 0.2 | ||||||
| ## Time it takes to dampen the life bar rumble on taking damage, in seconds | ## Time it takes to dampen the life bar rumble on taking damage, in seconds | ||||||
| @ -10,8 +12,6 @@ const LIFE_BAR_HEAL_DELAY := 0.8 | |||||||
| ## Time it takes the life bar to fill when restoring life, in seconds | ## Time it takes the life bar to fill when restoring life, in seconds | ||||||
| const LIFE_BAR_HEAL_TIME := 1.0 | const LIFE_BAR_HEAL_TIME := 1.0 | ||||||
| 
 | 
 | ||||||
| @export var nice_alert_scene: PackedScene |  | ||||||
| 
 |  | ||||||
| var player: WorldPlayer | var player: WorldPlayer | ||||||
| 
 | 
 | ||||||
| @onready var power_bar: TextureProgressBar = %PowerBar | @onready var power_bar: TextureProgressBar = %PowerBar | ||||||
| @ -103,7 +103,7 @@ func gauge_flourish() -> void: | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func play_nice_animation() -> 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: | func play_wasted_animation() -> void: | ||||||
|  | |||||||
| @ -1,9 +1,8 @@ | |||||||
| [gd_scene load_steps=47 format=3 uid="uid://c4ifdiohng830"] | [gd_scene load_steps=46 format=3 uid="uid://c4ifdiohng830"] | ||||||
| 
 | 
 | ||||||
| [ext_resource type="Script" path="res://src/ui/shot_hud/shot_hud.gd" id="1_x5b4c"] | [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="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://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="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://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"] | [ext_resource type="Texture2D" uid="uid://76fjx2ukavqe" path="res://assets/ui/power_gauge_fill.png" id="5_3i1yq"] | ||||||
| @ -267,7 +266,7 @@ tracks/0/keys = { | |||||||
| "times": PackedFloat32Array(0), | "times": PackedFloat32Array(0), | ||||||
| "transitions": PackedFloat32Array(1), | "transitions": PackedFloat32Array(1), | ||||||
| "update": 0, | "update": 0, | ||||||
| "values": [-1.5708] | "values": [0.0] | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [sub_resource type="Animation" id="Animation_w7dmn"] | [sub_resource type="Animation" id="Animation_w7dmn"] | ||||||
| @ -335,14 +334,26 @@ length = 0.001 | |||||||
| tracks/0/type = "value" | tracks/0/type = "value" | ||||||
| tracks/0/imported = false | tracks/0/imported = false | ||||||
| tracks/0/enabled = true | tracks/0/enabled = true | ||||||
| tracks/0/path = NodePath("SouthWest:offset_top") | tracks/0/path = NodePath("SouthWest:visible") | ||||||
| tracks/0/interp = 2 | tracks/0/interp = 1 | ||||||
| tracks/0/loop_wrap = true | tracks/0/loop_wrap = true | ||||||
| tracks/0/keys = { | tracks/0/keys = { | ||||||
| "times": PackedFloat32Array(0), | "times": PackedFloat32Array(0), | ||||||
| "transitions": PackedFloat32Array(1), | "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, | "update": 0, | ||||||
| "values": [20.0] | "values": [-98.0] | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [sub_resource type="Animation" id="Animation_yis4x"] | [sub_resource type="Animation" id="Animation_yis4x"] | ||||||
| @ -352,10 +363,22 @@ step = 0.02 | |||||||
| tracks/0/type = "value" | tracks/0/type = "value" | ||||||
| tracks/0/imported = false | tracks/0/imported = false | ||||||
| tracks/0/enabled = true | tracks/0/enabled = true | ||||||
| tracks/0/path = NodePath("SouthWest:offset_top") | tracks/0/path = NodePath("SouthWest:visible") | ||||||
| tracks/0/interp = 2 | tracks/0/interp = 1 | ||||||
| tracks/0/loop_wrap = true | tracks/0/loop_wrap = true | ||||||
| tracks/0/keys = { | 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), | "times": PackedFloat32Array(0, 0.1, 0.4), | ||||||
| "transitions": PackedFloat32Array(1.618, 1.618, 1), | "transitions": PackedFloat32Array(1.618, 1.618, 1), | ||||||
| "update": 0, | "update": 0, | ||||||
| @ -369,10 +392,22 @@ step = 0.02 | |||||||
| tracks/0/type = "value" | tracks/0/type = "value" | ||||||
| tracks/0/imported = false | tracks/0/imported = false | ||||||
| tracks/0/enabled = true | tracks/0/enabled = true | ||||||
| tracks/0/path = NodePath("SouthWest:offset_top") | tracks/0/path = NodePath("SouthWest:visible") | ||||||
| tracks/0/interp = 1 | tracks/0/interp = 1 | ||||||
| tracks/0/loop_wrap = true | tracks/0/loop_wrap = true | ||||||
| tracks/0/keys = { | 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), | "times": PackedFloat32Array(0, 0.1, 2.3, 2.4), | ||||||
| "transitions": PackedFloat32Array(1.618, 1, 1.618, 1), | "transitions": PackedFloat32Array(1.618, 1, 1.618, 1), | ||||||
| "update": 0, | "update": 0, | ||||||
| @ -386,10 +421,22 @@ step = 0.02 | |||||||
| tracks/0/type = "value" | tracks/0/type = "value" | ||||||
| tracks/0/imported = false | tracks/0/imported = false | ||||||
| tracks/0/enabled = true | tracks/0/enabled = true | ||||||
| tracks/0/path = NodePath("SouthWest:offset_top") | tracks/0/path = NodePath("SouthWest:visible") | ||||||
| tracks/0/interp = 2 | tracks/0/interp = 1 | ||||||
| tracks/0/loop_wrap = true | tracks/0/loop_wrap = true | ||||||
| tracks/0/keys = { | 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), | "times": PackedFloat32Array(0, 0.34, 0.4), | ||||||
| "transitions": PackedFloat32Array(1.618, 1.618, 1), | "transitions": PackedFloat32Array(1.618, 1.618, 1), | ||||||
| "update": 0, | "update": 0, | ||||||
| @ -521,7 +568,6 @@ grow_horizontal = 2 | |||||||
| grow_vertical = 2 | grow_vertical = 2 | ||||||
| mouse_filter = 2 | mouse_filter = 2 | ||||||
| script = ExtResource("1_x5b4c") | script = ExtResource("1_x5b4c") | ||||||
| nice_alert_scene = ExtResource("2_rnndf") |  | ||||||
| 
 | 
 | ||||||
| [node name="WastedFeedback" type="RichTextLabel" parent="."] | [node name="WastedFeedback" type="RichTextLabel" parent="."] | ||||||
| visible = false | visible = false | ||||||
| @ -596,7 +642,6 @@ script = ExtResource("3_6groq") | |||||||
| 
 | 
 | ||||||
| [node name="PowerBar" type="TextureProgressBar" parent="ShotGauges/PowerGauge/Rumbler"] | [node name="PowerBar" type="TextureProgressBar" parent="ShotGauges/PowerGauge/Rumbler"] | ||||||
| unique_name_in_owner = true | unique_name_in_owner = true | ||||||
| visible = false |  | ||||||
| texture_filter = 5 | texture_filter = 5 | ||||||
| custom_minimum_size = Vector2(64, 0) | custom_minimum_size = Vector2(64, 0) | ||||||
| layout_mode = 1 | layout_mode = 1 | ||||||
| @ -646,7 +691,6 @@ mouse_filter = 1 | |||||||
| 
 | 
 | ||||||
| [node name="CurveBar" parent="ShotGauges/CurveGauge" instance=ExtResource("7_kqi7w")] | [node name="CurveBar" parent="ShotGauges/CurveGauge" instance=ExtResource("7_kqi7w")] | ||||||
| unique_name_in_owner = true | unique_name_in_owner = true | ||||||
| visible = false |  | ||||||
| layout_mode = 1 | layout_mode = 1 | ||||||
| 
 | 
 | ||||||
| [node name="CurveAnimation" type="AnimationPlayer" parent="ShotGauges/CurveGauge"] | [node name="CurveAnimation" type="AnimationPlayer" parent="ShotGauges/CurveGauge"] | ||||||
| @ -668,7 +712,6 @@ offset_right = 50.0 | |||||||
| offset_bottom = 50.0 | offset_bottom = 50.0 | ||||||
| grow_horizontal = 1 | grow_horizontal = 1 | ||||||
| grow_vertical = 1 | grow_vertical = 1 | ||||||
| rotation = 4.71239 |  | ||||||
| pivot_offset = Vector2(-400, 0) | pivot_offset = Vector2(-400, 0) | ||||||
| 
 | 
 | ||||||
| [node name="ClubSelectorAnimation" type="AnimationPlayer" parent="ClubSelector"] | [node name="ClubSelectorAnimation" type="AnimationPlayer" parent="ClubSelector"] | ||||||
| @ -713,7 +756,7 @@ anchors_preset = -1 | |||||||
| anchor_top = 1.0 | anchor_top = 1.0 | ||||||
| anchor_right = 0.333 | anchor_right = 0.333 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
| offset_top = 20.0 | offset_top = -98.0 | ||||||
| offset_right = 40.0 | offset_right = 40.0 | ||||||
| offset_bottom = 278.665 | offset_bottom = 278.665 | ||||||
| grow_vertical = 0 | grow_vertical = 0 | ||||||
|  | |||||||
| @ -1,22 +1,10 @@ | |||||||
| [gd_scene load_steps=18 format=3 uid="uid://dwyy7tt3nose1"] | [gd_scene load_steps=14 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="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="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="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"] | [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"] | [sub_resource type="Gradient" id="Gradient_rgpi4"] | ||||||
| colors = PackedColorArray(0.49, 1, 0.643, 1, 1, 1, 1, 1) | colors = PackedColorArray(0.49, 1, 0.643, 1, 1, 1, 1, 1) | ||||||
| 
 | 
 | ||||||
| @ -26,21 +14,6 @@ fill_from = Vector2(0.5, 0) | |||||||
| fill_to = Vector2(0.5, 0.7) | fill_to = Vector2(0.5, 0.7) | ||||||
| metadata/_snap_enabled = true | 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"] | [sub_resource type="Animation" id="Animation_ds0lb"] | ||||||
| resource_name = "pan" | resource_name = "pan" | ||||||
| length = 10.0 | length = 10.0 | ||||||
| @ -58,166 +31,35 @@ tracks/0/keys = { | |||||||
| "values": [Vector2(-800, -400), Vector2(-901, -299)] | "values": [Vector2(-800, -400), Vector2(-901, -299)] | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [sub_resource type="AnimationLibrary" id="AnimationLibrary_egd4v"] | [sub_resource type="Animation" id="Animation_7bus8"] | ||||||
| _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 | length = 0.001 | ||||||
| tracks/0/type = "value" | tracks/0/type = "value" | ||||||
| tracks/0/imported = false | tracks/0/imported = false | ||||||
| tracks/0/enabled = true | tracks/0/enabled = true | ||||||
| tracks/0/path = NodePath("VerticalCenter/GameLabelRoot:anchor_left") | tracks/0/path = NodePath(".:position") | ||||||
| tracks/0/interp = 1 | tracks/0/interp = 1 | ||||||
| tracks/0/loop_wrap = true | tracks/0/loop_wrap = true | ||||||
| tracks/0/keys = { | tracks/0/keys = { | ||||||
| "times": PackedFloat32Array(0), | "times": PackedFloat32Array(0), | ||||||
| "transitions": PackedFloat32Array(1), | "transitions": PackedFloat32Array(1), | ||||||
| "update": 0, | "update": 0, | ||||||
| "values": [-0.5] | "values": [Vector2(-800, -400)] | ||||||
| } | } | ||||||
| tracks/1/type = "value" | 
 | ||||||
| tracks/1/imported = false | [sub_resource type="AnimationLibrary" id="AnimationLibrary_egd4v"] | ||||||
| tracks/1/enabled = true | _data = { | ||||||
| tracks/1/path = NodePath("VerticalCenter/GameLabelRoot:anchor_right") | "RESET": SubResource("Animation_7bus8"), | ||||||
| tracks/1/interp = 1 | "pan": SubResource("Animation_ds0lb") | ||||||
| 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="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_f8nc2"] | [sub_resource type="Animation" id="Animation_f8nc2"] | ||||||
| resource_name = "play" | resource_name = "play" | ||||||
| length = 5.0 | length = 6.0 | ||||||
| loop_mode = 2 | loop_mode = 1 | ||||||
| tracks/0/type = "value" | tracks/0/type = "value" | ||||||
| tracks/0/imported = false | tracks/0/imported = false | ||||||
| tracks/0/enabled = true | tracks/0/enabled = true | ||||||
| @ -328,55 +170,104 @@ tracks/8/keys = { | |||||||
| "update": 0, | "update": 0, | ||||||
| "values": [0.0, 0.0, 0.0872665, -0.0872665] | "values": [0.0, 0.0, 0.0872665, -0.0872665] | ||||||
| } | } | ||||||
| tracks/9/type = "value" | 
 | ||||||
| tracks/9/imported = false | [sub_resource type="Animation" id="Animation_cm2ua"] | ||||||
| tracks/9/enabled = true | length = 0.001 | ||||||
| tracks/9/path = NodePath("VerticalCenter/RadialGradient:modulate") | tracks/0/type = "value" | ||||||
| tracks/9/interp = 1 | tracks/0/imported = false | ||||||
| tracks/9/loop_wrap = true | tracks/0/enabled = true | ||||||
| tracks/9/keys = { | tracks/0/path = NodePath("VerticalCenter/GameLabelRoot:anchor_left") | ||||||
| "times": PackedFloat32Array(0, 0.6, 1.6, 2.2, 3.2), | tracks/0/interp = 1 | ||||||
| "transitions": PackedFloat32Array(1, 1.618, 1, 0.618, 1), | tracks/0/loop_wrap = true | ||||||
| "update": 0, | tracks/0/keys = { | ||||||
| "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)] | "times": PackedFloat32Array(0), | ||||||
| } |  | ||||||
| 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, 1.5] |  | ||||||
| } |  | ||||||
| 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, 1.5] |  | ||||||
| } |  | ||||||
| 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), | "transitions": PackedFloat32Array(1), | ||||||
| "values": [{ | "update": 0, | ||||||
| "args": [], | "values": [-0.5] | ||||||
| "method": &"queue_free" | } | ||||||
| }] | 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 = 1 | ||||||
|  | tracks/7/loop_wrap = true | ||||||
|  | tracks/7/keys = { | ||||||
|  | "times": PackedFloat32Array(0), | ||||||
|  | "transitions": PackedFloat32Array(1), | ||||||
|  | "update": 0, | ||||||
|  | "values": [0.0] | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [sub_resource type="AnimationLibrary" id="AnimationLibrary_x18w1"] | [sub_resource type="AnimationLibrary" id="AnimationLibrary_x18w1"] | ||||||
| @ -406,18 +297,6 @@ offset_bottom = 150.0 | |||||||
| grow_horizontal = 2 | grow_horizontal = 2 | ||||||
| grow_vertical = 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"] | [node name="LabelBack" type="Label" parent="VerticalCenter"] | ||||||
| texture_filter = 4 | texture_filter = 4 | ||||||
| layout_mode = 1 | layout_mode = 1 | ||||||
| @ -522,44 +401,6 @@ libraries = { | |||||||
| } | } | ||||||
| autoplay = "pan" | 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="."] | [node name="CaptionLabel" type="RichTextLabel" parent="."] | ||||||
| layout_mode = 1 | layout_mode = 1 | ||||||
| anchors_preset = -1 | anchors_preset = -1 | ||||||
| @ -592,4 +433,3 @@ autoplay = "play" | |||||||
| 
 | 
 | ||||||
| [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] | [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] | ||||||
| stream = ExtResource("4_5f42w") | stream = ExtResource("4_5f42w") | ||||||
| bus = &"SFX" |  | ||||||
|  | |||||||
| @ -1,11 +1,11 @@ | |||||||
| class_name WorldUI extends Control | class_name WorldUI extends Control | ||||||
| ## Container & accessor for the world UI. | ## Container & accessor for the world UI. | ||||||
| 
 | 
 | ||||||
|  | const DEATH_ALERT_SCENE := preload("res://src/ui/shot_hud/death_alert.tscn") | ||||||
|  | 
 | ||||||
| const DEMO_CAMERA_GROUP := "DemoCamera" | const DEMO_CAMERA_GROUP := "DemoCamera" | ||||||
| 
 | 
 | ||||||
| @export var pause_scene: PackedScene | @export var pause_scene := preload("res://src/ui/menus/pause_menu/pause_menu.tscn") | ||||||
| @export var death_alert_scene: PackedScene |  | ||||||
| @export var winner_alert_scene: PackedScene |  | ||||||
| 
 | 
 | ||||||
| var _prev_camera: Camera3D | var _prev_camera: Camera3D | ||||||
| var _pre_death_camera: Camera3D | var _pre_death_camera: Camera3D | ||||||
| @ -14,8 +14,6 @@ var _pre_death_camera: Camera3D | |||||||
| @onready var effect_container: Control = %EffectContainer | @onready var effect_container: Control = %EffectContainer | ||||||
| @onready var pause_container: Control = %PauseContainer | @onready var pause_container: Control = %PauseContainer | ||||||
| 
 | 
 | ||||||
| @onready var world: World = $".." |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| func _unhandled_key_input(event: InputEvent) -> void: | func _unhandled_key_input(event: InputEvent) -> void: | ||||||
| 	if event.is_action_pressed("pause"): | 	if event.is_action_pressed("pause"): | ||||||
| @ -30,7 +28,7 @@ func add_player_hud(hud: ShotHUD) -> void: | |||||||
| func play_death_sequence() -> void: | func play_death_sequence() -> void: | ||||||
| 	_pre_death_camera = get_viewport().get_camera_3d() | 	_pre_death_camera = get_viewport().get_camera_3d() | ||||||
| 	hud_container.hide() | 	hud_container.hide() | ||||||
| 	var alert := death_alert_scene.instantiate() | 	var alert := DEATH_ALERT_SCENE.instantiate() | ||||||
| 	alert.tree_exiting.connect(_finish_death_sequence) | 	alert.tree_exiting.connect(_finish_death_sequence) | ||||||
| 	effect_container.add_child(alert) | 	effect_container.add_child(alert) | ||||||
| 
 | 
 | ||||||
| @ -40,17 +38,6 @@ func _finish_death_sequence() -> void: | |||||||
| 	_pre_death_camera.make_current() | 	_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: | func pause() -> void: | ||||||
| 	# Switch to demo cam, if there is one. | 	# Switch to demo cam, if there is one. | ||||||
| 	var democams: Array[Node] = get_tree().get_nodes_in_group(DEMO_CAMERA_GROUP) | 	var democams: Array[Node] = get_tree().get_nodes_in_group(DEMO_CAMERA_GROUP) | ||||||
|  | |||||||
| @ -1,18 +1,10 @@ | |||||||
| class_name PlayManager extends Resource | class_name PlayManager extends Resource | ||||||
| ## Abstract base type for strategies to manage the flow of gameplay | ## 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 | ## Emitted at the start of each new turn | ||||||
| @warning_ignore("unused_signal") | @warning_ignore("unused_signal") | ||||||
| signal turn_started(player: WorldPlayer) | 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 | ## List of game player instances | ||||||
| @export var players: Array[WorldPlayer] = [] | @export var players: Array[WorldPlayer] = [] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,27 +0,0 @@ | |||||||
| 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,11 +3,6 @@ class_name RoundRobinManager extends PlayManager | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func on_initialization() -> void: | 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 | 	# Set first player as active | ||||||
| 	players[0].shot_setup.phase = ShotSetup.Phase.AIM | 	players[0].shot_setup.phase = ShotSetup.Phase.AIM | ||||||
| 
 | 
 | ||||||
| @ -25,11 +20,10 @@ func on_player_death(player: WorldPlayer) -> void: | |||||||
| 		on_turn_finished(player.shot_setup) | 		on_turn_finished(player.shot_setup) | ||||||
| 
 | 
 | ||||||
| 	players.erase(player) | 	players.erase(player) | ||||||
| 	player.deconstruct() |  | ||||||
| 	print("Player 0 phase: ", ShotSetup.Phase.keys()[players[0].shot_setup.phase]) | 	print("Player 0 phase: ", ShotSetup.Phase.keys()[players[0].shot_setup.phase]) | ||||||
| 	if len(players) == 1: | 	if len(players) == 1: | ||||||
| 		on_win_condition() | 		on_win_condition() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func on_win_condition() -> void: | func on_win_condition() -> void: | ||||||
| 	winner.emit(players[0]) | 	pass  # TODO | ||||||
|  | |||||||
| @ -4,8 +4,6 @@ class_name World extends Node | |||||||
| ## A world contains player(s) and the active level, manages player states, | ## A world contains player(s) and the active level, manages player states, | ||||||
| ## and transitions between active levels. | ## and transitions between active levels. | ||||||
| 
 | 
 | ||||||
| const SCENE := "res://src/world/world.tscn" |  | ||||||
| 
 |  | ||||||
| @export var initial_level: PackedScene | @export var initial_level: PackedScene | ||||||
| 
 | 
 | ||||||
| @export var manager: PlayManager | @export var manager: PlayManager | ||||||
| @ -17,21 +15,17 @@ var _spawns_available: Array[Node3D] = [] | |||||||
| @onready var level: Node3D = %Level | @onready var level: Node3D = %Level | ||||||
| @onready var ui: WorldUI = %UI | @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" | static var group := "WorldGroup" | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func _ready() -> void: | func _ready() -> void: | ||||||
| 	load_level(initial_level) | 	load_level(initial_level) | ||||||
| 
 | 
 | ||||||
| 	manager.spawning.connect(_spawn_player) | 	# Spawn players in the level | ||||||
| 	manager.winner.connect(_on_winner) | 	for player: WorldPlayer in manager.players: | ||||||
|  | 		_spawn_player(player) | ||||||
| 
 | 
 | ||||||
| 	manager.initialize() | 	manager.initialize() | ||||||
| 
 |  | ||||||
| 	if not manager.players: | 	if not manager.players: | ||||||
| 		push_warning("Warning: Starting game world with no players!") | 		push_warning("Warning: Starting game world with no players!") | ||||||
| 
 | 
 | ||||||
| @ -48,26 +42,10 @@ func _random_spawn() -> Node3D: | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| func _spawn_player(player: WorldPlayer) -> void: | func _spawn_player(player: WorldPlayer) -> void: | ||||||
| 	print_debug("Spawning player: ", player) |  | ||||||
| 	var spawn_point := _random_spawn() | 	var spawn_point := _random_spawn() | ||||||
| 	var shot_setup := player.shot_setup | 	var shot_setup := player.shot_setup | ||||||
| 	shot_setup.global_transform = spawn_point.global_transform | 	shot_setup.global_transform = spawn_point.global_transform | ||||||
| 	if not shot_setup.get_parent(): | 	spawn_point.add_sibling(shot_setup) | ||||||
| 		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. | ## Instantiate and mantle the given level scene. | ||||||
|  | |||||||
| @ -1,109 +1,19 @@ | |||||||
| [gd_scene load_steps=16 format=3 uid="uid://cwnwcd8kushl3"] | [gd_scene load_steps=8 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/world/world.gd" id="1_ybjyx"] | ||||||
| [ext_resource type="Script" path="res://src/player/world_player.gd" id="2_e743i"] | [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="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://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="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"] | [sub_resource type="Resource" id="Resource_rdjhi"] | ||||||
| script = ExtResource("5_h6mje") | script = ExtResource("5_h6mje") | ||||||
| players = Array[ExtResource("2_e743i")]([ExtResource("3_pyw81"), SubResource("Resource_mbhdy")]) | players = Array[ExtResource("2_e743i")]([ExtResource("3_pyw81")]) | ||||||
| 
 |  | ||||||
| [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"]] | [node name="World" type="Node" groups=["WorldGroup"]] | ||||||
| script = ExtResource("1_ybjyx") | script = ExtResource("1_ybjyx") | ||||||
| initial_level = ExtResource("2_hn84b") | initial_level = ExtResource("2_w576d") | ||||||
| manager = SubResource("Resource_rdjhi") | manager = SubResource("Resource_rdjhi") | ||||||
| 
 | 
 | ||||||
| [node name="Level" type="Node3D" parent="."] | [node name="Level" type="Node3D" parent="."] | ||||||
| @ -119,9 +29,6 @@ grow_horizontal = 2 | |||||||
| grow_vertical = 2 | grow_vertical = 2 | ||||||
| mouse_filter = 1 | mouse_filter = 1 | ||||||
| script = ExtResource("2_imewa") | 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"] | [node name="HUDContainer" type="Control" parent="UI"] | ||||||
| unique_name_in_owner = true | unique_name_in_owner = true | ||||||
| @ -152,21 +59,3 @@ anchor_bottom = 1.0 | |||||||
| grow_horizontal = 2 | grow_horizontal = 2 | ||||||
| grow_vertical = 2 | grow_vertical = 2 | ||||||
| mouse_filter = 1 | 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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user