From 5cfb1fce96e44be2908e3557d765e3b33afca864 Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Sun, 17 Nov 2024 14:07:28 -0700 Subject: [PATCH] Reorganized player, camera, ball --- .../balls}/physics_ball/game_ball.gd | 10 ++++++---- .../balls}/physics_ball/iron_physics.tres | 0 .../balls}/physics_ball/normal_physics.tres | 0 .../balls}/physics_ball/physics_ball.tscn | 4 ++-- src/player/shot_setup/shot_setup.tscn | 8 ++++---- src/player/world_player/world_player.gd | 2 ++ src/player/world_player/world_player.tscn | 6 ++++++ src/ui/{ => 3d}/arrow/arrow.gd | 4 ++-- src/ui/{ => 3d}/arrow/arrow.tscn | 2 +- src/ui/{ => 3d}/projected_target.tscn | 0 src/ui/{ => 3d}/projectile_arc/projectile_arc.gd | 0 src/ui/{ => 3d}/projectile_arc/projectile_arc.tscn | 2 +- src/{player => ui/camera}/free_camera/free_camera.gd | 2 +- src/{player => ui/camera}/free_camera/free_camera.tscn | 2 +- .../camera}/orbital_camera/orbital_camera.gd | 2 +- .../camera}/orbital_camera/orbital_camera.tscn | 2 +- .../camera}/tracking_camera/tracking_camera.gd | 0 .../camera}/tracking_camera/tracking_camera.tscn | 2 +- src/ui/{ => decorations}/double_rotator.gd | 0 .../shot_hud}/club_selector/club_selector.gd | 0 .../shot_hud}/club_selector/club_selector.tscn | 4 ++-- src/ui/shot_hud/shot_hud.tscn | 2 +- 22 files changed, 32 insertions(+), 22 deletions(-) rename src/{player => equipment/balls}/physics_ball/game_ball.gd (85%) rename src/{player => equipment/balls}/physics_ball/iron_physics.tres (100%) rename src/{player => equipment/balls}/physics_ball/normal_physics.tres (100%) rename src/{player => equipment/balls}/physics_ball/physics_ball.tscn (89%) create mode 100644 src/player/world_player/world_player.gd create mode 100644 src/player/world_player/world_player.tscn rename src/ui/{ => 3d}/arrow/arrow.gd (100%) rename src/ui/{ => 3d}/arrow/arrow.tscn (97%) rename src/ui/{ => 3d}/projected_target.tscn (100%) rename src/ui/{ => 3d}/projectile_arc/projectile_arc.gd (100%) rename src/ui/{ => 3d}/projectile_arc/projectile_arc.tscn (95%) rename src/{player => ui/camera}/free_camera/free_camera.gd (96%) rename src/{player => ui/camera}/free_camera/free_camera.tscn (81%) rename src/{player => ui/camera}/orbital_camera/orbital_camera.gd (88%) rename src/{player => ui/camera}/orbital_camera/orbital_camera.tscn (81%) rename src/{player => ui/camera}/tracking_camera/tracking_camera.gd (100%) rename src/{player => ui/camera}/tracking_camera/tracking_camera.tscn (57%) rename src/ui/{ => decorations}/double_rotator.gd (100%) rename src/{player/shot_setup => ui/shot_hud}/club_selector/club_selector.gd (100%) rename src/{player/shot_setup => ui/shot_hud}/club_selector/club_selector.tscn (95%) diff --git a/src/player/physics_ball/game_ball.gd b/src/equipment/balls/physics_ball/game_ball.gd similarity index 85% rename from src/player/physics_ball/game_ball.gd rename to src/equipment/balls/physics_ball/game_ball.gd index 05a5c41..f077778 100644 --- a/src/player/physics_ball/game_ball.gd +++ b/src/equipment/balls/physics_ball/game_ball.gd @@ -24,10 +24,12 @@ const IRON_DAMPING := 9999.0 var _zones: Array[BallZone] = [] -@onready -var normal_physics: PhysicsMaterial = preload("res://src/player/physics_ball/normal_physics.tres") -@onready -var iron_physics: PhysicsMaterial = preload("res://src/player/physics_ball/iron_physics.tres") +@onready var normal_physics: PhysicsMaterial = preload( + "res://src/equipment/balls/physics_ball/normal_physics.tres" +) +@onready var iron_physics: PhysicsMaterial = preload( + "res://src/equipment/balls/physics_ball/iron_physics.tres" +) ## Called by a water area when this ball enters it diff --git a/src/player/physics_ball/iron_physics.tres b/src/equipment/balls/physics_ball/iron_physics.tres similarity index 100% rename from src/player/physics_ball/iron_physics.tres rename to src/equipment/balls/physics_ball/iron_physics.tres diff --git a/src/player/physics_ball/normal_physics.tres b/src/equipment/balls/physics_ball/normal_physics.tres similarity index 100% rename from src/player/physics_ball/normal_physics.tres rename to src/equipment/balls/physics_ball/normal_physics.tres diff --git a/src/player/physics_ball/physics_ball.tscn b/src/equipment/balls/physics_ball/physics_ball.tscn similarity index 89% rename from src/player/physics_ball/physics_ball.tscn rename to src/equipment/balls/physics_ball/physics_ball.tscn index 186fe3a..f026442 100644 --- a/src/player/physics_ball/physics_ball.tscn +++ b/src/equipment/balls/physics_ball/physics_ball.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=8 format=3 uid="uid://dfttci386ohip"] -[ext_resource type="Script" path="res://src/player/physics_ball/game_ball.gd" id="1_iwh2u"] -[ext_resource type="PhysicsMaterial" uid="uid://3bih72l068ic" path="res://src/player/physics_ball/normal_physics.tres" id="1_l23pw"] +[ext_resource type="Script" path="res://src/equipment/balls/physics_ball/game_ball.gd" id="1_iwh2u"] +[ext_resource type="PhysicsMaterial" uid="uid://3bih72l068ic" path="res://src/equipment/balls/physics_ball/normal_physics.tres" id="1_l23pw"] [ext_resource type="Texture2D" uid="uid://ckhiq6rfjv63u" path="res://assets/textures/gfolfball/gfolfball.png" id="1_y3q5j"] [ext_resource type="Texture2D" uid="uid://btntjs7mbdigu" path="res://assets/textures/gfolfball/gfolfball_normal.png" id="2_mx7l6"] diff --git a/src/player/shot_setup/shot_setup.tscn b/src/player/shot_setup/shot_setup.tscn index 3cc14d0..7503bb3 100644 --- a/src/player/shot_setup/shot_setup.tscn +++ b/src/player/shot_setup/shot_setup.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=17 format=3 uid="uid://cy7t2tc4y3b4"] [ext_resource type="Script" path="res://src/player/shot_setup/shot_setup.gd" id="1_r6ei4"] -[ext_resource type="PackedScene" uid="uid://dfttci386ohip" path="res://src/player/physics_ball/physics_ball.tscn" id="2_1i5j5"] -[ext_resource type="PackedScene" uid="uid://c2k88ns0h5ie1" path="res://src/ui/arrow/arrow.tscn" id="2_s70wl"] +[ext_resource type="PackedScene" uid="uid://dfttci386ohip" path="res://src/equipment/balls/physics_ball/physics_ball.tscn" id="2_1i5j5"] +[ext_resource type="PackedScene" uid="uid://c2k88ns0h5ie1" path="res://src/ui/3d/arrow/arrow.tscn" id="2_s70wl"] [ext_resource type="PackedScene" uid="uid://1s3gywmoi20e" path="res://src/characters/player_characters/gfolf_girl/gfolf_girl.tscn" id="3_e4aur"] -[ext_resource type="PackedScene" uid="uid://fht6j87o8ecr" path="res://src/ui/projectile_arc/projectile_arc.tscn" id="4_ry2ho"] -[ext_resource type="PackedScene" uid="uid://dbdul15c4oblg" path="res://src/ui/projected_target.tscn" id="6_mynqj"] +[ext_resource type="PackedScene" uid="uid://fht6j87o8ecr" path="res://src/ui/3d/projectile_arc/projectile_arc.tscn" id="4_ry2ho"] +[ext_resource type="PackedScene" uid="uid://dbdul15c4oblg" path="res://src/ui/3d/projected_target.tscn" id="6_mynqj"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lnol1"] albedo_color = Color(0, 0.537255, 1, 1) diff --git a/src/player/world_player/world_player.gd b/src/player/world_player/world_player.gd new file mode 100644 index 0000000..e47c4c1 --- /dev/null +++ b/src/player/world_player/world_player.gd @@ -0,0 +1,2 @@ +class_name WorldPlayer extends Node +## Container for the state of the player within the world. diff --git a/src/player/world_player/world_player.tscn b/src/player/world_player/world_player.tscn new file mode 100644 index 0000000..5d07b98 --- /dev/null +++ b/src/player/world_player/world_player.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://q8vdqfewwvsy"] + +[ext_resource type="Script" path="res://src/player/world_player/world_player.gd" id="1_2wo11"] + +[node name="WorldPlayer" type="Node"] +script = ExtResource("1_2wo11") diff --git a/src/ui/arrow/arrow.gd b/src/ui/3d/arrow/arrow.gd similarity index 100% rename from src/ui/arrow/arrow.gd rename to src/ui/3d/arrow/arrow.gd index 5bb809f..4a077cc 100644 --- a/src/ui/arrow/arrow.gd +++ b/src/ui/3d/arrow/arrow.gd @@ -1,14 +1,14 @@ @tool extends Node3D -const COLOR_PARAMETER := "albedo" - enum Loop { RESET, BOB_TIP, BOB_TAIL, } +const COLOR_PARAMETER := "albedo" + @export var loop_animation: Loop: set(value): if is_instance_valid(animation_player): diff --git a/src/ui/arrow/arrow.tscn b/src/ui/3d/arrow/arrow.tscn similarity index 97% rename from src/ui/arrow/arrow.tscn rename to src/ui/3d/arrow/arrow.tscn index e3cc4fc..2f31381 100644 --- a/src/ui/arrow/arrow.tscn +++ b/src/ui/3d/arrow/arrow.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=9 format=3 uid="uid://c2k88ns0h5ie1"] [ext_resource type="PackedScene" uid="uid://bw54bi35myvpg" path="res://assets/models/ui/arrow/arrow.glb" id="1_xifl6"] -[ext_resource type="Script" path="res://src/ui/arrow/arrow.gd" id="2_0viam"] +[ext_resource type="Script" path="res://src/ui/3d/arrow/arrow.gd" id="2_0viam"] [ext_resource type="Material" uid="uid://d3ka0yjhxu5ks" path="res://assets/materials/gummy_material.tres" id="3_g7vwe"] [sub_resource type="Animation" id="Animation_hsqkd"] diff --git a/src/ui/projected_target.tscn b/src/ui/3d/projected_target.tscn similarity index 100% rename from src/ui/projected_target.tscn rename to src/ui/3d/projected_target.tscn diff --git a/src/ui/projectile_arc/projectile_arc.gd b/src/ui/3d/projectile_arc/projectile_arc.gd similarity index 100% rename from src/ui/projectile_arc/projectile_arc.gd rename to src/ui/3d/projectile_arc/projectile_arc.gd diff --git a/src/ui/projectile_arc/projectile_arc.tscn b/src/ui/3d/projectile_arc/projectile_arc.tscn similarity index 95% rename from src/ui/projectile_arc/projectile_arc.tscn rename to src/ui/3d/projectile_arc/projectile_arc.tscn index 0821265..9f2313b 100644 --- a/src/ui/projectile_arc/projectile_arc.tscn +++ b/src/ui/3d/projectile_arc/projectile_arc.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=9 format=3 uid="uid://fht6j87o8ecr"] -[ext_resource type="Script" path="res://src/ui/projectile_arc/projectile_arc.gd" id="1_vafqi"] +[ext_resource type="Script" path="res://src/ui/3d/projectile_arc/projectile_arc.gd" id="1_vafqi"] [ext_resource type="Shader" path="res://src/shaders/plasma.gdshader" id="2_pi36v"] [sub_resource type="Curve3D" id="Curve3D_rfv3d"] diff --git a/src/player/free_camera/free_camera.gd b/src/ui/camera/free_camera/free_camera.gd similarity index 96% rename from src/player/free_camera/free_camera.gd rename to src/ui/camera/free_camera/free_camera.gd index 2668aec..7bebf54 100644 --- a/src/player/free_camera/free_camera.gd +++ b/src/ui/camera/free_camera/free_camera.gd @@ -22,7 +22,7 @@ var invert_pitch: bool = ProjectSettings.get_setting("game/config/controls/camer @onready var _target := Vector2(rotation.x, rotation.y) -static var scene := preload("res://src/player/free_camera/free_camera.tscn") +static var scene := preload("res://src/ui/camera/free_camera/free_camera.tscn") func _unhandled_input(event: InputEvent) -> void: diff --git a/src/player/free_camera/free_camera.tscn b/src/ui/camera/free_camera/free_camera.tscn similarity index 81% rename from src/player/free_camera/free_camera.tscn rename to src/ui/camera/free_camera/free_camera.tscn index a535270..449997c 100644 --- a/src/player/free_camera/free_camera.tscn +++ b/src/ui/camera/free_camera/free_camera.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://dd17ce110sw6p"] -[ext_resource type="Script" path="res://src/player/free_camera/free_camera.gd" id="1_3gm3q"] +[ext_resource type="Script" path="res://src/ui/camera/free_camera/free_camera.gd" id="1_3gm3q"] [sub_resource type="SphereShape3D" id="SphereShape3D_wmusx"] diff --git a/src/player/orbital_camera/orbital_camera.gd b/src/ui/camera/orbital_camera/orbital_camera.gd similarity index 88% rename from src/player/orbital_camera/orbital_camera.gd rename to src/ui/camera/orbital_camera/orbital_camera.gd index ec99e32..c5758f7 100644 --- a/src/player/orbital_camera/orbital_camera.gd +++ b/src/ui/camera/orbital_camera/orbital_camera.gd @@ -9,7 +9,7 @@ const POSITION_ACCELERATION := 4.0 @onready var camera: Camera3D = %Camera -static var scene := preload("res://src/player/orbital_camera/orbital_camera.tscn") +static var scene := preload("res://src/ui/camera/orbital_camera/orbital_camera.tscn") func _physics_process(delta: float) -> void: diff --git a/src/player/orbital_camera/orbital_camera.tscn b/src/ui/camera/orbital_camera/orbital_camera.tscn similarity index 81% rename from src/player/orbital_camera/orbital_camera.tscn rename to src/ui/camera/orbital_camera/orbital_camera.tscn index e4d033c..95d784c 100644 --- a/src/player/orbital_camera/orbital_camera.tscn +++ b/src/ui/camera/orbital_camera/orbital_camera.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://de5onfk2tyr1d"] -[ext_resource type="Script" path="res://src/player/orbital_camera/orbital_camera.gd" id="1_nvlic"] +[ext_resource type="Script" path="res://src/ui/camera/orbital_camera/orbital_camera.gd" id="1_nvlic"] [node name="OrbitalCamera" type="Node3D"] script = ExtResource("1_nvlic") diff --git a/src/player/tracking_camera/tracking_camera.gd b/src/ui/camera/tracking_camera/tracking_camera.gd similarity index 100% rename from src/player/tracking_camera/tracking_camera.gd rename to src/ui/camera/tracking_camera/tracking_camera.gd diff --git a/src/player/tracking_camera/tracking_camera.tscn b/src/ui/camera/tracking_camera/tracking_camera.tscn similarity index 57% rename from src/player/tracking_camera/tracking_camera.tscn rename to src/ui/camera/tracking_camera/tracking_camera.tscn index 621d323..0c523b3 100644 --- a/src/player/tracking_camera/tracking_camera.tscn +++ b/src/ui/camera/tracking_camera/tracking_camera.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://ceu57tasi270s"] -[ext_resource type="Script" path="res://src/player/tracking_camera/tracking_camera.gd" id="1_352mq"] +[ext_resource type="Script" path="res://src/ui/camera/tracking_camera/tracking_camera.gd" id="1_352mq"] [node name="TrackingCamera" type="Camera3D"] script = ExtResource("1_352mq") diff --git a/src/ui/double_rotator.gd b/src/ui/decorations/double_rotator.gd similarity index 100% rename from src/ui/double_rotator.gd rename to src/ui/decorations/double_rotator.gd diff --git a/src/player/shot_setup/club_selector/club_selector.gd b/src/ui/shot_hud/club_selector/club_selector.gd similarity index 100% rename from src/player/shot_setup/club_selector/club_selector.gd rename to src/ui/shot_hud/club_selector/club_selector.gd diff --git a/src/player/shot_setup/club_selector/club_selector.tscn b/src/ui/shot_hud/club_selector/club_selector.tscn similarity index 95% rename from src/player/shot_setup/club_selector/club_selector.tscn rename to src/ui/shot_hud/club_selector/club_selector.tscn index d2b1140..0701b26 100644 --- a/src/player/shot_setup/club_selector/club_selector.tscn +++ b/src/ui/shot_hud/club_selector/club_selector.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=7 format=3 uid="uid://445qd7m4qe2j"] -[ext_resource type="Script" path="res://src/player/shot_setup/club_selector/club_selector.gd" id="1_cttgc"] +[ext_resource type="Script" path="res://src/ui/shot_hud/club_selector/club_selector.gd" id="1_cttgc"] [ext_resource type="Script" path="res://src/ui/decorations/arc.gd" id="2_vijl7"] -[ext_resource type="Script" path="res://src/ui/double_rotator.gd" id="3_0ptmq"] +[ext_resource type="Script" path="res://src/ui/decorations/double_rotator.gd" id="3_0ptmq"] [sub_resource type="Animation" id="Animation_crn6i"] length = 0.001 diff --git a/src/ui/shot_hud/shot_hud.tscn b/src/ui/shot_hud/shot_hud.tscn index ee2d902..977921a 100644 --- a/src/ui/shot_hud/shot_hud.tscn +++ b/src/ui/shot_hud/shot_hud.tscn @@ -2,7 +2,7 @@ [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/player/shot_setup/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"] [sub_resource type="Animation" id="Animation_3xds6"] resource_name = "RESET"