109 lines
2.8 KiB
Plaintext
109 lines
2.8 KiB
Plaintext
[gd_scene load_steps=8 format=3 uid="uid://4dsm0l7s6vki"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://gfxfxkfu8uk4" path="res://textures/character/character.svg" id="1_f7cgp"]
|
|
[ext_resource type="Script" path="res://data/character/character.gd" id="1_qlitf"]
|
|
|
|
[sub_resource type="CircleShape2D" id="CircleShape2D_653al"]
|
|
radius = 36.0
|
|
|
|
[sub_resource type="Animation" id="Animation_gkjmi"]
|
|
resource_name = "hit"
|
|
length = 0.6
|
|
tracks/0/type = "value"
|
|
tracks/0/imported = false
|
|
tracks/0/enabled = true
|
|
tracks/0/path = NodePath("body_pivot/body:rotation")
|
|
tracks/0/interp = 2
|
|
tracks/0/loop_wrap = true
|
|
tracks/0/keys = {
|
|
"times": PackedFloat32Array(0, 0.25, 0.5),
|
|
"transitions": PackedFloat32Array(1, 1, 1),
|
|
"update": 0,
|
|
"values": [0.0, 1.13446, 0.0]
|
|
}
|
|
|
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_se06j"]
|
|
_data = {
|
|
"hit": SubResource("Animation_gkjmi")
|
|
}
|
|
|
|
[sub_resource type="Shader" id="Shader_vjhd6"]
|
|
code = "shader_type canvas_item;
|
|
|
|
// Hue shift shader
|
|
|
|
//uniform float Shift_Hue;
|
|
|
|
void fragment() {
|
|
//float Shift_Hue = TIME/10.0;
|
|
float Shift_Hue = 0.0;
|
|
// Input:3
|
|
vec3 input_color;
|
|
vec4 texture_color = texture(TEXTURE, UV);
|
|
input_color = texture_color.rgb;
|
|
|
|
// VectorFunc:2
|
|
vec3 color_hsv;
|
|
{
|
|
vec3 c = input_color;
|
|
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
|
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
|
float d = q.x - min(q.w, q.y);
|
|
float e = 1.0e-10;
|
|
color_hsv=vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
|
}
|
|
|
|
color_hsv.x = mod((color_hsv.x + Shift_Hue), 1.0f);
|
|
|
|
// VectorFunc:5
|
|
vec3 color_rgb;
|
|
{
|
|
vec3 c = color_hsv;
|
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
|
color_rgb=c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
}
|
|
|
|
// Output:0
|
|
texture_color = vec4(color_rgb.rgb,texture_color.a);
|
|
COLOR.rgba = texture_color;
|
|
}
|
|
|
|
//void light() {
|
|
// Called for every pixel for every light affecting the CanvasItem.
|
|
//}
|
|
"
|
|
|
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qi76t"]
|
|
shader = SubResource("Shader_vjhd6")
|
|
|
|
[node name="character" type="CharacterBody2D"]
|
|
collision_layer = 3
|
|
script = ExtResource("1_qlitf")
|
|
|
|
[node name="camera" type="Camera2D" parent="."]
|
|
|
|
[node name="collision" type="CollisionShape2D" parent="."]
|
|
visible = false
|
|
shape = SubResource("CircleShape2D_653al")
|
|
|
|
[node name="animation" type="AnimationPlayer" parent="."]
|
|
libraries = {
|
|
"": SubResource("AnimationLibrary_se06j")
|
|
}
|
|
|
|
[node name="body_pivot" type="Node2D" parent="."]
|
|
|
|
[node name="raycast" type="RayCast2D" parent="body_pivot"]
|
|
target_position = Vector2(0, -100)
|
|
collision_mask = 2
|
|
|
|
[node name="body" type="Sprite2D" parent="body_pivot"]
|
|
material = SubResource("ShaderMaterial_qi76t")
|
|
scale = Vector2(0.2, 0.2)
|
|
texture = ExtResource("1_f7cgp")
|
|
|
|
[node name="tool" type="Sprite2D" parent="body_pivot/body"]
|
|
z_index = -1
|