This commit is contained in:
Rosia E Evans 2024-08-18 23:21:19 +01:00
parent 941c2a0bed
commit 4f3495d5d4
14 changed files with 615 additions and 0 deletions

BIN
assets/person.glb Normal file

Binary file not shown.

36
assets/person.glb.import Normal file
View file

@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dgb2a8uf8jr08"
path="res://.godot/imported/person.glb-cbfda8d38ee13679c66cf795c9b00e10.scn"
[deps]
source_file="res://assets/person.glb"
dest_files=["res://.godot/imported/person.glb-cbfda8d38ee13679c66cf795c9b00e10.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

BIN
assets/smoke.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

35
assets/smoke.jpg.import Normal file
View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dtgjt1rk7ph6n"
path.s3tc="res://.godot/imported/smoke.jpg-3cfca46701e609fb1a344ee0dda881e6.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/smoke.jpg"
dest_files=["res://.godot/imported/smoke.jpg-3cfca46701e609fb1a344ee0dda881e6.s3tc.ctex"]
[params]
compress/mode=2
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

BIN
assets/smoke.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

35
assets/smoke.png.import Normal file
View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d20ttydfqwf1f"
path.s3tc="res://.godot/imported/smoke.png-dd48eb81a12e0cb45caa95e293df3180.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/smoke.png"
dest_files=["res://.godot/imported/smoke.png-dd48eb81a12e0cb45caa95e293df3180.s3tc.ctex"]
[params]
compress/mode=2
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

BIN
raw_assets/scene.bin Normal file

Binary file not shown.

313
raw_assets/scene.gltf Normal file
View file

@ -0,0 +1,313 @@
{
"accessors": [
{
"bufferView": 2,
"componentType": 5126,
"count": 585,
"max": [
1.3362274169921875,
0.8191208243370056,
1.0787016153335571
],
"min": [
-1.3362274169921875,
-1.2603507041931152,
-6.01973819732666
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 7020,
"componentType": 5126,
"count": 585,
"max": [
0.9998482465744019,
0.9999340176582336,
0.9893576502799988
],
"min": [
-0.9998482465744019,
-0.9998955726623535,
-0.9984139800071716
],
"type": "VEC3"
},
{
"bufferView": 1,
"componentType": 5126,
"count": 585,
"max": [
0.8750001192092896,
1.0000001192092896
],
"min": [
0.0,
0.0
],
"type": "VEC2"
},
{
"bufferView": 0,
"componentType": 5125,
"count": 2634,
"type": "SCALAR"
},
{
"bufferView": 2,
"byteOffset": 14040,
"componentType": 5126,
"count": 680,
"max": [
4.225821495056152,
0.66129469871521,
2.1554882526397705
],
"min": [
-4.225821495056152,
-0.9532816410064697,
-1.0287917852401733
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 22200,
"componentType": 5126,
"count": 680,
"max": [
0.9869827032089233,
0.9998786449432373,
0.9965366721153259
],
"min": [
-0.9869828224182129,
-0.9995670914649963,
-0.9968152046203613
],
"type": "VEC3"
},
{
"bufferView": 1,
"byteOffset": 4680,
"componentType": 5126,
"count": 680,
"max": [
0.8750001192092896,
1.0000001192092896
],
"min": [
0.0,
0.0
],
"type": "VEC2"
},
{
"bufferView": 0,
"byteOffset": 10536,
"componentType": 5125,
"count": 3306,
"type": "SCALAR"
}
],
"asset": {
"extras": {
"author": "Seifert (https://sketchfab.com/Peter_Seifert)",
"license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)",
"source": "https://sketchfab.com/3d-models/stylized-male-body-base-mesh-low-poly-9d76397c9fb34e6ca04646c2e75dcf8d",
"title": "Stylized Male body Base mesh - Low Poly"
},
"generator": "Sketchfab-16.28.0",
"version": "2.0"
},
"bufferViews": [
{
"buffer": 0,
"byteLength": 23760,
"name": "floatBufferViews",
"target": 34963
},
{
"buffer": 0,
"byteLength": 10120,
"byteOffset": 23760,
"byteStride": 8,
"name": "floatBufferViews",
"target": 34962
},
{
"buffer": 0,
"byteLength": 30360,
"byteOffset": 33880,
"byteStride": 12,
"name": "floatBufferViews",
"target": 34962
}
],
"buffers": [
{
"byteLength": 64240,
"uri": "scene.bin"
}
],
"materials": [
{
"doubleSided": true,
"name": "Material.001",
"pbrMetallicRoughness": {
"baseColorFactor": [
0.8,
0.8,
0.8,
1.0
],
"metallicFactor": 0.0,
"roughnessFactor": 0.8211145618000169
}
},
{
"doubleSided": true,
"name": "Material.002",
"pbrMetallicRoughness": {
"baseColorFactor": [
0.8,
0.8,
0.8,
1.0
],
"metallicFactor": 0.0,
"roughnessFactor": 0.8211145618000169
}
}
],
"meshes": [
{
"name": "ELFEBEN 2024 MALE_Material.001_0",
"primitives": [
{
"attributes": {
"NORMAL": 1,
"POSITION": 0,
"TEXCOORD_0": 2
},
"indices": 3,
"material": 0,
"mode": 4
}
]
},
{
"name": "ELFEBEN 2024 MALE_Material.002_0",
"primitives": [
{
"attributes": {
"NORMAL": 5,
"POSITION": 4,
"TEXCOORD_0": 6
},
"indices": 7,
"material": 1,
"mode": 4
}
]
}
],
"nodes": [
{
"children": [
1
],
"matrix": [
1.0,
0.0,
0.0,
0.0,
0.0,
2.220446049250313e-16,
-1.0,
0.0,
0.0,
1.0,
2.220446049250313e-16,
0.0,
0.0,
0.0,
0.0,
1.0
],
"name": "Sketchfab_model"
},
{
"children": [
2
],
"matrix": [
0.009999999776482582,
0.0,
0.0,
0.0,
0.0,
0.0,
0.009999999776482582,
0.0,
0.0,
-0.009999999776482582,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0
],
"name": "3196e207becc4d23ad1a094f3db5fcca.fbx"
},
{
"children": [
3
],
"name": "RootNode"
},
{
"children": [
4,
5
],
"matrix": [
20.275297164916992,
0.0,
0.0,
0.0,
0.0,
-2.772860318382524e-06,
-17.019695281982198,
0.0,
0.0,
23.688793182372734,
-3.859394279244801e-06,
0.0,
0.0,
143.72398376464844,
-1.0343460417061578e-05,
1.0
],
"name": "ELFEBEN 2024 MALE"
},
{
"mesh": 0,
"name": "ELFEBEN 2024 MALE_Material.001_0"
},
{
"mesh": 1,
"name": "ELFEBEN 2024 MALE_Material.002_0"
}
],
"scene": 0,
"scenes": [
{
"name": "Sketchfab_Scene",
"nodes": [
0
]
}
]
}

View file

@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bd46w0dnc6sbu"
path="res://.godot/imported/scene.gltf-436dd1325d542ade5080354706bfe3c3.scn"
[deps]
source_file="res://raw_assets/scene.gltf"
dest_files=["res://.godot/imported/scene.gltf-436dd1325d542ade5080354706bfe3c3.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

42
scenes/body.tscn Normal file
View file

@ -0,0 +1,42 @@
[gd_scene load_steps=7 format=3 uid="uid://dokbg0jg0lb6a"]
[ext_resource type="Script" path="res://scripts/body.gd" id="1_21au4"]
[ext_resource type="PackedScene" uid="uid://nusoljma3t55" path="res://scenes/pickaxe_arm.tscn" id="2_m4hhp"]
[ext_resource type="Script" path="res://scripts/camera.gd" id="3_mslwr"]
[sub_resource type="SphereMesh" id="SphereMesh_jcpb6"]
radius = 5.0
height = 10.0
[sub_resource type="SphereShape3D" id="SphereShape3D_16w3w"]
radius = 5.0
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_vlifr"]
plane = Plane(1000, 0, 0, 0)
[node name="Body" type="RigidBody3D"]
axis_lock_linear_x = true
axis_lock_angular_z = true
script = ExtResource("1_21au4")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("SphereMesh_jcpb6")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_16w3w")
[node name="ArmPivot" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.8945, 0)
[node name="PickaxeArm" parent="ArmPivot" instance=ExtResource("2_m4hhp")]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 32, 0, 0)
script = ExtResource("3_mslwr")
[node name="RaycastPlane" type="StaticBody3D" parent="."]
collision_layer = 2
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="RaycastPlane"]
shape = SubResource("WorldBoundaryShape3D_vlifr")

64
scenes/person.tscn Normal file
View file

@ -0,0 +1,64 @@
[gd_scene load_steps=11 format=3 uid="uid://d103qix0q2nxk"]
[ext_resource type="Script" path="res://scripts/person.gd" id="1_cq208"]
[ext_resource type="PackedScene" uid="uid://dgb2a8uf8jr08" path="res://assets/person.glb" id="2_s14ov"]
[ext_resource type="Script" path="res://scripts/fireparticles.gd" id="3_dbqx3"]
[ext_resource type="Texture2D" uid="uid://d20ttydfqwf1f" path="res://assets/smoke.png" id="4_3rvxr"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ksic7"]
emission_shape = 3
emission_box_extents = Vector3(1, 1, 1)
direction = Vector3(0, 1, 0)
initial_velocity_min = 0.1
initial_velocity_max = 1.4
gravity = Vector3(0, 0, 0)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pgvg5"]
transparency = 1
albedo_color = Color(0.477275, 0.479144, 0.470632, 1)
albedo_texture = ExtResource("4_3rvxr")
[sub_resource type="QuadMesh" id="QuadMesh_i1be6"]
material = SubResource("StandardMaterial3D_pgvg5")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_vmqhf"]
direction = Vector3(0, 1, 0)
initial_velocity_min = 4.0
initial_velocity_max = 4.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_65tyw"]
albedo_color = Color(0.897323, 0.516031, 0.403514, 1)
emission_enabled = true
emission = Color(0.95733, 0.577583, 0.247133, 1)
emission_energy_multiplier = 7.1
[sub_resource type="SphereMesh" id="SphereMesh_5e6v0"]
material = SubResource("StandardMaterial3D_65tyw")
radius = 0.01
height = 0.02
radial_segments = 4
rings = 4
[node name="Person" type="Node3D"]
script = ExtResource("1_cq208")
[node name="person" parent="." instance=ExtResource("2_s14ov")]
[node name="fire_particles" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19282, 0)
script = ExtResource("3_dbqx3")
[node name="smoke" type="GPUParticles3D" parent="fire_particles"]
amount = 66
process_material = SubResource("ParticleProcessMaterial_ksic7")
draw_pass_1 = SubResource("QuadMesh_i1be6")
[node name="glow" type="GPUParticles3D" parent="fire_particles"]
amount = 50
process_material = SubResource("ParticleProcessMaterial_vmqhf")
draw_pass_1 = SubResource("SphereMesh_5e6v0")
[node name="burst_length_timer" type="Timer" parent="."]
wait_time = 0.5
[connection signal="timeout" from="burst_length_timer" to="." method="_on_burst_length_timer_timeout"]

8
scenes/ui.tscn Normal file
View file

@ -0,0 +1,8 @@
[gd_scene format=3 uid="uid://ddebtwg42wwc2"]
[node name="UI" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
mouse_filter = 2

14
scripts/fireparticles.gd Normal file
View file

@ -0,0 +1,14 @@
@tool
extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var camera = get_viewport().get_camera_3d()
if camera == null: return
$smoke.set_global_rotation(get_global_rotation().direction_to(camera.get_global_position()))

32
scripts/person.gd Normal file
View file

@ -0,0 +1,32 @@
extends Node3D
signal scored(name)
@export var title: String
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$fire_particles/smoke.emitting = false
$fire_particles/glow.emitting = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if Input.is_action_pressed("ActivateBackLeft"):
put_to_rest()
func put_to_rest():
burst()
scored.emit(title)
func burst():
$fire_particles/smoke.emitting = true
$fire_particles/glow.emitting = true
$person.hide()
$burst_length_timer.start()
func _on_burst_length_timer_timeout() -> void:
$fire_particles/smoke.emitting = false
$fire_particles/glow.emitting = false