From 06de956e1a337e638248230033aa524364be1d3b Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Fri, 13 Dec 2024 12:06:41 -0700 Subject: [PATCH] Added 'extra ball' items for brick & plasma ball --- .../item_octahedron/item_octahedron.blend | 4 +- .../item_octahedron/item_octahedron.blend1 | Bin 873136 -> 873168 bytes assets/materials/crystal.tres | 1 + levels/debug_level/debug_level.tscn | 34 ++- .../gfolf_girl/gfolf_girl.tscn | 2 +- .../balls/physics_ball/physics_ball.tscn | 4 +- .../balls/plasma_ball/plasma_ball.tscn | 13 +- src/items/extra_ball/brick_item.tscn | 119 +++++++++ src/items/extra_ball/extra_ball.gd | 16 ++ src/items/extra_ball/plasma_ball_item.tscn | 226 ++++++++++++++++++ src/items/item/item.gd | 9 +- src/items/item/item.tscn | 78 +++--- src/items/item_spawner.gd | 2 +- src/player/world_player.gd | 5 +- src/shaders/frosted_glass.gdshader | 4 +- src/ui/3d/projectile_arc/projectile_arc.tscn | 1 + 16 files changed, 457 insertions(+), 61 deletions(-) create mode 100644 src/items/extra_ball/brick_item.tscn create mode 100644 src/items/extra_ball/extra_ball.gd create mode 100644 src/items/extra_ball/plasma_ball_item.tscn diff --git a/asset_dev/item_octahedron/item_octahedron.blend b/asset_dev/item_octahedron/item_octahedron.blend index 8a3fcfa..294a0dd 100644 --- a/asset_dev/item_octahedron/item_octahedron.blend +++ b/asset_dev/item_octahedron/item_octahedron.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef69fc46b5d8fc418deb7e89869be64d4ebb5ecc0041568b6a7930c492ffc4c7 -size 873104 +oid sha256:d2a244f4ac37078c5c8c89ec314111ca50a130b960bb3fc6ae6d8be6f5e6c2f3 +size 873168 diff --git a/asset_dev/item_octahedron/item_octahedron.blend1 b/asset_dev/item_octahedron/item_octahedron.blend1 index 7d02ad873e090ee629c8d499fe5fd5fd354de492..5e1b79c8dc435dd0d84aa5050e792959fd6ed1ab 100644 GIT binary patch delta 12944 zcmbta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%@s8gXkHv%@SW? z3|N^D9ej!Wo!Cougx!r&Cngg^!&>W#@ zpgCEk%Y#h@Cp5z}9yIS~%~WUew>C%YVR@2h))4K}PJ%5PSd)WW4a8dEs_lZeG#`Am zdxB;!bR0rWbID*EGI%&VPB*)29+OSW9+THBbEZ3oYQyDQ-%2#Q!qJU>n(yQ+|MIN_ zmmIA#9@8FE(Tb1Mgu1zFS8I)yA8=lp`JdgU^&Z;Ow9{Ryp`F9w-&_xEhG+VkqIkPe#Xt6ey<*Y~_5{#+&guEyOn zHi5C{OV&?)wL4S}ijY3Y*ezaWDrg{~c9?;;V zKr^1^{pdIxU%tPTv}yj4FaGL{+Vj5oVHu5UtWWtv83gUDcSdTrtEzd(Z1_#E1j={s zaMb^8{~aCn_haM)FZ$oQ{#(585IyRu@tQJBz)YuJlo zL@%!4SYQz+eDIpM?p}T0lGscJmgb>ZpyB;9d~i0xc)*+|Lfvn9R|`|o-)|y}L?U4% zW+txN%zt|oZQi!k6|2GX_z%odm|~9~2qsW!@FU9{q+K3R$d3|+<6ooh-U;`CF void: + if amount < 0: + player.set_balls(ball_type, -1) + else: + player.mutate_balls(ball_type, amount) diff --git a/src/items/extra_ball/plasma_ball_item.tscn b/src/items/extra_ball/plasma_ball_item.tscn new file mode 100644 index 0000000..b5189e1 --- /dev/null +++ b/src/items/extra_ball/plasma_ball_item.tscn @@ -0,0 +1,226 @@ +[gd_scene load_steps=22 format=3 uid="uid://mcuhy71v6ggu"] + +[ext_resource type="PackedScene" uid="uid://comd88yp45mnb" path="res://src/items/item/item.tscn" id="1_f11yp"] +[ext_resource type="Script" path="res://src/items/extra_ball/extra_ball.gd" id="2_tixea"] +[ext_resource type="Shader" path="res://src/shaders/frosted_glass.gdshader" id="3_ljwjj"] +[ext_resource type="Texture2D" uid="uid://c2p2in2p7mjyo" path="res://assets/materials/crystal_noise_normal_map.tres" id="4_da2m2"] +[ext_resource type="Texture2D" uid="uid://cx33n4h5mfcdb" path="res://assets/materials/crystal_noise_map.tres" id="5_mfadb"] +[ext_resource type="Texture2D" uid="uid://ckhiq6rfjv63u" path="res://assets/textures/gfolfball/gfolfball.png" id="6_qn15y"] +[ext_resource type="Texture2D" uid="uid://btntjs7mbdigu" path="res://assets/textures/gfolfball/gfolfball_normal.png" id="7_kyc21"] +[ext_resource type="Texture2D" uid="uid://c47bkx508biqr" path="res://assets/sprites/particles/plasma.png" id="8_tjeqq"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_4un1r"] +render_priority = 0 +shader = ExtResource("3_ljwjj") +shader_parameter/albedo = Color(0.5146, 0.62, 0.62, 0.0392157) +shader_parameter/roughness = 0.3 +shader_parameter/roughness_texture = ExtResource("5_mfadb") +shader_parameter/refraction = 0.0100008 +shader_parameter/refraction_texture_channel = Vector4(1, 0, 0, 0) +shader_parameter/texture_refraction = ExtResource("5_mfadb") +shader_parameter/normal_strength = 0.400001 +shader_parameter/normal_map = ExtResource("4_da2m2") +shader_parameter/subsurface_scattering_strength = 1.0 +shader_parameter/texture_subsurface_scattering = ExtResource("5_mfadb") +shader_parameter/edge_color = Color(0, 1, 1.2, 1) +shader_parameter/surface_contribution = 0.2 +shader_parameter/specular_contribution = 0.5 +shader_parameter/refraction_contribution = 10.0 +shader_parameter/alpha = 0.9 +shader_parameter/uv1_scale = Vector3(1, 1, 1) +shader_parameter/uv1_offset = Vector3(0, 0, 0) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xqofq"] +albedo_texture = ExtResource("6_qn15y") +albedo_texture_force_srgb = true +metallic = 0.27 +roughness = 0.67 +normal_enabled = true +normal_scale = 0.2 +normal_texture = ExtResource("7_kyc21") +clearcoat_roughness = 0.0 +uv1_scale = Vector3(3, 1.5, 3) +texture_filter = 4 + +[sub_resource type="SphereMesh" id="SphereMesh_2r4nb"] +material = SubResource("StandardMaterial3D_xqofq") +radius = 0.05 +height = 0.1 +radial_segments = 6 +rings = 6 + +[sub_resource type="Curve" id="Curve_jkdik"] +max_value = 2.0 +_data = [Vector2(0, 2), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_oxhrr"] +curve = SubResource("Curve_jkdik") + +[sub_resource type="Curve" id="Curve_wa74n"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.249135, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.598878), -0.922125, -0.922125, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_vfusk"] +curve = SubResource("Curve_wa74n") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_wmn3a"] +angle_min = -720.0 +angle_max = 720.0 +direction = Vector3(0, 1, 0) +spread = 10.0 +initial_velocity_max = 0.2 +gravity = Vector3(0, 2.4, 0) +scale_curve = SubResource("CurveTexture_vfusk") +emission_curve = SubResource("CurveTexture_oxhrr") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7ptri"] +transparency = 1 +cull_mode = 2 +vertex_color_use_as_albedo = true +albedo_color = Color(0.48, 1, 1, 0.384314) +albedo_texture = ExtResource("8_tjeqq") +emission_enabled = true +emission = Color(0.42, 1, 1, 1) +billboard_mode = 3 +billboard_keep_scale = true +particles_anim_h_frames = 1 +particles_anim_v_frames = 1 +particles_anim_loop = false +grow_amount = -0.6 + +[sub_resource type="QuadMesh" id="QuadMesh_lsswf"] +material = SubResource("StandardMaterial3D_7ptri") +size = Vector2(0.8, 0.8) + +[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="PlasmaBallItem" instance=ExtResource("1_f11yp")] +script = ExtResource("2_tixea") +ball_type = 2 +amount = 3 + +[node name="Octahedron" parent="Pivot/Octahedron" index="0"] +surface_material_override/0 = SubResource("ShaderMaterial_4un1r") + +[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(2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0) +mesh = SubResource("SphereMesh_2r4nb") + +[node name="PlasmaFireEffect" type="GPUParticles3D" parent="Pivot/Octahedron/ItemMeshContainer/Pivot/BallMesh" index="0"] +sorting_offset = -1.0 +amount = 20 +lifetime = 0.6 +process_material = SubResource("ParticleProcessMaterial_wmn3a") +draw_pass_1 = SubResource("QuadMesh_lsswf") + +[node name="@AnimationPlayer@183828" type="AnimationPlayer" parent="Pivot/Octahedron" index="2"] +libraries = { +"": SubResource("AnimationLibrary_jwejx") +} +autoplay = "idle" + +[node name="Skeleton3D" parent="gfolf_girl/Armature" index="0"] +bones/2/scale = Vector3(1, 1, 1) +bones/3/scale = Vector3(1, 1, 1) +bones/4/scale = Vector3(1, 1, 1) +bones/6/scale = Vector3(1, 1, 1) +bones/8/scale = Vector3(1, 1, 1) +bones/11/scale = Vector3(1, 1, 1) +bones/12/scale = Vector3(1, 1, 1) +bones/13/scale = Vector3(1, 1, 1) +bones/20/scale = Vector3(1, 1, 1) +bones/21/rotation = Quaternion(-0.000222673, 0.707107, 0.707107, 0.000222504) +bones/21/scale = Vector3(1, 1, 1) +bones/22/scale = Vector3(1, 1, 1) +bones/23/scale = Vector3(1, 1, 1) + +[editable path="Pivot/Octahedron"] +[editable path="gfolf_girl"] diff --git a/src/items/item/item.gd b/src/items/item/item.gd index 624afd9..20d2db9 100644 --- a/src/items/item/item.gd +++ b/src/items/item/item.gd @@ -6,14 +6,19 @@ signal on_collect(player: WorldPlayer) @onready var explosion_player: AnimationPlayer = %ExplosionPlayer -func _collect(player: WorldPlayer) -> void: +func collect(player: WorldPlayer) -> void: # Note that this animation will call `queue_free` in 5 seconds! explosion_player.play("explode") + _collect(player) on_collect.emit(player) +func _collect(_player: WorldPlayer) -> void: + pass # Defined in derived type + + func _on_collection_area_body_entered(body: Node3D) -> void: if body is GameBall: var ball: GameBall = body if ball.player: - _collect(ball.player) + collect(ball.player) diff --git a/src/items/item/item.tscn b/src/items/item/item.tscn index 0d33b7f..ff0a4db 100644 --- a/src/items/item/item.tscn +++ b/src/items/item/item.tscn @@ -285,6 +285,45 @@ particles_anim_loop = false material = SubResource("StandardMaterial3D_ttptx") size = Vector2(0.05, 0.05) +[sub_resource type="Animation" id="Animation_50jqd"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Pivot/Octahedron/ExplosionParticles:emitting") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Pivot/Octahedron/Octahedron:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Pivot/SparkleParticles:emitting") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} + [sub_resource type="Animation" id="Animation_niure"] resource_name = "explode" length = 5.0 @@ -339,45 +378,6 @@ tracks/3/keys = { }] } -[sub_resource type="Animation" id="Animation_50jqd"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Pivot/Octahedron/ExplosionParticles:emitting") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [false] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Pivot/Octahedron/Octahedron:visible") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [true] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("Pivot/SparkleParticles:emitting") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [true] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_lqra6"] _data = { "RESET": SubResource("Animation_50jqd"), diff --git a/src/items/item_spawner.gd b/src/items/item_spawner.gd index 81886bb..87ba40b 100644 --- a/src/items/item_spawner.gd +++ b/src/items/item_spawner.gd @@ -47,7 +47,7 @@ func spawn() -> void: add_child(instance) # Pop-in animation - instance.scale = Vector3.ZERO + instance.scale = Vector3.ONE * 1e-6 var tween := create_tween() tween.tween_property(instance, "scale", Vector3.ONE, POP_IN_TIME).set_trans(Tween.TRANS_SPRING) diff --git a/src/player/world_player.gd b/src/player/world_player.gd index e1047a7..00d3300 100644 --- a/src/player/world_player.gd +++ b/src/player/world_player.gd @@ -70,8 +70,9 @@ func set_balls(type: GameBall.Type, value: int) -> void: ## Change the quantity of a ball type func mutate_balls(type: GameBall.Type, delta: int) -> void: - _balls[type] = _balls.get(type, 0) + delta - on_balls_changed.emit(type, _balls[type]) + if _balls[type] >= 0: + _balls[type] = _balls.get(type, 0) + delta + on_balls_changed.emit(type, _balls[type]) ## Get next slotted ball type diff --git a/src/shaders/frosted_glass.gdshader b/src/shaders/frosted_glass.gdshader index b9bcbfc..a621302 100644 --- a/src/shaders/frosted_glass.gdshader +++ b/src/shaders/frosted_glass.gdshader @@ -1,6 +1,6 @@ shader_type spatial; // render_mode blend_mix, depth_draw_always, cull_disabled; -render_mode diffuse_burley, specular_schlick_ggx, blend_mix, depth_draw_always, cull_disabled, sss_mode_skin; +render_mode diffuse_burley, specular_schlick_ggx, blend_mix, depth_draw_always, cull_back, sss_mode_skin; group_uniforms albedo; uniform vec4 albedo: source_color = vec4(1.0, 1.0, 1.0, 0.0); @@ -29,6 +29,7 @@ uniform vec4 edge_color: source_color = vec4(0.0, 0.0, 0.0, 1.0); uniform float surface_contribution = 0.2; uniform float specular_contribution = 0.2; uniform float refraction_contribution = 1.0; +uniform float alpha = 1.0; group_uniforms uv; uniform vec3 uv1_scale = vec3(1.0); @@ -73,4 +74,5 @@ void fragment() { float ref_amount = 1.0 - albedo_mix.a; EMISSION += (textureLod(screen_texture,ref_ofs,ROUGHNESS * 8.0).rgb * ref_amount * EXPOSURE * mix(vec3(mix(0.02, 0.1, a)), albedo_mix.rgb*refraction_contribution, a))/a_factor_2; ALBEDO *= 1.0 - ref_amount; + ALPHA = alpha; } diff --git a/src/ui/3d/projectile_arc/projectile_arc.tscn b/src/ui/3d/projectile_arc/projectile_arc.tscn index 345e8c2..06dd607 100644 --- a/src/ui/3d/projectile_arc/projectile_arc.tscn +++ b/src/ui/3d/projectile_arc/projectile_arc.tscn @@ -62,6 +62,7 @@ curve = SubResource("Curve3D_sj0rs") [node name="Polygon" type="CSGPolygon3D" parent="Path"] unique_name_in_owner = true +sorting_offset = 126.0 polygon = PackedVector2Array(0, -0.1, -0.2, 0, 0, 0.1, 0.2, 0) mode = 2 path_node = NodePath("..")