diff --git a/assets/mesh_libraries/w1/w1_walls.meshlib b/assets/mesh_libraries/w1/w1_walls.meshlib index 1231501..5aefc5a 100644 Binary files a/assets/mesh_libraries/w1/w1_walls.meshlib and b/assets/mesh_libraries/w1/w1_walls.meshlib differ diff --git a/assets/mesh_libraries/w1/w1_walls.tscn b/assets/mesh_libraries/w1/w1_walls.tscn index aea9e40..7b1215b 100644 --- a/assets/mesh_libraries/w1/w1_walls.tscn +++ b/assets/mesh_libraries/w1/w1_walls.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=3 format=3 uid="uid://d3kpyse5k7scu"] +[gd_scene load_steps=4 format=3 uid="uid://d3kpyse5k7scu"] [ext_resource type="PackedScene" uid="uid://ckqliu2kcydpu" path="res://assets/models/tiles/w1_walls.glb" id="1_1elhp"] [sub_resource type="BoxShape3D" id="BoxShape3D_kqhok"] +[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_bvwbx"] +points = PackedVector3Array(0.5, 1, 0.5, 0.5, 1, -0.5, -0.5, 1, -0.5, 0.5, 0, 0.5, 0.5, 0, -0.5, -0.5, 0, -0.5) + [node name="W1Walls" instance=ExtResource("1_1elhp")] [node name="StaticBody3D" type="StaticBody3D" parent="GreyBlock" index="0"] @@ -11,3 +14,8 @@ [node name="CollisionShape3D" type="CollisionShape3D" parent="GreyBlock/StaticBody3D" index="0"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) shape = SubResource("BoxShape3D_kqhok") + +[node name="StaticBody3D" type="StaticBody3D" parent="GreyBlockCorner" index="0"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="GreyBlockCorner/StaticBody3D" index="0"] +shape = SubResource("ConvexPolygonShape3D_bvwbx") diff --git a/assets/models/enemies/boney.blend b/assets/models/enemies/boney.blend new file mode 100644 index 0000000..edd7ebc Binary files /dev/null and b/assets/models/enemies/boney.blend differ diff --git a/assets/models/enemies/boney.blend1 b/assets/models/enemies/boney.blend1 new file mode 100644 index 0000000..598cc18 Binary files /dev/null and b/assets/models/enemies/boney.blend1 differ diff --git a/assets/models/enemies/boney.glb b/assets/models/enemies/boney.glb new file mode 100644 index 0000000..776b89e Binary files /dev/null and b/assets/models/enemies/boney.glb differ diff --git a/assets/models/enemies/boney.glb.import b/assets/models/enemies/boney.glb.import new file mode 100644 index 0000000..4404602 --- /dev/null +++ b/assets/models/enemies/boney.glb.import @@ -0,0 +1,47 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://46kyrtlb6b0a" +path="res://.godot/imported/boney.glb-7dff273298f8aef263b81a73cceddb63.scn" + +[deps] + +source_file="res://assets/models/enemies/boney.glb" +dest_files=["res://.godot/imported/boney.glb-7dff273298f8aef263b81a73cceddb63.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={ +"materials": { +"Eyes": { +"use_external/enabled": true, +"use_external/path": "res://assets/models/enemies/boney/eyes.material" +}, +"Head": { +"use_external/enabled": true, +"use_external/path": "res://assets/models/enemies/boney/head.material" +} +} +} +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/assets/models/enemies/boney/eyes.material b/assets/models/enemies/boney/eyes.material new file mode 100644 index 0000000..348b358 Binary files /dev/null and b/assets/models/enemies/boney/eyes.material differ diff --git a/assets/models/enemies/boney/head.material b/assets/models/enemies/boney/head.material new file mode 100644 index 0000000..dfa1661 Binary files /dev/null and b/assets/models/enemies/boney/head.material differ diff --git a/assets/models/tiles/w1_walls.blend b/assets/models/tiles/w1_walls.blend index 6a4b963..08e0824 100644 Binary files a/assets/models/tiles/w1_walls.blend and b/assets/models/tiles/w1_walls.blend differ diff --git a/assets/models/tiles/w1_walls.blend1 b/assets/models/tiles/w1_walls.blend1 index ea9f15c..7e573b1 100644 Binary files a/assets/models/tiles/w1_walls.blend1 and b/assets/models/tiles/w1_walls.blend1 differ diff --git a/assets/models/tiles/w1_walls.glb b/assets/models/tiles/w1_walls.glb index 2223b0f..c096543 100644 Binary files a/assets/models/tiles/w1_walls.glb and b/assets/models/tiles/w1_walls.glb differ diff --git a/assets/models/tiles/w1_walls.glb.import b/assets/models/tiles/w1_walls.glb.import index 71f4c2d..a56a2b7 100644 --- a/assets/models/tiles/w1_walls.glb.import +++ b/assets/models/tiles/w1_walls.glb.import @@ -35,7 +35,7 @@ _subresources={ "materials": { "GreyBlock": { "use_external/enabled": true, -"use_external/path": "res://assets/models/tiles/w1_walls/grey_block.tres" +"use_external/path": "res://assets/models/tiles/w1_walls/grey_block.material" } } } diff --git a/assets/models/tiles/w1_walls/grey_block.material b/assets/models/tiles/w1_walls/grey_block.material new file mode 100644 index 0000000..68549b3 Binary files /dev/null and b/assets/models/tiles/w1_walls/grey_block.material differ diff --git a/assets/models/tiles/w1_walls/grey_block.material.depren b/assets/models/tiles/w1_walls/grey_block.material.depren new file mode 100644 index 0000000..081a0ee Binary files /dev/null and b/assets/models/tiles/w1_walls/grey_block.material.depren differ diff --git a/assets/models/tiles/w1_walls/grey_block.tres b/assets/models/tiles/w1_walls/grey_block.tres index cb6e2ae..1502b56 100644 --- a/assets/models/tiles/w1_walls/grey_block.tres +++ b/assets/models/tiles/w1_walls/grey_block.tres @@ -8,4 +8,6 @@ shading_mode = 2 specular_mode = 2 albedo_texture = ExtResource("1_y03ms") metallic_specular = 0.0 +uv1_offset = Vector3(0.5, 0, 0.5) +uv1_triplanar = true texture_filter = 0 diff --git a/assets/shaders/horizontal_world_uv.gdshader b/assets/shaders/horizontal_world_uv.gdshader new file mode 100644 index 0000000..dafeaa6 --- /dev/null +++ b/assets/shaders/horizontal_world_uv.gdshader @@ -0,0 +1,16 @@ +shader_type spatial; + +uniform sampler2D albedo_texture : repeat_enable, filter_nearest, source_color; +uniform vec2 horizontal_uv_offset = vec2(0.0); + +void vertex() { + vec3 world_position = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz; + vec3 world_normal = (MODEL_NORMAL_MATRIX * NORMAL).xyz; + vec2 uv_y = world_position.xz + horizontal_uv_offset; + //vec3 normal_weights = world_normal / (world_normal.x + world_normal.y + world_normal.z); + UV = mix(UV, uv_y, abs(world_normal.y)); +} + +void fragment() { + ALBEDO = texture(albedo_texture, UV).rgb; +} \ No newline at end of file diff --git a/assets/sounds/enemies/car_death.ogg b/assets/sounds/enemies/car_death.ogg new file mode 100644 index 0000000..cc28e3e Binary files /dev/null and b/assets/sounds/enemies/car_death.ogg differ diff --git a/assets/sounds/enemies/car_death.ogg.import b/assets/sounds/enemies/car_death.ogg.import new file mode 100644 index 0000000..d66c912 --- /dev/null +++ b/assets/sounds/enemies/car_death.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://ds061x3orayd" +path="res://.godot/imported/car_death.ogg-6cac3139dee4cff23c68f179a5469cf0.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/enemies/car_death.ogg" +dest_files=["res://.godot/imported/car_death.ogg-6cac3139dee4cff23c68f179a5469cf0.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/enemies/chuckle_death.ogg b/assets/sounds/enemies/chuckle_death.ogg new file mode 100644 index 0000000..fce58bb Binary files /dev/null and b/assets/sounds/enemies/chuckle_death.ogg differ diff --git a/assets/sounds/enemies/chuckle_death.ogg.import b/assets/sounds/enemies/chuckle_death.ogg.import new file mode 100644 index 0000000..95e3f05 --- /dev/null +++ b/assets/sounds/enemies/chuckle_death.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dkc6v63lqhw5c" +path="res://.godot/imported/chuckle_death.ogg-b837a9f08423889eb5233efc27437f4d.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/enemies/chuckle_death.ogg" +dest_files=["res://.godot/imported/chuckle_death.ogg-b837a9f08423889eb5233efc27437f4d.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/enemies/skull_death.ogg b/assets/sounds/enemies/skull_death.ogg new file mode 100644 index 0000000..dac7ea2 Binary files /dev/null and b/assets/sounds/enemies/skull_death.ogg differ diff --git a/assets/sounds/enemies/skull_death.ogg.import b/assets/sounds/enemies/skull_death.ogg.import new file mode 100644 index 0000000..3eb6fe5 --- /dev/null +++ b/assets/sounds/enemies/skull_death.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://cgotekctoej7m" +path="res://.godot/imported/skull_death.ogg-edbbaa59918e788e19dff41bdd4a611f.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/enemies/skull_death.ogg" +dest_files=["res://.godot/imported/skull_death.ogg-edbbaa59918e788e19dff41bdd4a611f.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/player/cancel.ogg b/assets/sounds/player/cancel.ogg new file mode 100644 index 0000000..e7e6c0e Binary files /dev/null and b/assets/sounds/player/cancel.ogg differ diff --git a/assets/sounds/player/cancel.ogg.import b/assets/sounds/player/cancel.ogg.import new file mode 100644 index 0000000..430d495 --- /dev/null +++ b/assets/sounds/player/cancel.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dis5fg68ese7r" +path="res://.godot/imported/cancel.ogg-fd164dfa3e99c9b029bb344184319467.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/player/cancel.ogg" +dest_files=["res://.godot/imported/cancel.ogg-fd164dfa3e99c9b029bb344184319467.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/player/grab.ogg b/assets/sounds/player/grab.ogg new file mode 100644 index 0000000..3b7fb77 Binary files /dev/null and b/assets/sounds/player/grab.ogg differ diff --git a/assets/sounds/player/grab.ogg.import b/assets/sounds/player/grab.ogg.import new file mode 100644 index 0000000..445300d --- /dev/null +++ b/assets/sounds/player/grab.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://7u8a6osl4buo" +path="res://.godot/imported/grab.ogg-17b9475312388c522272e0430a9a4fd2.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/player/grab.ogg" +dest_files=["res://.godot/imported/grab.ogg-17b9475312388c522272e0430a9a4fd2.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/player/hit.ogg b/assets/sounds/player/hit.ogg new file mode 100644 index 0000000..f13327e Binary files /dev/null and b/assets/sounds/player/hit.ogg differ diff --git a/assets/sounds/player/hit.ogg.import b/assets/sounds/player/hit.ogg.import new file mode 100644 index 0000000..d5db143 --- /dev/null +++ b/assets/sounds/player/hit.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dnyjfcq8m2r4f" +path="res://.godot/imported/hit.ogg-739ff6e91c7bfe9397fb326ac3a08060.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/player/hit.ogg" +dest_files=["res://.godot/imported/hit.ogg-739ff6e91c7bfe9397fb326ac3a08060.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/player/notif.ogg b/assets/sounds/player/notif.ogg new file mode 100644 index 0000000..aed1091 Binary files /dev/null and b/assets/sounds/player/notif.ogg differ diff --git a/assets/sounds/player/notif.ogg.import b/assets/sounds/player/notif.ogg.import new file mode 100644 index 0000000..564cd17 --- /dev/null +++ b/assets/sounds/player/notif.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://cl473tb6myjfi" +path="res://.godot/imported/notif.ogg-447e1147263a9f4faf2dc1ef0e43823b.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/player/notif.ogg" +dest_files=["res://.godot/imported/notif.ogg-447e1147263a9f4faf2dc1ef0e43823b.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/player/push.ogg b/assets/sounds/player/push.ogg new file mode 100644 index 0000000..407a862 Binary files /dev/null and b/assets/sounds/player/push.ogg differ diff --git a/assets/sounds/player/push.ogg.import b/assets/sounds/player/push.ogg.import new file mode 100644 index 0000000..c4a76ea --- /dev/null +++ b/assets/sounds/player/push.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://c443wu0euchje" +path="res://.godot/imported/push.ogg-11c367abb33889a067147a1fbcd0a7ec.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/player/push.ogg" +dest_files=["res://.godot/imported/push.ogg-11c367abb33889a067147a1fbcd0a7ec.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/player/wall_bump.ogg b/assets/sounds/player/wall_bump.ogg new file mode 100644 index 0000000..6ca759a Binary files /dev/null and b/assets/sounds/player/wall_bump.ogg differ diff --git a/assets/sounds/player/wall_bump.ogg.import b/assets/sounds/player/wall_bump.ogg.import new file mode 100644 index 0000000..d007399 --- /dev/null +++ b/assets/sounds/player/wall_bump.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bv4plfa1oj3tf" +path="res://.godot/imported/wall_bump.ogg-984ae11e6957d5480ca97a126c040c8f.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/player/wall_bump.ogg" +dest_files=["res://.godot/imported/wall_bump.ogg-984ae11e6957d5480ca97a126c040c8f.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/default_bus_layout.tres b/default_bus_layout.tres new file mode 100644 index 0000000..ffba500 --- /dev/null +++ b/default_bus_layout.tres @@ -0,0 +1,15 @@ +[gd_resource type="AudioBusLayout" format=3 uid="uid://b4lojre8w4t30"] + +[resource] +bus/1/name = &"Sounds" +bus/1/solo = false +bus/1/mute = false +bus/1/bypass_fx = false +bus/1/volume_db = 0.0 +bus/1/send = &"Master" +bus/2/name = &"Music" +bus/2/solo = false +bus/2/mute = false +bus/2/bypass_fx = false +bus/2/volume_db = 0.0 +bus/2/send = &"Master" diff --git a/objects/boney.gd b/objects/boney.gd new file mode 100644 index 0000000..a3968ff --- /dev/null +++ b/objects/boney.gd @@ -0,0 +1,35 @@ +extends CharacterBody3D + + +@export var speed: float +@export_range(0,1,1,"or_less","or_greater","radians_as_degrees") +var rotation_speed: float +@export var death_delay: float + +@export_group("Node References") +@export var model: Node3D +@export var death_sound: AudioStreamPlayer3D + + +func _ready() -> void: + velocity = global_basis.z * speed + rotation = Vector3.ZERO + + +func _physics_process(delta: float) -> void: + model.global_rotation.y = wrapf(Time.get_ticks_msec() * 0.001 * rotation_speed, 0.0, TAU) + + var col = move_and_collide(velocity * delta) + if col: + if col.get_collider() is Player: + queue_free() + velocity = velocity.bounce(col.get_normal()) + + +func _on_player_detector_body_entered(body: Node3D) -> void: + if body is Player: + model.visible = false + death_sound.play() + var tween = create_tween() + tween.set_process_mode(Tween.TWEEN_PROCESS_PHYSICS) + tween.tween_callback(queue_free).set_delay(death_delay) diff --git a/objects/boney.tscn b/objects/boney.tscn new file mode 100644 index 0000000..1112da0 --- /dev/null +++ b/objects/boney.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=7 format=3 uid="uid://b4a8aif3iigdw"] + +[ext_resource type="Script" path="res://objects/boney.gd" id="1_bofrm"] +[ext_resource type="PackedScene" uid="uid://46kyrtlb6b0a" path="res://assets/models/enemies/boney.glb" id="2_ssgky"] +[ext_resource type="AudioStream" uid="uid://cgotekctoej7m" path="res://assets/sounds/enemies/skull_death.ogg" id="3_a4a2f"] + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_ictao"] +height = 0.5 +radius = 0.4 + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_cdksx"] +height = 0.5 + +[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_5d27a"] +random_pitch = 1.5 +streams_count = 1 +stream_0/stream = ExtResource("3_a4a2f") + +[node name="Boney" type="CharacterBody3D" node_paths=PackedStringArray("model", "death_sound")] +script = ExtResource("1_bofrm") +death_delay = 0.2 +model = NodePath("Model") +death_sound = NodePath("DeathSound") + +[node name="Model" parent="." instance=ExtResource("2_ssgky")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, 0) + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) +shape = SubResource("CylinderShape3D_ictao") + +[node name="PlayerDetector" type="Area3D" parent="."] +collision_layer = 0 +collision_mask = 16 +monitorable = false + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerDetector"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) +shape = SubResource("CylinderShape3D_cdksx") + +[node name="DeathSound" type="AudioStreamPlayer3D" parent="."] +stream = SubResource("AudioStreamRandomizer_5d27a") +bus = &"Sounds" + +[connection signal="body_entered" from="PlayerDetector" to="." method="_on_player_detector_body_entered" flags=6] diff --git a/objects/canny_cat.gd b/objects/canny_cat.gd index a4183ef..32703c5 100644 --- a/objects/canny_cat.gd +++ b/objects/canny_cat.gd @@ -1,18 +1,19 @@ class_name Player extends CharacterBody3D - -@export var power_scale: float -@export var power_sensitivity: float -@export var power_threshold: float - +@export_group("Visuals") @export var goal_animation_time: float = 1.0 +@export var charge_gradient: Gradient +@export var power_line_material: StandardMaterial3D @export_group("Movement") @export var gravity: float @export var friction: float @export var friction_coef: float @export var friction_pow: float +@export var power_scale: float +@export var power_sensitivity: float +@export var power_threshold: float @export var stop_threshold: float @export_group("Camera", "camera_") @@ -83,7 +84,8 @@ func _update_charge(_delta: float) -> void: power_indicator.scale.z = power var camera_z = get_viewport().get_camera_3d().global_transform.basis.z camera_z.y = 0.0 - power_indicator.look_at(power_indicator.global_position + camera_z, Vector3.UP, true) + power_indicator.look_at(power_indicator.global_position + camera_z) + power_line_material.albedo_color = charge_gradient.sample(power) func _end_charge() -> void: charging_power = false diff --git a/objects/canny_cat.tscn b/objects/canny_cat.tscn index 0a89229..2bdbac7 100644 --- a/objects/canny_cat.tscn +++ b/objects/canny_cat.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=3 uid="uid://cybm74xwbsivx"] +[gd_scene load_steps=15 format=3 uid="uid://cybm74xwbsivx"] [ext_resource type="Texture2D" uid="uid://3i17aqnrspma" path="res://assets/textures/player/canny.png" id="1_cp4br"] [ext_resource type="Script" path="res://objects/canny_cat.gd" id="1_twfq8"] @@ -9,13 +9,19 @@ [ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_epv8h"] [ext_resource type="Script" path="res://addons/godot_state_charts/expression_guard.gd" id="8_d5slg"] -[sub_resource type="SphereShape3D" id="SphereShape3D_4o01j"] -radius = 0.45 +[sub_resource type="Gradient" id="Gradient_u5ds4"] +interpolation_mode = 2 +offsets = PackedFloat32Array(0.2, 0.2, 0.433673, 0.642857, 0.826531, 1) +colors = PackedColorArray(0.501961, 0, 0, 1, 0.5, 0.6, 1, 1, 0.5, 1, 0.566667, 1, 0.925, 1, 0.5, 1, 1, 0.741667, 0.5, 1, 1, 0.5, 0.5, 1) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2xpb7"] +resource_local_to_scene = true shading_mode = 0 albedo_color = Color(0.916968, 0.113727, 0, 1) +[sub_resource type="SphereShape3D" id="SphereShape3D_4o01j"] +radius = 0.45 + [sub_resource type="CylinderMesh" id="CylinderMesh_b16dl"] top_radius = 0.05 bottom_radius = 0.05 @@ -41,13 +47,15 @@ axis_lock_angular_x = true axis_lock_angular_y = true axis_lock_angular_z = true script = ExtResource("1_twfq8") -power_scale = 20.0 -power_sensitivity = 0.01 -power_threshold = 0.2 +charge_gradient = SubResource("Gradient_u5ds4") +power_line_material = SubResource("StandardMaterial3D_2xpb7") gravity = 10.0 friction = 10.0 friction_coef = 0.01 friction_pow = 60.0 +power_scale = 20.0 +power_sensitivity = 0.01 +power_threshold = 0.2 stop_threshold = 0.1 camera_low_angle = 0.349066 camera_high_angle = 1.0472 @@ -82,7 +90,7 @@ texture = ExtResource("2_fwt6m") [node name="PowerIndicator" type="Node3D" parent="."] visible = false -[node name="Line" type="MeshInstance3D" parent="PowerIndicator"] +[node name="PowerLine" type="MeshInstance3D" parent="PowerIndicator"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 2) material_override = SubResource("StandardMaterial3D_2xpb7") cast_shadow = 0 @@ -150,9 +158,9 @@ delay_in_seconds = "0.0" script = ExtResource("6_bu01i") [connection signal="state_physics_processing" from="StateChart/Root/Idle" to="." method="_apply_gravity"] +[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_bounce_on_walls"] [connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_slow_to_stop"] [connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_apply_gravity"] -[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_bounce_on_walls"] [connection signal="state_entered" from="StateChart/Root/Charging" to="." method="_start_charge"] [connection signal="state_exited" from="StateChart/Root/Charging" to="." method="_end_charge"] [connection signal="state_physics_processing" from="StateChart/Root/Charging" to="." method="_update_charge"] diff --git a/objects/sand_pit.tscn b/objects/sand_pit.tscn index 4c00242..ba0bc6f 100644 --- a/objects/sand_pit.tscn +++ b/objects/sand_pit.tscn @@ -1,22 +1,20 @@ -[gd_scene load_steps=4 format=3 uid="uid://bfic5n608nc5j"] +[gd_scene load_steps=5 format=3 uid="uid://bfic5n608nc5j"] +[ext_resource type="Shader" path="res://assets/shaders/horizontal_world_uv.gdshader" id="1_2mr0t"] [ext_resource type="Texture2D" uid="uid://djx2x3jjn01w2" path="res://assets/textures/world/sand.png" id="1_yg8om"] [ext_resource type="Script" path="res://objects/sand_pit.gd" id="2_vtyum"] -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_r0cip"] -shading_mode = 2 -specular_mode = 2 -albedo_texture = ExtResource("1_yg8om") -metallic_specular = 0.0 -uv1_triplanar = true -uv1_world_triplanar = true -texture_filter = 0 +[sub_resource type="ShaderMaterial" id="ShaderMaterial_7s0pr"] +render_priority = 0 +shader = ExtResource("1_2mr0t") +shader_parameter/horizontal_uv_offset = Vector2(0, 0) +shader_parameter/albedo_texture = ExtResource("1_yg8om") [node name="SandPit" type="CSGPolygon3D" node_paths=PackedStringArray("collision_polygon")] process_physics_priority = 100 transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0) depth = 0.03 -material = SubResource("StandardMaterial3D_r0cip") +material = SubResource("ShaderMaterial_7s0pr") script = ExtResource("2_vtyum") friction = 9.0 collision_polygon = NodePath("Area3D/CollisionPolygon3D") diff --git a/project.godot b/project.godot index bef0700..c55e805 100644 --- a/project.godot +++ b/project.godot @@ -19,7 +19,7 @@ config/icon="res://icon.svg" window/size/viewport_width=320 window/size/viewport_height=240 -window/stretch/mode="canvas_items" +window/stretch/mode="viewport" [editor_plugins] diff --git a/test_scene.tscn b/test_scene.tscn index e12aff2..18c7d23 100644 --- a/test_scene.tscn +++ b/test_scene.tscn @@ -1,25 +1,41 @@ -[gd_scene load_steps=9 format=3 uid="uid://dllug6vijj18o"] +[gd_scene load_steps=11 format=3 uid="uid://dllug6vijj18o"] [ext_resource type="PackedScene" uid="uid://cybm74xwbsivx" path="res://objects/canny_cat.tscn" id="1_8qiqb"] [ext_resource type="MeshLibrary" uid="uid://cbs170roel08g" path="res://assets/mesh_libraries/w1/w1_floors.meshlib" id="2_ohutf"] [ext_resource type="MeshLibrary" uid="uid://bqxgr3arh0i7f" path="res://assets/mesh_libraries/w1/w1_walls.meshlib" id="3_k3r2h"] [ext_resource type="PackedScene" uid="uid://cdpgby3r6xe4n" path="res://objects/goal_post.tscn" id="4_71ems"] [ext_resource type="PackedScene" uid="uid://bfic5n608nc5j" path="res://objects/sand_pit.tscn" id="5_7n16u"] +[ext_resource type="PackedScene" uid="uid://b4a8aif3iigdw" path="res://objects/boney.tscn" id="6_gpbt0"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_akirf"] +sky_top_color = Color(0.270389, 0.858166, 0.929253, 1) +sky_horizon_color = Color(0.270588, 0.858824, 0.929412, 1) +ground_bottom_color = Color(0.089621, 0.176788, 0.342266, 1) +ground_horizon_color = Color(0.270588, 0.858824, 0.929412, 1) +ground_curve = 0.452548 +sun_angle_max = 0.0 +use_debanding = false [sub_resource type="Sky" id="Sky_f657k"] sky_material = SubResource("ProceduralSkyMaterial_akirf") +radiance_size = 0 [sub_resource type="Environment" id="Environment_0oogp"] background_mode = 2 sky = SubResource("Sky_f657k") +ambient_light_source = 2 +ambient_light_color = Color(1, 1, 1, 1) +ambient_light_energy = 0.25 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_77yoh"] +resource_local_to_scene = true +shading_mode = 0 +albedo_color = Color(0.916968, 0.113727, 0, 1) [node name="TestScene" type="Node3D"] [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] transform = Transform3D(0.893065, 0.251134, -0.373318, 0, 0.82973, 0.558165, 0.449927, -0.498478, 0.741003, 0, 3.18312, 0) -light_energy = 1.5 sky_mode = 1 [node name="Floor" type="GridMap" parent="."] @@ -27,7 +43,7 @@ mesh_library = ExtResource("2_ohutf") cell_size = Vector3(1, 1, 1) cell_center_y = false data = { -"cells": PackedInt32Array(0, 65535, 0, 65535, 65535, 0, 65535, 0, 1441792, 65534, 0, 0, 65534, 65535, 0, 65534, 65534, 0, 65535, 65534, 0, 0, 65534, 0, 1, 65534, 0, 1, 65535, 0, 1, 0, 1441792, 65535, 1, 0, 65534, 1, 0, 1, 2, 0, 0, 2, 0, 65535, 2, 0, 65534, 2, 0, 65533, 2, 0, 65533, 1, 0, 65533, 0, 0, 65533, 65535, 0, 65533, 65534, 0, 65533, 65533, 0, 65534, 65533, 0, 0, 65533, 0, 65535, 65533, 0, 2, 1, 1441792, 3, 2, 0, 3, 1, 0, 0, 65532, 0, 65535, 65532, 0, 65534, 65532, 0, 65533, 65532, 0, 65532, 65532, 0, 65532, 65533, 0, 65532, 65534, 0, 65532, 65535, 0, 65532, 1, 0, 65532, 0, 0, 65532, 2, 0, 65532, 3, 0, 65533, 3, 0, 65534, 3, 0, 65535, 3, 0, 1, 3, 0, 2, 3, 0, 3, 3, 0, 0, 3, 0, 4, 3, 0, 4, 2, 0, 4, 1, 0, 2, 2, 0, 5, 4, 0, 4, 4, 0, 3, 4, 0, 2, 4, 0, 1, 4, 0, 0, 4, 0, 0, 5, 0, 65535, 5, 0, 65534, 5, 0, 65533, 5, 0, 65533, 4, 0, 65532, 4, 0, 65534, 4, 0, 65535, 4, 0, 3, 5, 0, 4, 5, 0, 5, 5, 0, 2, 5, 0, 1, 5, 0, 65532, 5, 0, 65531, 5, 0, 65531, 4, 0, 65531, 3, 0, 65531, 2, 0, 65531, 1, 0, 65530, 1, 0, 65530, 0, 0, 65530, 65535, 0, 65530, 65534, 0, 65530, 65533, 0, 65531, 65534, 0, 65531, 65535, 0, 65531, 0, 0, 65531, 65533, 0, 65531, 65532, 0, 65531, 65531, 0, 65532, 65531, 0, 65533, 65531, 0, 65534, 65531, 0, 65535, 65531, 0, 0, 65531, 0, 6, 65531, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 6, 0, 0, 6, 65535, 0, 6, 65534, 0, 5, 0, 0, 7, 65535, 0, 7, 65534, 0, 8, 65533, 0, 8, 65534, 0, 7, 0, 0, 6, 1, 0, 6, 2, 0, 6, 4, 0, 6, 3, 0, 7, 2, 0, 7, 1, 0, 8, 1, 0, 8, 0, 0, 1, 1, 1441792, 0, 1, 1441792, 3, 0, 1441792, 4, 0, 1441792, 4, 65535, 1441792, 3, 65535, 1441792, 2, 65534, 1441792, 2, 65533, 1441792, 1, 65533, 1441792, 1, 65532, 1441792, 1, 65531, 1441792, 2, 65531, 1441792, 2, 65530, 1441792, 3, 65530, 1441792, 3, 65531, 1441792, 2, 65532, 1441792, 4, 65532, 1441792, 4, 65531, 1441792, 5, 65531, 1441792, 5, 65532, 1441792, 5, 65533, 1441792, 5, 65534, 1441792, 5, 65535, 1441792, 4, 65534, 1441792, 4, 65533, 1441792, 6, 65533, 1441792, 6, 65532, 1441792, 3, 65532, 1441792, 3, 65533, 1441792, 3, 65534, 1441792, 2, 65535, 1441792, 2, 0, 1441792, 0, 0, 1441792) +"cells": PackedInt32Array(0, 65535, 0, 65535, 65535, 0, 65535, 0, 0, 65534, 0, 0, 65534, 65535, 0, 65534, 65534, 0, 65535, 65534, 0, 0, 65534, 0, 1, 65534, 0, 1, 65535, 0, 1, 0, 0, 65535, 1, 0, 65534, 1, 0, 1, 2, 0, 0, 2, 0, 65535, 2, 0, 65534, 2, 0, 65533, 2, 655360, 65533, 1, 0, 65533, 0, 0, 65533, 65535, 0, 65533, 65534, 0, 65533, 65533, 0, 65534, 65533, 0, 0, 65533, 0, 65535, 65533, 0, 2, 1, 0, 3, 2, 0, 3, 1, 0, 0, 65532, 0, 65535, 65532, 0, 65534, 65532, 0, 65533, 65532, 0, 65532, 65532, 0, 65532, 65533, 0, 65532, 65534, 0, 65532, 65535, 0, 65532, 1, 0, 65532, 0, 0, 65532, 2, 655360, 65532, 3, 0, 65533, 3, 0, 65534, 3, 0, 65535, 3, 0, 1, 3, 0, 2, 3, 0, 3, 3, 0, 0, 3, 0, 4, 3, 0, 4, 2, 0, 4, 1, 0, 2, 2, 0, 5, 4, 0, 4, 4, 0, 3, 4, 0, 2, 4, 0, 1, 4, 0, 0, 4, 0, 0, 5, 0, 65535, 5, 0, 65534, 5, 0, 65533, 5, 0, 65533, 4, 0, 65532, 4, 0, 65534, 4, 0, 65535, 4, 0, 3, 5, 0, 4, 5, 0, 5, 5, 0, 2, 5, 0, 1, 5, 0, 65532, 5, 0, 65531, 5, 0, 65531, 4, 0, 65531, 3, 0, 65531, 2, 0, 65531, 1, 0, 65530, 1, 0, 65530, 0, 0, 65530, 65535, 0, 65530, 65534, 0, 65530, 65533, 0, 65531, 65534, 0, 65531, 65535, 0, 65531, 0, 0, 65531, 65533, 0, 65531, 65532, 0, 65531, 65531, 0, 65532, 65531, 0, 65533, 65531, 0, 65534, 65531, 0, 65535, 65531, 0, 0, 65531, 0, 6, 65531, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 6, 0, 0, 6, 65535, 0, 6, 65534, 0, 5, 0, 0, 7, 65535, 0, 7, 65534, 0, 8, 65533, 0, 8, 65534, 0, 7, 0, 0, 6, 1, 0, 6, 2, 0, 6, 4, 0, 6, 3, 0, 7, 2, 655360, 7, 1, 0, 8, 1, 0, 8, 0, 0, 1, 1, 0, 0, 1, 0, 3, 0, 0, 4, 0, 0, 4, 65535, 1441792, 3, 65535, 0, 2, 65534, 0, 2, 65533, 0, 1, 65533, 0, 1, 65532, 0, 1, 65531, 0, 2, 65531, 0, 2, 65530, 0, 3, 65530, 0, 3, 65531, 0, 2, 65532, 0, 4, 65532, 0, 4, 65531, 0, 5, 65531, 0, 5, 65532, 0, 5, 65533, 0, 5, 65534, 0, 5, 65535, 0, 4, 65534, 0, 4, 65533, 0, 6, 65533, 0, 6, 65532, 0, 3, 65532, 0, 3, 65533, 0, 3, 65534, 0, 2, 65535, 0, 2, 0, 0, 0, 0, 0, 65530, 2, 0, 6, 5, 655360, 65529, 0, 0) } metadata/_editor_floor_ = Vector3(0, 0, 0) @@ -36,7 +52,7 @@ mesh_library = ExtResource("3_k3r2h") cell_size = Vector3(1, 1, 1) cell_center_y = false data = { -"cells": PackedInt32Array(65531, 65530, 0, 65532, 65530, 0, 65533, 65530, 0, 65534, 65530, 0, 65535, 65530, 0, 0, 65530, 0, 1, 65530, 0, 65530, 65530, 0, 65530, 65531, 0, 65530, 65532, 0, 65529, 65531, 0, 65529, 65532, 0, 65529, 65533, 0, 65529, 65534, 0, 65529, 65535, 0, 65529, 0, 0, 65529, 1, 0, 65529, 2, 0, 65530, 2, 0, 2, 65529, 1441792, 3, 65529, 1441792, 4, 65529, 1441792, 4, 65530, 1441792, 5, 65530, 1441792, 6, 65530, 1441792, 7, 65530, 1441792, 7, 65532, 1441792, 7, 65533, 1441792, 8, 65532, 1441792, 9, 65532, 1441792, 9, 65533, 1441792, 9, 65534, 1441792, 9, 65535, 1441792, 9, 0, 1441792, 8, 65535, 1441792, 9, 1, 1441792, 9, 2, 1441792, 8, 2, 1441792, 8, 3, 1441792, 7, 3, 1441792, 7, 4, 1441792, 7, 5, 1441792, 6, 5, 1441792, 6, 6, 1441792, 5, 6, 1441792, 4, 6, 1441792, 3, 6, 1441792, 2, 6, 1441792, 1, 6, 1441792, 0, 6, 1441792, 65535, 6, 1441792, 65534, 6, 1441792, 65533, 6, 1441792, 65532, 6, 1441792, 65531, 6, 1441792, 65530, 6, 1441792, 65530, 5, 1441792, 65530, 4, 1441792, 65530, 3, 1441792, 1, 65529, 1441792, 6, 65534, 0, 5, 0, 0, 7, 65531, 1441792, 6, 65531, 1441792) +"cells": PackedInt32Array(65531, 65530, 0, 65532, 65530, 0, 65533, 65530, 0, 65534, 65530, 0, 65535, 65530, 0, 0, 65530, 0, 1, 65530, 0, 65530, 65530, 0, 65530, 65531, 0, 65530, 65532, 0, 65529, 65531, 0, 65529, 65532, 0, 65529, 65533, 0, 65529, 65534, 0, 65529, 65535, 0, 65529, 0, 0, 65529, 1, 0, 65529, 2, 0, 65530, 2, 655361, 2, 65529, 1441792, 3, 65529, 1441792, 4, 65529, 1441792, 4, 65530, 1441792, 5, 65530, 1441792, 6, 65530, 1441792, 7, 65530, 1441792, 7, 65532, 1441792, 7, 65533, 1441792, 8, 65532, 1441792, 9, 65532, 1441792, 9, 65533, 1441792, 9, 65534, 1441792, 9, 65535, 1441792, 9, 0, 1441792, 8, 65535, 1441792, 9, 1, 1441792, 9, 2, 1441792, 8, 2, 1441792, 8, 3, 1441792, 7, 3, 1441792, 7, 4, 1441792, 7, 5, 1441792, 6, 5, 1441792, 6, 6, 1441792, 5, 6, 1441792, 4, 6, 1441792, 3, 6, 1441792, 2, 6, 1441792, 1, 6, 1441792, 0, 6, 1441792, 65535, 6, 1441792, 65534, 6, 1441792, 65533, 6, 1441792, 65532, 6, 1441792, 65531, 6, 1441792, 65530, 6, 1441792, 65530, 5, 1441792, 65530, 4, 1441792, 65530, 3, 1441792, 1, 65529, 1441792, 6, 65534, 0, 5, 0, 0, 7, 65531, 1441792, 6, 65531, 1441792, 65531, 4, 0, 65531, 5, 0, 65532, 5, 0, 65533, 5, 655361, 65532, 4, 655361, 65531, 3, 655361) } metadata/_editor_floor_ = Vector3(0, 0, 0) @@ -45,10 +61,16 @@ environment = SubResource("Environment_0oogp") [node name="CannyCat" parent="." instance=ExtResource("1_8qiqb")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.926551, 3.63641) +power_line_material = SubResource("StandardMaterial3D_77yoh") [node name="GoalPost" parent="." instance=ExtResource("4_71ems")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, -2.38419e-07, -4) -[node name="CSGPolygon3D" parent="." instance=ExtResource("5_7n16u")] +[node name="SandPit" parent="." instance=ExtResource("5_7n16u")] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 2, 0, -4) polygon = PackedVector2Array(0, -1, 1, -1, 3, 0, 3, 2, 2, 3, -1, 2, -2, 0) + +[node name="Boney" parent="." instance=ExtResource("6_gpbt0")] +transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 1.98854, 0, 1.02292) +speed = 1.0 +rotation_speed = 3.14159