bony cronies
This commit is contained in:
parent
b5ad55e70f
commit
4a7cc4c401
10 changed files with 143 additions and 1 deletions
BIN
assets/models/enemies/boney.blend
Normal file
BIN
assets/models/enemies/boney.blend
Normal file
Binary file not shown.
BIN
assets/models/enemies/boney.blend1
Normal file
BIN
assets/models/enemies/boney.blend1
Normal file
Binary file not shown.
BIN
assets/models/enemies/boney.glb
Normal file
BIN
assets/models/enemies/boney.glb
Normal file
Binary file not shown.
47
assets/models/enemies/boney.glb.import
Normal file
47
assets/models/enemies/boney.glb.import
Normal file
|
@ -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
|
BIN
assets/models/enemies/boney/eyes.material
Normal file
BIN
assets/models/enemies/boney/eyes.material
Normal file
Binary file not shown.
BIN
assets/models/enemies/boney/head.material
Normal file
BIN
assets/models/enemies/boney/head.material
Normal file
Binary file not shown.
15
default_bus_layout.tres
Normal file
15
default_bus_layout.tres
Normal file
|
@ -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"
|
35
objects/boney.gd
Normal file
35
objects/boney.gd
Normal file
|
@ -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)
|
45
objects/boney.tscn
Normal file
45
objects/boney.tscn
Normal file
|
@ -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]
|
|
@ -158,9 +158,9 @@ delay_in_seconds = "0.0"
|
||||||
script = ExtResource("6_bu01i")
|
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/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="_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="_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_entered" from="StateChart/Root/Charging" to="." method="_start_charge"]
|
||||||
[connection signal="state_exited" from="StateChart/Root/Charging" to="." method="_end_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"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Charging" to="." method="_update_charge"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue