diff --git a/asset_dev/balls/brick/brick.blend b/asset_dev/balls/brick/brick.blend new file mode 100644 index 0000000..476d093 --- /dev/null +++ b/asset_dev/balls/brick/brick.blend @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afab74ac7f3a830a990d9ce7a7099fca5e238a5da2bed7794b7c98f3505d11e4 +size 903404 diff --git a/asset_dev/balls/brick/brick.blend1 b/asset_dev/balls/brick/brick.blend1 new file mode 100644 index 0000000..1e81c85 Binary files /dev/null and b/asset_dev/balls/brick/brick.blend1 differ diff --git a/asset_dev/balls/brick/brick_uv_layout.png b/asset_dev/balls/brick/brick_uv_layout.png new file mode 100644 index 0000000..08d91fa --- /dev/null +++ b/asset_dev/balls/brick/brick_uv_layout.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dffd8b2021bb9850aec877bc966c6f466f6536c1214cd9b2114051f324fa9b30 +size 512 diff --git a/assets/models/balls/brick/brick.bin b/assets/models/balls/brick/brick.bin new file mode 100644 index 0000000..781b7e5 Binary files /dev/null and b/assets/models/balls/brick/brick.bin differ diff --git a/assets/models/balls/brick/brick.gltf b/assets/models/balls/brick/brick.gltf new file mode 100644 index 0000000..f3ef418 --- /dev/null +++ b/assets/models/balls/brick/brick.gltf @@ -0,0 +1,120 @@ +{ + "asset":{ + "generator":"Khronos glTF Blender I/O v4.2.60", + "version":"2.0" + }, + "scene":0, + "scenes":[ + { + "name":"Scene", + "nodes":[ + 0 + ] + } + ], + "nodes":[ + { + "mesh":0, + "name":"Brick" + } + ], + "materials":[ + { + "doubleSided":true, + "name":"Brick", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 0.6121358871459961, + 0.21650230884552002, + 0.09049086272716522, + 1 + ], + "metallicFactor":0 + } + } + ], + "meshes":[ + { + "name":"Cube", + "primitives":[ + { + "attributes":{ + "POSITION":0, + "NORMAL":1, + "TEXCOORD_0":2 + }, + "indices":3, + "material":0 + } + ] + } + ], + "accessors":[ + { + "bufferView":0, + "componentType":5126, + "count":24, + "max":[ + 0.09207499027252197, + 0.05715000629425049, + 0.1936749815940857 + ], + "min":[ + -0.09207499027252197, + -0.05715000629425049, + -0.1936749815940857 + ], + "type":"VEC3" + }, + { + "bufferView":1, + "componentType":5126, + "count":24, + "type":"VEC3" + }, + { + "bufferView":2, + "componentType":5126, + "count":24, + "type":"VEC2" + }, + { + "bufferView":3, + "componentType":5123, + "count":36, + "type":"SCALAR" + } + ], + "bufferViews":[ + { + "buffer":0, + "byteLength":288, + "byteOffset":0, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":288, + "target":34962 + }, + { + "buffer":0, + "byteLength":192, + "byteOffset":576, + "target":34962 + }, + { + "buffer":0, + "byteLength":72, + "byteOffset":768, + "target":34963 + } + ], + "buffers":[ + { + "byteLength":840, + "uri":"brick.bin" + } + ] +} diff --git a/assets/models/balls/brick/brick.gltf.import b/assets/models/balls/brick/brick.gltf.import new file mode 100644 index 0000000..a7252ee --- /dev/null +++ b/assets/models/balls/brick/brick.gltf.import @@ -0,0 +1,36 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://b1aslqfbciwg8" +path="res://.godot/imported/brick.gltf-c734431c3027107f004874542c5d8b9c.scn" + +[deps] + +source_file="res://assets/models/balls/brick/brick.gltf" +dest_files=["res://.godot/imported/brick.gltf-c734431c3027107f004874542c5d8b9c.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/assets/text/text.csv b/assets/text/text.csv index 01b38ae..36ab57e 100644 --- a/assets/text/text.csv +++ b/assets/text/text.csv @@ -101,3 +101,4 @@ CLUB_PUTTER,Putter , BALL_BASIC,Basic BALL_PLASMA,Plasma +BALL_BRICK,Brick diff --git a/src/equipment/balls/brick/brick.tscn b/src/equipment/balls/brick/brick.tscn new file mode 100644 index 0000000..cd7b4a9 --- /dev/null +++ b/src/equipment/balls/brick/brick.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=5 format=3 uid="uid://cc8molh324unk"] + +[ext_resource type="PackedScene" uid="uid://dfttci386ohip" path="res://src/equipment/balls/physics_ball/physics_ball.tscn" id="1_y1dte"] +[ext_resource type="PackedScene" uid="uid://b1aslqfbciwg8" path="res://assets/models/balls/brick/brick.gltf" id="2_ubuxr"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_f03f4"] +rough = true +bounce = 1.0 +absorbent = true + +[sub_resource type="BoxShape3D" id="BoxShape3D_7v3re"] +size = Vector3(0.147, 0.092, 0.31) + +[node name="Brick" instance=ExtResource("1_y1dte")] +mass = 0.08 +physics_material_override = SubResource("PhysicsMaterial_f03f4") + +[node name="BrickMesh" parent="." index="0" instance=ExtResource("2_ubuxr")] +transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0) + +[node name="BallMesh" parent="." index="1"] +visible = false + +[node name="CollisionShape3D" parent="." index="2"] +shape = SubResource("BoxShape3D_7v3re") diff --git a/src/equipment/balls/physics_ball/game_ball.gd b/src/equipment/balls/physics_ball/game_ball.gd index 3b1f4b7..6a74014 100644 --- a/src/equipment/balls/physics_ball/game_ball.gd +++ b/src/equipment/balls/physics_ball/game_ball.gd @@ -9,6 +9,7 @@ enum Type { NONE, BASIC, PLASMA, + BRICK, } const TERRAIN_DAMPING_EPSILON := 1e-6 diff --git a/src/player/debug_player.tres b/src/player/debug_player.tres index 43a218a..f9d78b8 100644 --- a/src/player/debug_player.tres +++ b/src/player/debug_player.tres @@ -17,5 +17,6 @@ wedge = ExtResource("5_wm4ae") putter = ExtResource("3_tytwr") _balls = { 1: -1, -2: 5 +2: 5, +3: -1 } diff --git a/src/player/shot_setup/ball_point.gd b/src/player/shot_setup/ball_point.gd index 318f2d6..4cf404e 100644 --- a/src/player/shot_setup/ball_point.gd +++ b/src/player/shot_setup/ball_point.gd @@ -8,6 +8,7 @@ signal ball_changed(ball: GameBall) 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"), } @export var ball: GameBall: diff --git a/src/ui/shot_hud/ball_selector/ball_selector.gd b/src/ui/shot_hud/ball_selector/ball_selector.gd index bd7d292..4c3ae1c 100644 --- a/src/ui/shot_hud/ball_selector/ball_selector.gd +++ b/src/ui/shot_hud/ball_selector/ball_selector.gd @@ -7,6 +7,7 @@ const Y_OFFSET := { GameBall.Type.NONE: 50, GameBall.Type.BASIC: 18, GameBall.Type.PLASMA: -14, + GameBall.Type.BRICK: -46, } @export var value: GameBall.Type: @@ -15,6 +16,7 @@ const Y_OFFSET := { @onready var ball_list: VBoxContainer = %BallList @onready var basic_icon: BallIcon = %BasicIcon @onready var plasma_icon: BallIcon = %PlasmaIcon +@onready var brick_icon: BallIcon = %BrickIcon func _ready() -> void: @@ -25,6 +27,7 @@ func _ready() -> void: 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) if player.shot_setup: value = player.shot_setup.ball_type player.on_balls_changed.connect(_set_quantity) @@ -36,6 +39,8 @@ func _get_icon(type: GameBall.Type) -> BallIcon: return basic_icon GameBall.Type.PLASMA: return plasma_icon + GameBall.Type.BRICK: + return brick_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 6c31547..dd1d01b 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 = 109.0 +offset_bottom = 141.0 theme_override_constants/separation = 5 [node name="BasicIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")] @@ -60,3 +60,11 @@ unique_name_in_owner = true custom_minimum_size = Vector2(120, 27) layout_mode = 2 text = "BALL_PLASMA" + +[node name="BrickIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")] +unique_name_in_owner = true +custom_minimum_size = Vector2(120, 27) +layout_mode = 2 +text = "BALL_BRICK" +quantity = 0 +empty = true