diff --git a/asset_dev/balls/beach_ball.blend b/asset_dev/balls/beach_ball.blend new file mode 100644 index 0000000..a6de633 --- /dev/null +++ b/asset_dev/balls/beach_ball.blend @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4aa380847dabad03eb400ff60ea3fbe2e900b5091eae5f008b6502baae10e890 +size 942816 diff --git a/asset_dev/balls/beach_ball.blend1 b/asset_dev/balls/beach_ball.blend1 new file mode 100644 index 0000000..8a2a4c3 Binary files /dev/null and b/asset_dev/balls/beach_ball.blend1 differ diff --git a/asset_dev/balls/beach_ball.png b/asset_dev/balls/beach_ball.png new file mode 100644 index 0000000..34b7aba --- /dev/null +++ b/asset_dev/balls/beach_ball.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62cc225b24f2ddecb2363ff31f4cabf9caecb5b76afcaa6942928ac8372040aa +size 4398 diff --git a/asset_dev/balls/beach_ball.xcf b/asset_dev/balls/beach_ball.xcf new file mode 100644 index 0000000..2675f12 Binary files /dev/null and b/asset_dev/balls/beach_ball.xcf differ diff --git a/asset_dev/balls/beach_ball_normal_map.png b/asset_dev/balls/beach_ball_normal_map.png new file mode 100644 index 0000000..6435f66 --- /dev/null +++ b/asset_dev/balls/beach_ball_normal_map.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85f8f37dd5cd0d7c4199135dba998b9651af84675de87e86c8e701eb2fb10716 +size 4367 diff --git a/asset_dev/soda/soda.blend b/asset_dev/soda/soda.blend index c0d4a07..75ebee3 100644 --- a/asset_dev/soda/soda.blend +++ b/asset_dev/soda/soda.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:38612113a074a86d86ffc05f586617c78a66fa693e5d8065dc165d58a2b8c41b -size 917260 +oid sha256:145525db057e72a388192a32dbd3accda9ec5b51bce95edbebb1935257560ae1 +size 917596 diff --git a/asset_dev/soda/soda.blend1 b/asset_dev/soda/soda.blend1 index c7bc65b..40408e1 100644 Binary files a/asset_dev/soda/soda.blend1 and b/asset_dev/soda/soda.blend1 differ diff --git a/assets/text/text.csv b/assets/text/text.csv index cf5e8e0..4846f1d 100644 --- a/assets/text/text.csv +++ b/assets/text/text.csv @@ -104,3 +104,4 @@ CLUB_PUTTER,Putter BALL_BASIC,Basic BALL_PLASMA,Plasma BALL_BRICK,Brick +BALL_BEACH,"Beach Ball" diff --git a/assets/textures/beach_ball/beach_ball.png b/assets/textures/beach_ball/beach_ball.png new file mode 100644 index 0000000..34b7aba --- /dev/null +++ b/assets/textures/beach_ball/beach_ball.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62cc225b24f2ddecb2363ff31f4cabf9caecb5b76afcaa6942928ac8372040aa +size 4398 diff --git a/assets/textures/beach_ball/beach_ball.png.import b/assets/textures/beach_ball/beach_ball.png.import new file mode 100644 index 0000000..581ed3b --- /dev/null +++ b/assets/textures/beach_ball/beach_ball.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://daipuukf6e6bc" +path="res://.godot/imported/beach_ball.png-103709b22c99e920077c858fb92c2e27.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/textures/beach_ball/beach_ball.png" +dest_files=["res://.godot/imported/beach_ball.png-103709b22c99e920077c858fb92c2e27.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=true +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=0 diff --git a/assets/textures/beach_ball/beach_ball_normal_map.png b/assets/textures/beach_ball/beach_ball_normal_map.png new file mode 100644 index 0000000..6435f66 --- /dev/null +++ b/assets/textures/beach_ball/beach_ball_normal_map.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85f8f37dd5cd0d7c4199135dba998b9651af84675de87e86c8e701eb2fb10716 +size 4367 diff --git a/assets/textures/beach_ball/beach_ball_normal_map.png.import b/assets/textures/beach_ball/beach_ball_normal_map.png.import new file mode 100644 index 0000000..74813be --- /dev/null +++ b/assets/textures/beach_ball/beach_ball_normal_map.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://3oatrxh60ed7" +path.s3tc="res://.godot/imported/beach_ball_normal_map.png-06c8d20483d619e155834bb8abd74c2f.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/textures/beach_ball/beach_ball_normal_map.png" +dest_files=["res://.godot/imported/beach_ball_normal_map.png-06c8d20483d619e155834bb8abd74c2f.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=1 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="res://assets/models/balls/beach_ball/beach_ball_normal_map.png" +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=0 diff --git a/levels/debug_level/debug_level.tscn b/levels/debug_level/debug_level.tscn index 332a85f..2e87e91 100644 --- a/levels/debug_level/debug_level.tscn +++ b/levels/debug_level/debug_level.tscn @@ -351,6 +351,14 @@ water_hazard = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.2, 0) shape = SubResource("BoxShape3D_x3wvm") +[node name="StaticBody3D" type="StaticBody3D" parent="Course/WaterTable"] +collision_layer = 2 +collision_mask = 2 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Course/WaterTable/StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.2, 0) +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) diff --git a/src/equipment/balls/beach_ball/beach_ball.gd b/src/equipment/balls/beach_ball/beach_ball.gd new file mode 100644 index 0000000..0874c72 --- /dev/null +++ b/src/equipment/balls/beach_ball/beach_ball.gd @@ -0,0 +1,5 @@ +extends GameBall + + +func enter_zone(zone: BallZone) -> void: + _zones.push_back(zone) diff --git a/src/equipment/balls/beach_ball/beach_ball.tscn b/src/equipment/balls/beach_ball/beach_ball.tscn new file mode 100644 index 0000000..f8bbe53 --- /dev/null +++ b/src/equipment/balls/beach_ball/beach_ball.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=9 format=3 uid="uid://bptiryfbnautm"] + +[ext_resource type="PackedScene" uid="uid://dfttci386ohip" path="res://src/equipment/balls/physics_ball/physics_ball.tscn" id="1_pl6e6"] +[ext_resource type="Texture2D" uid="uid://daipuukf6e6bc" path="res://assets/textures/beach_ball/beach_ball.png" id="2_6dwmi"] +[ext_resource type="Script" path="res://src/equipment/balls/beach_ball/beach_ball.gd" id="2_ay78j"] +[ext_resource type="Texture2D" uid="uid://3oatrxh60ed7" path="res://assets/textures/beach_ball/beach_ball_normal_map.png" id="3_rdlj8"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_867vn"] +friction = 0.7 +bounce = 0.67 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xh2u0"] +albedo_texture = ExtResource("2_6dwmi") +normal_enabled = true +normal_scale = 0.5 +normal_texture = ExtResource("3_rdlj8") +texture_filter = 4 + +[sub_resource type="SphereMesh" id="SphereMesh_iqcc5"] +material = SubResource("StandardMaterial3D_xh2u0") +radial_segments = 6 +rings = 6 + +[sub_resource type="SphereShape3D" id="SphereShape3D_cvsx2"] + +[node name="BeachBall" instance=ExtResource("1_pl6e6")] +collision_mask = 3 +mass = 0.1 +physics_material_override = SubResource("PhysicsMaterial_867vn") +linear_damp = 0.1 +script = ExtResource("2_ay78j") +radius = 0.1 + +[node name="BallMesh" parent="." index="0"] +mesh = SubResource("SphereMesh_iqcc5") + +[node name="CollisionShape3D" parent="." index="1"] +shape = SubResource("SphereShape3D_cvsx2") diff --git a/src/equipment/balls/physics_ball/game_ball.gd b/src/equipment/balls/physics_ball/game_ball.gd index bf48fd0..65c5dd3 100644 --- a/src/equipment/balls/physics_ball/game_ball.gd +++ b/src/equipment/balls/physics_ball/game_ball.gd @@ -10,6 +10,7 @@ enum Type { BASIC, PLASMA, BRICK, + BEACH, } const TERRAIN_DAMPING_EPSILON := 1e-6 diff --git a/src/player/debug_player.tres b/src/player/debug_player.tres index f9d78b8..3c17dc1 100644 --- a/src/player/debug_player.tres +++ b/src/player/debug_player.tres @@ -18,5 +18,6 @@ putter = ExtResource("3_tytwr") _balls = { 1: -1, 2: 5, -3: -1 +3: -1, +4: -1 } diff --git a/src/player/shot_setup/ball_point.gd b/src/player/shot_setup/ball_point.gd index 67cea7c..ecc88c3 100644 --- a/src/player/shot_setup/ball_point.gd +++ b/src/player/shot_setup/ball_point.gd @@ -9,6 +9,7 @@ const SCENE_MAP: Dictionary = { GameBall.Type.BASIC: preload("res://src/equipment/balls/physics_ball/physics_ball.tscn"), GameBall.Type.PLASMA: preload("res://src/equipment/balls/plasma_ball/plasma_ball.tscn"), GameBall.Type.BRICK: preload("res://src/equipment/balls/brick/brick.tscn"), + GameBall.Type.BEACH: preload("res://src/equipment/balls/beach_ball/beach_ball.tscn"), } @export var ball: GameBall: diff --git a/src/player/shot_setup/shot_setup.gd b/src/player/shot_setup/shot_setup.gd index 30ec3ac..90549ad 100644 --- a/src/player/shot_setup/shot_setup.gd +++ b/src/player/shot_setup/shot_setup.gd @@ -319,6 +319,7 @@ func _show_shot_projection() -> void: tween.tween_property(shot_projection, "initial_speed", shot_speed, CAMERA_SNAP_TIME).set_trans( Tween.TRANS_QUAD ) + shot_projection.linear_damp = game_ball.linear_damp shot_projection.show() diff --git a/src/player/shot_setup/shot_setup.tscn b/src/player/shot_setup/shot_setup.tscn index 7ecba9b..451068b 100644 --- a/src/player/shot_setup/shot_setup.tscn +++ b/src/player/shot_setup/shot_setup.tscn @@ -426,6 +426,13 @@ stream_0/stream = ExtResource("15_fn6g1") [node name="ShotSetup" type="Node3D"] script = ExtResource("1_r6ei4") +driving_range = null +initial_club_type = null +initial_ball = null +base_power = null +base_curve = null +perfect_aim = null +keep_projection = null [node name="BallPoint" type="Node3D" parent="."] unique_name_in_owner = true diff --git a/src/ui/3d/projectile_arc/projectile_arc.gd b/src/ui/3d/projectile_arc/projectile_arc.gd index 6af81a6..d6a7928 100644 --- a/src/ui/3d/projectile_arc/projectile_arc.gd +++ b/src/ui/3d/projectile_arc/projectile_arc.gd @@ -40,6 +40,9 @@ const PUTT_ATTRITION := 0.8325 # green? ## This can cause problems if there is a moving gravity field. @export var cache_gravity := true +## Linear damping factor of the shot. +@export var linear_damp := 0.0 + var _tick_counter := 0 var _debug_points: Array[Vector3] = [] @@ -103,6 +106,7 @@ func _process(_delta: float) -> void: # Integrate projectile path var next_pos := pos + vel * time_step + 0.5 * local_gravity * time_step * time_step vel += local_gravity * time_step + vel *= maxf(1 - linear_damp * time_step, 0) # Collision if check_collision and Game.settings.projection_collisions: diff --git a/src/ui/shot_hud/ball_selector/ball_selector.gd b/src/ui/shot_hud/ball_selector/ball_selector.gd index 4c3ae1c..70acbb3 100644 --- a/src/ui/shot_hud/ball_selector/ball_selector.gd +++ b/src/ui/shot_hud/ball_selector/ball_selector.gd @@ -8,6 +8,7 @@ const Y_OFFSET := { GameBall.Type.BASIC: 18, GameBall.Type.PLASMA: -14, GameBall.Type.BRICK: -46, + GameBall.Type.BEACH: -78, } @export var value: GameBall.Type: @@ -17,6 +18,7 @@ const Y_OFFSET := { @onready var basic_icon: BallIcon = %BasicIcon @onready var plasma_icon: BallIcon = %PlasmaIcon @onready var brick_icon: BallIcon = %BrickIcon +@onready var beach_icon: BallIcon = %BeachIcon func _ready() -> void: @@ -28,6 +30,7 @@ func set_state_for_player(player: WorldPlayer) -> void: basic_icon.quantity = player.get_balls(GameBall.Type.BASIC) plasma_icon.quantity = player.get_balls(GameBall.Type.PLASMA) brick_icon.quantity = player.get_balls(GameBall.Type.BRICK) + beach_icon.quantity = player.get_balls(GameBall.Type.BEACH) if player.shot_setup: value = player.shot_setup.ball_type player.on_balls_changed.connect(_set_quantity) @@ -41,6 +44,8 @@ func _get_icon(type: GameBall.Type) -> BallIcon: return plasma_icon GameBall.Type.BRICK: return brick_icon + GameBall.Type.BEACH: + return beach_icon return null diff --git a/src/ui/shot_hud/ball_selector/ball_selector.tscn b/src/ui/shot_hud/ball_selector/ball_selector.tscn index dd1d01b..172a03e 100644 --- a/src/ui/shot_hud/ball_selector/ball_selector.tscn +++ b/src/ui/shot_hud/ball_selector/ball_selector.tscn @@ -68,3 +68,11 @@ layout_mode = 2 text = "BALL_BRICK" quantity = 0 empty = true + +[node name="BeachIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")] +unique_name_in_owner = true +custom_minimum_size = Vector2(120, 27) +layout_mode = 2 +text = "BALL_BEACH" +quantity = 0 +empty = true