debug level and character added

This commit is contained in:
Luca 2024-09-15 16:39:11 +02:00
parent f48d6575cb
commit 554d81b912
35 changed files with 8472 additions and 0 deletions

View file

@ -0,0 +1,96 @@
extends Node3D
## Emitted when Gobot's feet hit the ground will running.
signal foot_step
## Gobot's MeshInstance3D model.
@export var gobot_model: MeshInstance3D
## Determines whether blinking is enabled or disabled.
@export var blink = true : set = _set_blink
@export var _left_eye_mat_override: String
@export var _right_eye_mat_override: String
@export var _open_eye: CompressedTexture2D
@export var _close_eye: CompressedTexture2D
@onready var _animation_tree: AnimationTree = %AnimationTree
@onready var _state_machine: AnimationNodeStateMachinePlayback = _animation_tree.get(
"parameters/StateMachine/playback"
)
@onready var _flip_shot_path: String = "parameters/FlipShot/request"
@onready var _hurt_shot_path: String = "parameters/HurtShot/request"
@onready var _blink_timer = %BlinkTimer
@onready var _closed_eyes_timer = %ClosedEyesTimer
@onready var _left_eye_mat: StandardMaterial3D = gobot_model.get(_left_eye_mat_override)
@onready var _right_eye_mat: StandardMaterial3D = gobot_model.get(_right_eye_mat_override)
func _ready():
_blink_timer.connect(
"timeout",
func():
_left_eye_mat.albedo_texture = _close_eye
_right_eye_mat.albedo_texture = _close_eye
_closed_eyes_timer.start(0.2)
)
_closed_eyes_timer.connect(
"timeout",
func():
_left_eye_mat.albedo_texture = _open_eye
_right_eye_mat.albedo_texture = _open_eye
_blink_timer.start(randf_range(1.0, 8.0))
)
func _set_blink(state: bool):
if blink == state:
return
blink = state
if blink:
_blink_timer.start(0.2)
#else:
#_blink_timer.stop()
#_closed_eyes_timer.stop()
## Sets the model to a neutral, action-free state.
func idle():
_state_machine.travel("Idle")
## Sets the model to a running animation or forward movement.
func run():
_state_machine.travel("Run")
## Sets the model to an upward-leaping animation, simulating a jump.
func jump():
_state_machine.travel("Jump")
## Sets the model to a downward animation, imitating a fall.
func fall():
_state_machine.travel("Fall")
## Sets the model to an edge-grabbing animation.
func edge_grab():
_state_machine.travel("EdgeGrab")
## Sets the model to a wall-sliding animation.
func wall_slide():
_state_machine.travel("WallSlide")
## Plays a one-shot front-flip animation.
## This animation does not play in parallel with other states.
func flip():
_animation_tree.set(_flip_shot_path, true)
## Makes a victory sign.
func victory_sign():
_state_machine.travel("VictorySign")
## Plays a one-shot hurt animation.
## This animation plays in parallel with other states.
func hurt():
_animation_tree.set(_hurt_shot_path, true)
var tween := create_tween().set_ease(Tween.EASE_OUT)
tween.tween_property(self, "scale", Vector3(1.2, 0.8, 1.2), 0.1)
tween.tween_property(self, "scale", Vector3.ONE, 0.2)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://div0enqs04w5j"]
[ext_resource type="Texture2D" uid="uid://dq675fmt1rg8c" path="res://resources/models/gobot/textures/open_eye.png" id="1_5dt3l"]
[resource]
resource_local_to_scene = true
albedo_texture = ExtResource("1_5dt3l")
roughness = 0.6
uv1_offset = Vector3(0.1, 0, 0)
texture_repeat = false

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bt5o0sr6peltq"
path="res://.godot/imported/gobot_gobot_diffuse.png-3a09c07c2f365b6cf38415d4f01e0232.ctex"
metadata={
"vram_texture": false
}
generator_parameters={}
[deps]
source_file="res://resources/models/gobot/model/gobot_gobot_diffuse.png"
dest_files=["res://.godot/imported/gobot_gobot_diffuse.png-3a09c07c2f365b6cf38415d4f01e0232.ctex"]
[params]
compress/mode=3
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.

After

Width:  |  Height:  |  Size: 338 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d28w5bql3g21l"
path="res://.godot/imported/gobot_gobot_normal.png-1b6403f54d98d8c969769148dd9cbf43.ctex"
metadata={
"vram_texture": false
}
generator_parameters={}
[deps]
source_file="res://resources/models/gobot/model/gobot_gobot_normal.png"
dest_files=["res://.godot/imported/gobot_gobot_normal.png-1b6403f54d98d8c969769148dd9cbf43.ctex"]
[params]
compress/mode=3
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://gobot_gobot_normal.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgkj45d67dalm"
path="res://.godot/imported/gobot_gobot_roughness.png-3453d84acb579664ca9350901634695c.ctex"
metadata={
"vram_texture": false
}
generator_parameters={}
[deps]
source_file="res://resources/models/gobot/model/gobot_gobot_roughness.png"
dest_files=["res://.godot/imported/gobot_gobot_roughness.png-3453d84acb579664ca9350901634695c.ctex"]
[params]
compress/mode=3
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.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfdf62ci74tew"
path.s3tc="res://.godot/imported/closed_eyes.png-80501b2aef93a2e67ccfe982a2d17bf8.s3tc.ctex"
path.etc2="res://.godot/imported/closed_eyes.png-80501b2aef93a2e67ccfe982a2d17bf8.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://resources/models/gobot/textures/closed_eyes.png"
dest_files=["res://.godot/imported/closed_eyes.png-80501b2aef93a2e67ccfe982a2d17bf8.s3tc.ctex", "res://.godot/imported/closed_eyes.png-80501b2aef93a2e67ccfe982a2d17bf8.etc2.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://yj5yx07nva6l"
path.s3tc="res://.godot/imported/hurt_eyes.png-fdffc9723dccbd5767c0f80fa5acb35a.s3tc.ctex"
path.etc2="res://.godot/imported/hurt_eyes.png-fdffc9723dccbd5767c0f80fa5acb35a.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://resources/models/gobot/textures/hurt_eyes.png"
dest_files=["res://.godot/imported/hurt_eyes.png-fdffc9723dccbd5767c0f80fa5acb35a.s3tc.ctex", "res://.godot/imported/hurt_eyes.png-fdffc9723dccbd5767c0f80fa5acb35a.etc2.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dq675fmt1rg8c"
path.s3tc="res://.godot/imported/open_eye.png-61c7e46592ec9c244fff28cc237fd4c9.s3tc.ctex"
path.etc2="res://.godot/imported/open_eye.png-61c7e46592ec9c244fff28cc237fd4c9.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://resources/models/gobot/textures/open_eye.png"
dest_files=["res://.godot/imported/open_eye.png-61c7e46592ec9c244fff28cc237fd4c9.s3tc.ctex", "res://.godot/imported/open_eye.png-61c7e46592ec9c244fff28cc237fd4c9.etc2.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