generated from krampus/template-godot4
Brick!
This commit is contained in:
parent
508e9d593b
commit
9b9979e8ac
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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
|
|
@ -101,3 +101,4 @@ CLUB_PUTTER,Putter
|
|||
,
|
||||
BALL_BASIC,Basic
|
||||
BALL_PLASMA,Plasma
|
||||
BALL_BRICK,Brick
|
||||
|
|
|
|
@ -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")
|
|
@ -9,6 +9,7 @@ enum Type {
|
|||
NONE,
|
||||
BASIC,
|
||||
PLASMA,
|
||||
BRICK,
|
||||
}
|
||||
|
||||
const TERRAIN_DAMPING_EPSILON := 1e-6
|
||||
|
|
|
@ -17,5 +17,6 @@ wedge = ExtResource("5_wm4ae")
|
|||
putter = ExtResource("3_tytwr")
|
||||
_balls = {
|
||||
1: -1,
|
||||
2: 5
|
||||
2: 5,
|
||||
3: -1
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue