generated from krampus/template-godot4
Compare commits
4 Commits
967db4a303
...
fcbc8c6f0a
Author | SHA1 | Date |
---|---|---|
Rob Kelly | fcbc8c6f0a | |
Rob Kelly | e79d51b727 | |
Rob Kelly | 73bd40c6ac | |
Rob Kelly | 8bacd197c2 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
asset_dev/soda/soda.blend (Stored with Git LFS)
BIN
asset_dev/soda/soda.blend (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://67r5iwexjlsc"
|
||||
path="res://.godot/imported/dot.png-46eaa8fd8a0d7b1e6fa2fbfd53dfe4ba.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/particles/dot.png"
|
||||
dest_files=["res://.godot/imported/dot.png-46eaa8fd8a0d7b1e6fa2fbfd53dfe4ba.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
|
|
@ -84,6 +84,7 @@ ACTION_shot_zoom_out,"Zoom out"
|
|||
ACTION_shot_accept,Shoot
|
||||
ACTION_shot_cancel,"Cancel shot"
|
||||
ACTION_shot_reset,"Reset shot"
|
||||
ACTION_activate_ball,"Activate ball ability"
|
||||
ACTION_select_driver,"Select driver"
|
||||
ACTION_select_iron,"Select iron"
|
||||
ACTION_select_wedge,"Select wedge"
|
||||
|
@ -104,3 +105,5 @@ CLUB_PUTTER,Putter
|
|||
BALL_BASIC,Basic
|
||||
BALL_PLASMA,Plasma
|
||||
BALL_BRICK,Brick
|
||||
BALL_BEACH,"Beach Ball"
|
||||
BALL_POWER,Powerball
|
||||
|
|
|
Binary file not shown.
|
@ -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
|
Binary file not shown.
|
@ -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
|
|
@ -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"]
|
||||
|
@ -351,9 +352,25 @@ 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)
|
||||
|
||||
[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)
|
||||
|
||||
|
|
|
@ -143,6 +143,11 @@ shot_reset={
|
|||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
activate_ball={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
select_driver={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"location":0,"echo":false,"script":null)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
extends GameBall
|
||||
|
||||
|
||||
func enter_zone(zone: BallZone) -> void:
|
||||
_zones.push_back(zone)
|
|
@ -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_x6y4w"]
|
||||
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_x6y4w")
|
||||
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")
|
|
@ -10,6 +10,8 @@ enum Type {
|
|||
BASIC,
|
||||
PLASMA,
|
||||
BRICK,
|
||||
BEACH,
|
||||
POWER,
|
||||
}
|
||||
|
||||
const TERRAIN_DAMPING_EPSILON := 1e-6
|
||||
|
@ -51,6 +53,7 @@ var _position_on_last_wake: Vector3
|
|||
var _awake := false
|
||||
var _zones: Array[BallZone] = []
|
||||
|
||||
@onready var ability_cooldown: Timer = %AbilityCooldown
|
||||
@onready var manual_sleep_timer: Timer = %ManualSleepTimer
|
||||
@onready var sfx: BallSFX = %SFX
|
||||
@onready var effects: BallParticleEffects = %ParticleEffects
|
||||
|
@ -70,6 +73,19 @@ func enter_water() -> void:
|
|||
entered_water.emit()
|
||||
|
||||
|
||||
## Activate this ball's ability, if there is one.
|
||||
func activate_ability() -> void:
|
||||
if ability_cooldown.is_stopped():
|
||||
_activate_ability()
|
||||
ability_cooldown.start()
|
||||
# TODO: bonk
|
||||
|
||||
|
||||
func _activate_ability() -> void:
|
||||
# Implmemented by derived type
|
||||
pass
|
||||
|
||||
|
||||
func get_damage() -> float:
|
||||
print("velocity: ", linear_velocity.length())
|
||||
return base_damage + linear_velocity.length_squared() * damage_force_scale
|
||||
|
|
|
@ -193,6 +193,10 @@ bus = &"SFX"
|
|||
unique_name_in_owner = true
|
||||
one_shot = true
|
||||
|
||||
[node name="AbilityCooldown" type="Timer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
one_shot = true
|
||||
|
||||
[node name="ParticleEffects" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("12_7krl6")
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
extends GameBall
|
||||
|
||||
const ABILITY_MAGNITUDE := 5.0
|
||||
|
||||
var _ability_impulse := Vector3.ZERO
|
||||
|
||||
@onready var powerball_animation: AnimationPlayer = %PowerballAnimation
|
||||
|
||||
|
||||
func _activate_ability() -> void:
|
||||
_ability_impulse = linear_velocity.normalized() * ABILITY_MAGNITUDE
|
||||
can_sleep = false
|
||||
freeze = true
|
||||
powerball_animation.play("activate")
|
||||
|
||||
|
||||
func _finish_ability() -> void:
|
||||
can_sleep = true
|
||||
freeze = false
|
||||
linear_velocity = Vector3.ZERO
|
||||
apply_central_impulse(_ability_impulse)
|
|
@ -0,0 +1,146 @@
|
|||
[gd_scene load_steps=18 format=3 uid="uid://deuytmxw2lc62"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dfttci386ohip" path="res://src/equipment/balls/physics_ball/physics_ball.tscn" id="1_14gld"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckhiq6rfjv63u" path="res://assets/textures/gfolfball/gfolfball.png" id="2_a2gtg"]
|
||||
[ext_resource type="Script" path="res://src/equipment/balls/power_ball/power_ball.gd" id="2_hy51e"]
|
||||
[ext_resource type="Texture2D" uid="uid://btntjs7mbdigu" path="res://assets/textures/gfolfball/gfolfball_normal.png" id="3_60i75"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_c4cm7"]
|
||||
albedo_color = Color(2, 0.266, 0.266, 1)
|
||||
albedo_texture = ExtResource("2_a2gtg")
|
||||
albedo_texture_force_srgb = true
|
||||
metallic = 1.0
|
||||
roughness = 0.67
|
||||
normal_enabled = true
|
||||
normal_scale = 0.2
|
||||
normal_texture = ExtResource("3_60i75")
|
||||
clearcoat_roughness = 0.0
|
||||
uv1_scale = Vector3(3, 1.5, 3)
|
||||
texture_filter = 4
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_0b0i7"]
|
||||
material = SubResource("StandardMaterial3D_c4cm7")
|
||||
radius = 0.05
|
||||
height = 0.1
|
||||
radial_segments = 6
|
||||
rings = 6
|
||||
|
||||
[sub_resource type="Curve" id="Curve_ai354"]
|
||||
max_value = 100.0
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.115, 100), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_g3kms"]
|
||||
curve = SubResource("Curve_ai354")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_jeoyl"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.709474, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_c2myg"]
|
||||
curve = SubResource("Curve_jeoyl")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_k07ua"]
|
||||
emission_shape = 2
|
||||
emission_sphere_radius = 2.0
|
||||
gravity = Vector3(0, 0, 0)
|
||||
radial_accel_min = -100.0
|
||||
radial_accel_max = -100.0
|
||||
damping_min = 1.0
|
||||
damping_max = 1.0
|
||||
damping_curve = SubResource("CurveTexture_g3kms")
|
||||
scale_curve = SubResource("CurveTexture_c2myg")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_p1ob2"]
|
||||
_data = [Vector2(0, 0), 0.0, 13.0505, 0, 0, Vector2(0.185404, 1), 0.0, 0.0, 0, 0, Vector2(0.986193, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_v3vpa"]
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(2, 2, 1.333, 1)
|
||||
use_particle_trails = true
|
||||
|
||||
[sub_resource type="RibbonTrailMesh" id="RibbonTrailMesh_elifs"]
|
||||
material = SubResource("StandardMaterial3D_v3vpa")
|
||||
shape = 0
|
||||
size = 0.1
|
||||
sections = 3
|
||||
section_length = 0.1
|
||||
curve = SubResource("Curve_p1ob2")
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7yrvu"]
|
||||
resource_name = "activate"
|
||||
length = 0.8
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ParticleEffects/PowerParticles:emitting")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0.8),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"_finish_ability"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_6c6mi"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ParticleEffects/PowerParticles:emitting")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ospg0"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_6c6mi"),
|
||||
"activate": SubResource("Animation_7yrvu")
|
||||
}
|
||||
|
||||
[node name="PowerBall" instance=ExtResource("1_14gld")]
|
||||
freeze_mode = 1
|
||||
script = ExtResource("2_hy51e")
|
||||
|
||||
[node name="BallMesh" parent="." index="0"]
|
||||
mesh = SubResource("SphereMesh_0b0i7")
|
||||
|
||||
[node name="PowerParticles" type="GPUParticles3D" parent="ParticleEffects" index="1"]
|
||||
emitting = false
|
||||
amount = 32
|
||||
lifetime = 0.8
|
||||
one_shot = true
|
||||
randomness = 1.0
|
||||
trail_enabled = true
|
||||
trail_lifetime = 0.4
|
||||
process_material = SubResource("ParticleProcessMaterial_k07ua")
|
||||
draw_pass_1 = SubResource("RibbonTrailMesh_elifs")
|
||||
|
||||
[node name="PowerballAnimation" type="AnimationPlayer" parent="." index="7"]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_ospg0")
|
||||
}
|
|
@ -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"]
|
|
@ -16,7 +16,7 @@ script = ExtResource("2_rwv0k")
|
|||
transform = Transform3D(0.99863, 0.052336, 0, -0.052336, 0.99863, 0, 0, 0, 1, 0, 0, 0)
|
||||
|
||||
[node name="soda" parent="Pivot/Octahedron/ItemMeshContainer/Pivot" index="1" instance=ExtResource("2_bsxys")]
|
||||
transform = Transform3D(1.15911, -0.310583, 0, 0.3, 1.11962, 0.310583, -0.0803848, -0.3, 1.15911, 0, 0, 0)
|
||||
transform = Transform3D(0.965926, -0.258819, 2.87131e-07, 0.25, 0.933013, 0.258818, -0.0669874, -0.249999, 0.965926, 0, 0, 0)
|
||||
|
||||
[node name="Soda" parent="Pivot/Octahedron/ItemMeshContainer/Pivot/soda" index="0"]
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_6ujhj")
|
||||
|
|
|
@ -18,5 +18,7 @@ putter = ExtResource("3_tytwr")
|
|||
_balls = {
|
||||
1: -1,
|
||||
2: 5,
|
||||
3: -1
|
||||
3: -1,
|
||||
4: -1,
|
||||
5: -1
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ 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"),
|
||||
GameBall.Type.POWER: preload("res://src/equipment/balls/power_ball/power_ball.tscn"),
|
||||
}
|
||||
|
||||
@export var ball: GameBall:
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
||||
|
@ -618,6 +619,9 @@ func _process(delta: float) -> void:
|
|||
reset_enabled = false
|
||||
return_ball()
|
||||
|
||||
if Input.is_action_just_pressed("activate_ball"):
|
||||
game_ball.activate_ability()
|
||||
|
||||
if driving_range and Input.is_action_just_pressed("shot_accept"):
|
||||
phase = Phase.AIM
|
||||
return_ball()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -8,6 +8,8 @@ const Y_OFFSET := {
|
|||
GameBall.Type.BASIC: 18,
|
||||
GameBall.Type.PLASMA: -14,
|
||||
GameBall.Type.BRICK: -46,
|
||||
GameBall.Type.BEACH: -78,
|
||||
GameBall.Type.POWER: -110,
|
||||
}
|
||||
|
||||
@export var value: GameBall.Type:
|
||||
|
@ -17,6 +19,8 @@ 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
|
||||
@onready var power_icon: BallIcon = %PowerIcon
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
@ -28,6 +32,8 @@ 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)
|
||||
power_icon.quantity = player.get_balls(GameBall.Type.POWER)
|
||||
if player.shot_setup:
|
||||
value = player.shot_setup.ball_type
|
||||
player.on_balls_changed.connect(_set_quantity)
|
||||
|
@ -41,6 +47,10 @@ func _get_icon(type: GameBall.Type) -> BallIcon:
|
|||
return plasma_icon
|
||||
GameBall.Type.BRICK:
|
||||
return brick_icon
|
||||
GameBall.Type.BEACH:
|
||||
return beach_icon
|
||||
GameBall.Type.POWER:
|
||||
return power_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 = 141.0
|
||||
offset_bottom = 173.0
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="BasicIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")]
|
||||
|
@ -68,3 +68,19 @@ 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
|
||||
|
||||
[node name="PowerIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(120, 27)
|
||||
layout_mode = 2
|
||||
text = "BALL_POWER"
|
||||
quantity = 0
|
||||
empty = true
|
||||
|
|
Loading…
Reference in New Issue