From 73bd40c6acd2674dc499cf74158d9f83301f8e37 Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Sat, 14 Dec 2024 19:03:27 -0700 Subject: [PATCH] Beach ball pickup item --- levels/debug_level/debug_level.tscn | 11 +- .../balls/beach_ball/beach_ball.tscn | 4 +- src/items/extra_ball/beach_ball_item.tscn | 124 ++++++++++++++++++ .../shot_hud/ball_selector/ball_selector.tscn | 2 +- 4 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 src/items/extra_ball/beach_ball_item.tscn diff --git a/levels/debug_level/debug_level.tscn b/levels/debug_level/debug_level.tscn index 2e87e91..0f68494 100644 --- a/levels/debug_level/debug_level.tscn +++ b/levels/debug_level/debug_level.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=66 format=3 uid="uid://bm2o3mex10v11"] +[gd_scene load_steps=67 format=3 uid="uid://bm2o3mex10v11"] [ext_resource type="Terrain3DAssets" uid="uid://cwl34gstabgrx" path="res://levels/debug_level/terrain_assets.res" id="1_5smdk"] [ext_resource type="Shader" path="res://src/shaders/psx_water.gdshader" id="6_0efu4"] [ext_resource type="Texture2D" uid="uid://c47ern0l2d50r" path="res://assets/vista_2.png" id="6_ectru"] [ext_resource type="Texture2D" uid="uid://con5a36t6n6sq" path="res://assets/textures/clear_sea_water_2048x2048.png" id="7_t86h2"] +[ext_resource type="PackedScene" uid="uid://cupmlp44bsfrj" path="res://src/items/extra_ball/beach_ball_item.tscn" id="8_3jmdx"] [ext_resource type="Script" path="res://src/items/item_spawner.gd" id="8_5kaye"] [ext_resource type="Script" path="res://src/world/ball_zone/ball_zone.gd" id="9_jwlau"] [ext_resource type="PackedScene" uid="uid://dagh38vap4t1d" path="res://src/props/scenery/city/concrete_building_1.tscn" id="10_lf15j"] @@ -362,6 +363,14 @@ shape = SubResource("BoxShape3D_x3wvm") [node name="Sailboat" parent="Course/WaterTable" instance=ExtResource("14_6reiy")] transform = Transform3D(-0.74629, 0, -0.665621, 0, 1, 0, 0.665621, 0, -0.74629, 381.024, -0.5, 224.968) +[node name="ItemSpawner" type="Marker3D" parent="Course/WaterTable/Sailboat"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 5.3) +script = ExtResource("8_5kaye") +item = ExtResource("8_3jmdx") +amount = -1 +spawn_on_ready = true +spawn_turns = 1 + [node name="Flag" parent="Course" instance=ExtResource("13_6jtao")] transform = Transform3D(-0.777146, 0, -0.629321, 0, 1, 0, 0.629321, 0, -0.777146, 540, 4, 452) diff --git a/src/equipment/balls/beach_ball/beach_ball.tscn b/src/equipment/balls/beach_ball/beach_ball.tscn index f8bbe53..bdfc551 100644 --- a/src/equipment/balls/beach_ball/beach_ball.tscn +++ b/src/equipment/balls/beach_ball/beach_ball.tscn @@ -9,7 +9,7 @@ friction = 0.7 bounce = 0.67 -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xh2u0"] +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x6y4w"] albedo_texture = ExtResource("2_6dwmi") normal_enabled = true normal_scale = 0.5 @@ -17,7 +17,7 @@ normal_texture = ExtResource("3_rdlj8") texture_filter = 4 [sub_resource type="SphereMesh" id="SphereMesh_iqcc5"] -material = SubResource("StandardMaterial3D_xh2u0") +material = SubResource("StandardMaterial3D_x6y4w") radial_segments = 6 rings = 6 diff --git a/src/items/extra_ball/beach_ball_item.tscn b/src/items/extra_ball/beach_ball_item.tscn new file mode 100644 index 0000000..b637fc0 --- /dev/null +++ b/src/items/extra_ball/beach_ball_item.tscn @@ -0,0 +1,124 @@ +[gd_scene load_steps=10 format=3 uid="uid://cupmlp44bsfrj"] + +[ext_resource type="PackedScene" uid="uid://comd88yp45mnb" path="res://src/items/item/item.tscn" id="1_qk4an"] +[ext_resource type="Script" path="res://src/items/extra_ball/extra_ball.gd" id="2_c3h7j"] +[ext_resource type="Texture2D" uid="uid://daipuukf6e6bc" path="res://assets/textures/beach_ball/beach_ball.png" id="3_6ohug"] +[ext_resource type="Texture2D" uid="uid://3oatrxh60ed7" path="res://assets/textures/beach_ball/beach_ball_normal_map.png" id="4_b7lx7"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xh2u0"] +albedo_texture = ExtResource("3_6ohug") +normal_enabled = true +normal_scale = 0.5 +normal_texture = ExtResource("4_b7lx7") +texture_filter = 4 + +[sub_resource type="SphereMesh" id="SphereMesh_rleou"] +material = SubResource("StandardMaterial3D_xh2u0") +radial_segments = 6 +rings = 6 + +[sub_resource type="Animation" id="Animation_jhb3c"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("ItemMeshContainer:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0, -0.2, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Octahedron:rotation") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0, 0, 0)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("ItemMeshContainer:rotation") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0, 0, 0)] +} + +[sub_resource type="Animation" id="Animation_283tf"] +resource_name = "hover" +length = 24.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("ItemMeshContainer:position") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 6, 12, 18), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Vector3(0, -0.05, 0), Vector3(0, 0.05, 0), Vector3(0, -0.05, 0), Vector3(0, 0.05, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Octahedron:rotation") +tracks/1/interp = 1 +tracks/1/loop_wrap = false +tracks/1/keys = { +"times": PackedFloat32Array(0, 24), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector3(0, 0, 0), Vector3(0, 6.28319, -6.28319)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("ItemMeshContainer:rotation") +tracks/2/interp = 1 +tracks/2/loop_wrap = false +tracks/2/keys = { +"times": PackedFloat32Array(0, 24), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector3(0, 0, 0), Vector3(0, -6.28319, 0)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_jwejx"] +_data = { +"RESET": SubResource("Animation_jhb3c"), +"idle": SubResource("Animation_283tf") +} + +[node name="BeachBallItem" instance=ExtResource("1_qk4an")] +script = ExtResource("2_c3h7j") +ball_type = 4 +amount = 0 + +[node name="Pivot" parent="Pivot/Octahedron/ItemMeshContainer" index="0"] +transform = Transform3D(0.99863, 0.052336, 0, -0.052336, 0.99863, 0, 0, 0, 1, 0, 0, 0) + +[node name="BallMesh" type="MeshInstance3D" parent="Pivot/Octahedron/ItemMeshContainer/Pivot" index="1"] +transform = Transform3D(1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0, 0) +mesh = SubResource("SphereMesh_rleou") + +[node name="@AnimationPlayer@183827" type="AnimationPlayer" parent="Pivot/Octahedron" index="2"] +libraries = { +"": SubResource("AnimationLibrary_jwejx") +} +autoplay = "idle" + +[editable path="Pivot/Octahedron"] diff --git a/src/ui/shot_hud/ball_selector/ball_selector.tscn b/src/ui/shot_hud/ball_selector/ball_selector.tscn index 172a03e..41aa36d 100644 --- a/src/ui/shot_hud/ball_selector/ball_selector.tscn +++ b/src/ui/shot_hud/ball_selector/ball_selector.tscn @@ -46,7 +46,7 @@ custom_minimum_size = Vector2(120, 0) layout_mode = 0 offset_top = 50.0 offset_right = 120.0 -offset_bottom = 141.0 +offset_bottom = 173.0 theme_override_constants/separation = 5 [node name="BasicIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")]