-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Piece.tscn
109 lines (81 loc) · 2.67 KB
/
Piece.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Piece.gd" type="Script" id=1]
[ext_resource path="res://assets/piecesWhite.png" type="Texture" id=2]
[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
uniform float outline_width = 2.0;
uniform vec4 outline_color: hint_color;
void fragment(){
vec4 col = texture(TEXTURE, UV);
vec2 ps = TEXTURE_PIXEL_SIZE;
float a;
float maxa = col.a;
float mina = col.a;
a = texture(TEXTURE, UV + vec2(0, -outline_width)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(0, outline_width)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(-outline_width,0)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(outline_width, 0)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
COLOR = mix(col, outline_color, maxa-mina);
}"
[sub_resource type="ShaderMaterial" id=2]
render_priority = 0
shader = SubResource( 1 )
shader_param/outline_width = 0.0
shader_param/outline_color = Color( 0, 0, 0, 1 )
_sections_unfolded = [ "shader_param" ]
[sub_resource type="RectangleShape2D" id=3]
custom_solver_bias = 0.0
extents = Vector2( 10.6327, 17.7029 )
[sub_resource type="SegmentShape2D" id=4]
custom_solver_bias = 0.0
a = Vector2( 17, -7 )
b = Vector2( 17, 7 )
[node name="Piece" type="Area2D"]
position = Vector2( 23.0376, 34.168 )
input_pickable = true
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
audio_bus_override = false
audio_bus_name = "Master"
script = ExtResource( 1 )
_sections_unfolded = [ "Material", "Pickable", "Region", "Visibility" ]
__meta__ = {
"_edit_group_": true
}
[node name="Sprite" type="Sprite" parent="." index="0"]
modulate = Color( 0.109804, 0.145098, 0.784314, 1 )
material = SubResource( 2 )
scale = Vector2( 0.75, 0.75 )
texture = ExtResource( 2 )
region_enabled = true
region_rect = Rect2( 144, 132, 33, 56 )
_sections_unfolded = [ "Material", "Region", "Transform", "Visibility" ]
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"]
shape = SubResource( 3 )
_sections_unfolded = [ "Transform" ]
[node name="Footprint" type="Area2D" parent="." index="2"]
input_pickable = true
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
collision_layer = 2
collision_mask = 2
audio_bus_override = false
audio_bus_name = "Master"
_sections_unfolded = [ "Audio Bus", "Collision" ]
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Footprint" index="0"]
rotation = 1.5708
shape = SubResource( 4 )
_sections_unfolded = [ "Transform" ]
[connection signal="input_event" from="." to="." method="_on_Piece_input_event"]