afterimage

master
chendian 2 years ago
parent 8885f58b83
commit a363d83355

@ -77,3 +77,26 @@ tracks/5/keys = {
"update": 1,
"values": [4.0, 0.0]
}
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Effect")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"values": [{
"args": [],
"method": &"cast_after_image"
}, {
"args": [],
"method": &"cast_after_image"
}, {
"args": [],
"method": &"cast_after_image"
}, {
"args": [],
"method": &"cast_after_image"
}]
}

@ -1,16 +1,17 @@
[gd_scene load_steps=14 format=3 uid="uid://ksxwg0alt2us"]
[gd_scene load_steps=15 format=3 uid="uid://ksxwg0alt2us"]
[ext_resource type="Script" path="res://script/character/character.gd" id="1_tonbs"]
[ext_resource type="Script" path="res://script/character/status.gd" id="2_txdip"]
[ext_resource type="Shader" path="res://render/shader/character.gdshader" id="3_ed424"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_q8i10"]
[ext_resource type="Script" path="res://script/character/move.gd" id="4_66r53"]
[ext_resource type="Texture2D" uid="uid://daqn6aqfp1hva" path="res://resource/animation/character/hero01_long_attack.png" id="4_fcd8a"]
[ext_resource type="Script" path="res://script/character/view.gd" id="4_vijjv"]
[ext_resource type="SpriteFrames" uid="uid://dhfqj1dxldqao" path="res://resource/animation/character/hero01_long_skill01.aseprite" id="5_7jbf8"]
[ext_resource type="Script" path="res://script/character/skill.gd" id="6_h4xqy"]
[ext_resource type="AnimationLibrary" uid="uid://croik07a1qko5" path="res://resource/skill_animation_library/animation_library.tres" id="6_pakq5"]
[ext_resource type="Script" path="res://script/character/battle.gd" id="8_w84sf"]
[ext_resource type="Script" path="res://script/character/buff.gd" id="9_jlnhy"]
[ext_resource type="Script" path="res://script/character/effect.gd" id="12_eyfcd"]
[sub_resource type="BoxShape3D" id="BoxShape3D_ty8lx"]
@ -31,8 +32,6 @@ shape = SubResource("BoxShape3D_ty8lx")
[node name="Status" type="Node3D" parent="."]
unique_name_in_owner = true
script = ExtResource("2_txdip")
speed_up_rate = -1.0
break_level = 4
[node name="View" type="AnimatedSprite3D" parent="."]
unique_name_in_owner = true
@ -44,9 +43,8 @@ gi_mode = 0
double_sided = false
alpha_cut = 2
texture_filter = 0
sprite_frames = ExtResource("3_q8i10")
animation = &"long_air_attack01"
frame = 8
sprite_frames = ExtResource("5_7jbf8")
animation = &"long_flash"
script = ExtResource("4_vijjv")
[node name="Move" type="Node3D" parent="."]
@ -68,5 +66,9 @@ script = ExtResource("8_w84sf")
unique_name_in_owner = true
script = ExtResource("9_jlnhy")
[node name="Effect" type="Node3D" parent="."]
unique_name_in_owner = true
script = ExtResource("12_eyfcd")
[connection signal="animation_finished" from="View" to="View" method="_on_animation_finished"]
[connection signal="animation_finished" from="Skill" to="Skill" method="_on_animation_finished"]

@ -0,0 +1,9 @@
[gd_scene load_steps=3 format=3 uid="uid://b12fa5bpdmhms"]
[ext_resource type="SpriteFrames" uid="uid://cwe8setoi6bd" path="res://resource/animation/character/hero01_move.aseprite" id="1_1twno"]
[ext_resource type="Script" path="res://script/effect/afterimage.gd" id="2_grtq1"]
[node name="AfterImage" type="AnimatedSprite3D"]
sprite_frames = ExtResource("1_1twno")
animation = &"idle_loop"
script = ExtResource("2_grtq1")

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://bkhnhc6bk3w7l"]
[gd_scene load_steps=12 format=3 uid="uid://bkhnhc6bk3w7l"]
[ext_resource type="Script" path="res://script/manager/game_manager.gd" id="1_q2t80"]
[ext_resource type="ArrayMesh" uid="uid://cap7t5iwpjpi2" path="res://resource/level/levelground0000.vox" id="1_u51ir"]
@ -9,6 +9,7 @@
[ext_resource type="PackedScene" uid="uid://cc525u8auypjf" path="res://scene/ui/profile_screen.tscn" id="6_u1fxn"]
[ext_resource type="PackedScene" uid="uid://126wph4owvoy" path="res://scene/ui/hud_screen.tscn" id="7_gx646"]
[ext_resource type="Texture2D" uid="uid://bjv7f83tdgq17" path="res://render/texture/explodeDecal.png" id="7_hqv3v"]
[ext_resource type="Script" path="res://script/manager/effect_manager.gd" id="8_0jv87"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_2mxa4"]
data = PackedVector3Array(-6.4, 0, -6.4, -3.2, 0, -6.4, -3.2, 0, 6.4, -3.2, 0, 6.4, -6.4, 0, 6.4, -6.4, 0, -6.4, -3.2, 0, 3.2, 6.4, 0, 3.2, 6.4, 0, 6.4, 6.4, 0, 6.4, -3.2, 0, 6.4, -3.2, 0, 3.2, -3.2, 0, -3.2, 3.2, 0, -3.2, 3.2, 0, 3.2, 3.2, 0, 3.2, -3.2, 0, 3.2, -3.2, 0, -3.2, -3.2, 0, -6.4, 6.4, 0, -6.4, 6.4, 0, -3.2, 6.4, 0, -3.2, -3.2, 0, -3.2, -3.2, 0, -6.4, 3.2, 0, -3.2, 6.4, 0, -3.2, 6.4, 0, 3.2, 6.4, 0, 3.2, 3.2, 0, 3.2, 3.2, 0, -3.2, -3.2, -0.1, 6.4, -3.2, -0.1, -6.4, -6.4, -0.1, -6.4, -6.4, -0.1, -6.4, -6.4, -0.1, 6.4, -3.2, -0.1, 6.4, 6.4, -0.1, 6.4, 6.4, -0.1, 3.2, -3.2, -0.1, 3.2, -3.2, -0.1, 3.2, -3.2, -0.1, 6.4, 6.4, -0.1, 6.4, 3.2, -0.1, 3.2, 3.2, -0.1, -3.2, -3.2, -0.1, -3.2, -3.2, -0.1, -3.2, -3.2, -0.1, 3.2, 3.2, -0.1, 3.2, 6.4, -0.1, -3.2, 6.4, -0.1, -6.4, -3.2, -0.1, -6.4, -3.2, -0.1, -6.4, -3.2, -0.1, -3.2, 6.4, -0.1, -3.2, 6.4, -0.1, 3.2, 6.4, -0.1, -3.2, 3.2, -0.1, -3.2, 3.2, -0.1, -3.2, 3.2, -0.1, 3.2, 6.4, -0.1, 3.2, -6.4, 0, -6.4, -6.4, 0, 6.4, -6.4, -0.1, 6.4, -6.4, -0.1, 6.4, -6.4, -0.1, -6.4, -6.4, 0, -6.4, 6.4, 0, -6.4, 6.4, -0.1, -6.4, 6.4, -0.1, 6.4, 6.4, -0.1, 6.4, 6.4, 0, 6.4, 6.4, 0, -6.4, -6.4, -0.1, 6.4, -6.4, 0, 6.4, 6.4, 0, 6.4, 6.4, 0, 6.4, 6.4, -0.1, 6.4, -6.4, -0.1, 6.4, 6.4, 0, -6.4, -6.4, 0, -6.4, -6.4, -0.1, -6.4, -6.4, -0.1, -6.4, 6.4, -0.1, -6.4, 6.4, 0, -6.4)
@ -59,6 +60,9 @@ script = ExtResource("4_oonkb")
[node name="HudScreen" parent="GameManager/UIManager" instance=ExtResource("7_gx646")]
[node name="EffectManager" type="Node3D" parent="GameManager"]
script = ExtResource("8_0jv87")
[node name="EditorTool" type="Node3D" parent="."]
script = ExtResource("5_n3qhi")

@ -24,6 +24,7 @@ func build_view(cfg:CharacterCfg):
collision.position = Vector3(0,half_height,0)
collision.scale = Vector3(width,half_height*2,width)
status.basic_offset = Vector3(0,half_height,0)
view.scale = Vector3(1,Setting.sprite_scale,1)
view.init(cfg.sprite_frames)
skill.init()
@ -41,6 +42,7 @@ func manager()->CharacterManager:return character_manager
func id()->int:return status.id
func team()->Enum.ETeam:return status.team
func pos()->Vector2:return Vector2(position.x,position.z)
func view_pos()->Vector3:return position + view.position
#==interface==
func set_pos(pos:Vector3):position = pos

@ -0,0 +1,20 @@
extends Node
@onready var afterimage = preload("res://scene/effect/afterimage/normal.tscn")
@onready var character = (get_owner() as Character)
@onready var view = (%View as View)
func _ready():
pass # Replace with function body.
func _process(delta):
pass
func cast_after_image():
var new_afterimage = afterimage.instantiate() as Afterimage
new_afterimage.position = character.view_pos()
new_afterimage.name = "afterimage"
new_afterimage.velocity = character.velocity / 4
view.clone(new_afterimage)
SignalManager.effect_create.emit(new_afterimage)

@ -138,4 +138,10 @@ func update_texture():
func update_flash_white():
var material = material_override as ShaderMaterial
material.set_shader_parameter("flash_white",status.flash_white_rate)
func clone(target:AnimatedSprite3D):
target.sprite_frames = sprite_frames
target.animation = animation
target.frame = frame
target.frame_progress = frame_progress
target.scale = scale

@ -0,0 +1,22 @@
extends AnimatedSprite3D
class_name Afterimage
@export var duration_max:float = 0.2
@export var is_moving:bool = true
var duration:float
var velocity:Vector3
func _ready():
duration = duration_max
func _process(delta):
if is_moving:
position += velocity*delta
var rate = duration / duration_max
modulate.a = rate
duration-=delta
if duration<=0:
queue_free()

@ -0,0 +1,11 @@
extends Node3D
func _ready():
SignalManager.effect_create.connect(on_effect_create)
func _process(delta):
pass
func on_effect_create(effect:Node3D):
add_child(effect)

@ -4,3 +4,6 @@ extends Node3D
signal input_action_pressed
signal input_action_released
signal input_action_move(Vector2)
#effect
signal effect_create

Loading…
Cancel
Save