monster spawner and moving to the camera direction
This commit is contained in:
parent
8c29b8bffd
commit
b20f3b5124
821 changed files with 1611 additions and 1409 deletions
96
assets/models/gobot/gobot_skin.gd
Normal file
96
assets/models/gobot/gobot_skin.gd
Normal 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)
|
||||
2174
assets/models/gobot/gobot_skin.tscn
Normal file
2174
assets/models/gobot/gobot_skin.tscn
Normal file
File diff suppressed because it is too large
Load diff
10
assets/models/gobot/materials/eye_mat.tres
Normal file
10
assets/models/gobot/materials/eye_mat.tres
Normal 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://assets/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
|
||||
BIN
assets/models/gobot/model/custom/custom_lib.res
Normal file
BIN
assets/models/gobot/model/custom/custom_lib.res
Normal file
Binary file not shown.
BIN
assets/models/gobot/model/custom/custom_lib.res.depren
Normal file
BIN
assets/models/gobot/model/custom/custom_lib.res.depren
Normal file
Binary file not shown.
BIN
assets/models/gobot/model/custom/hurt.res
Normal file
BIN
assets/models/gobot/model/custom/hurt.res
Normal file
Binary file not shown.
BIN
assets/models/gobot/model/custom/hurt.res.depren
Normal file
BIN
assets/models/gobot/model/custom/hurt.res.depren
Normal file
Binary file not shown.
BIN
assets/models/gobot/model/custom/run_step.res
Normal file
BIN
assets/models/gobot/model/custom/run_step.res
Normal file
Binary file not shown.
BIN
assets/models/gobot/model/gobot.glb
Normal file
BIN
assets/models/gobot/model/gobot.glb
Normal file
Binary file not shown.
5436
assets/models/gobot/model/gobot.glb.import
Normal file
5436
assets/models/gobot/model/gobot.glb.import
Normal file
File diff suppressed because it is too large
Load diff
BIN
assets/models/gobot/model/gobot_gobot_diffuse.png
Normal file
BIN
assets/models/gobot/model/gobot_gobot_diffuse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
35
assets/models/gobot/model/gobot_gobot_diffuse.png.import
Normal file
35
assets/models/gobot/model/gobot_gobot_diffuse.png.import
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bt5o0sr6peltq"
|
||||
path="res://.godot/imported/gobot_gobot_diffuse.png-cb197b72fb26f3a9ce9537a926b87b11.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/gobot/model/gobot_gobot_diffuse.png"
|
||||
dest_files=["res://.godot/imported/gobot_gobot_diffuse.png-cb197b72fb26f3a9ce9537a926b87b11.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
|
||||
BIN
assets/models/gobot/model/gobot_gobot_normal.png
Normal file
BIN
assets/models/gobot/model/gobot_gobot_normal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 338 KiB |
35
assets/models/gobot/model/gobot_gobot_normal.png.import
Normal file
35
assets/models/gobot/model/gobot_gobot_normal.png.import
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d28w5bql3g21l"
|
||||
path="res://.godot/imported/gobot_gobot_normal.png-863637192050a1a25e34f54c741cd987.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/gobot/model/gobot_gobot_normal.png"
|
||||
dest_files=["res://.godot/imported/gobot_gobot_normal.png-863637192050a1a25e34f54c741cd987.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
|
||||
BIN
assets/models/gobot/model/gobot_gobot_roughness.png
Normal file
BIN
assets/models/gobot/model/gobot_gobot_roughness.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
35
assets/models/gobot/model/gobot_gobot_roughness.png.import
Normal file
35
assets/models/gobot/model/gobot_gobot_roughness.png.import
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cgkj45d67dalm"
|
||||
path="res://.godot/imported/gobot_gobot_roughness.png-5af3322df24f8726044f911696b38e97.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/gobot/model/gobot_gobot_roughness.png"
|
||||
dest_files=["res://.godot/imported/gobot_gobot_roughness.png-5af3322df24f8726044f911696b38e97.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
|
||||
BIN
assets/models/gobot/textures/closed_eyes.png
Normal file
BIN
assets/models/gobot/textures/closed_eyes.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
36
assets/models/gobot/textures/closed_eyes.png.import
Normal file
36
assets/models/gobot/textures/closed_eyes.png.import
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cfdf62ci74tew"
|
||||
path.s3tc="res://.godot/imported/closed_eyes.png-3db4539d1a34ce3b15586911025c6960.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/closed_eyes.png-3db4539d1a34ce3b15586911025c6960.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/gobot/textures/closed_eyes.png"
|
||||
dest_files=["res://.godot/imported/closed_eyes.png-3db4539d1a34ce3b15586911025c6960.s3tc.ctex", "res://.godot/imported/closed_eyes.png-3db4539d1a34ce3b15586911025c6960.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
|
||||
BIN
assets/models/gobot/textures/hurt_eyes.png
Normal file
BIN
assets/models/gobot/textures/hurt_eyes.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
36
assets/models/gobot/textures/hurt_eyes.png.import
Normal file
36
assets/models/gobot/textures/hurt_eyes.png.import
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://yj5yx07nva6l"
|
||||
path.s3tc="res://.godot/imported/hurt_eyes.png-9cfbc0da7da452578ce339ea9e562cf7.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/hurt_eyes.png-9cfbc0da7da452578ce339ea9e562cf7.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/gobot/textures/hurt_eyes.png"
|
||||
dest_files=["res://.godot/imported/hurt_eyes.png-9cfbc0da7da452578ce339ea9e562cf7.s3tc.ctex", "res://.godot/imported/hurt_eyes.png-9cfbc0da7da452578ce339ea9e562cf7.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
|
||||
BIN
assets/models/gobot/textures/open_eye.png
Normal file
BIN
assets/models/gobot/textures/open_eye.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
36
assets/models/gobot/textures/open_eye.png.import
Normal file
36
assets/models/gobot/textures/open_eye.png.import
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dq675fmt1rg8c"
|
||||
path.s3tc="res://.godot/imported/open_eye.png-c420b95a0de2488d71a0d5d6ced9535b.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/open_eye.png-c420b95a0de2488d71a0d5d6ced9535b.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/gobot/textures/open_eye.png"
|
||||
dest_files=["res://.godot/imported/open_eye.png-c420b95a0de2488d71a0d5d6ced9535b.s3tc.ctex", "res://.godot/imported/open_eye.png-c420b95a0de2488d71a0d5d6ced9535b.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
|
||||
Loading…
Add table
Add a link
Reference in a new issue