-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcolony.tscn
104 lines (80 loc) · 3.03 KB
/
colony.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
[gd_scene load_steps=9 format=3 uid="uid://fhbqs0bjgp2b"]
[ext_resource type="Script" path="res://colony.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://dg4ou38wgi5or" path="res://guns/bullet.tscn" id="2"]
[ext_resource type="Texture2D" uid="uid://cl2hj441wexsu" path="res://assets/ships/ufoBlue_ed.png" id="3"]
[ext_resource type="Texture2D" uid="uid://dkp0kb3xcw66g" path="res://assets/ships/ufo_shade.png" id="4"]
[ext_resource type="Texture2D" uid="uid://bj324rx05fqe1" path="res://assets/dome_edit.png" id="5"]
[sub_resource type="Shader" id="1"]
code = "shader_type canvas_item;
uniform float outline_width = 2.0;
uniform vec4 outline_color: source_color;
void fragment(){
vec4 tex_col = texture(TEXTURE, UV);
vec4 col = vec4(0,0,0,0);
vec2 ps = TEXTURE_PIXEL_SIZE;
float a;
float maxa = col.a;
float mina = col.a;
a = texture(TEXTURE, UV + vec2(0, -outline_width)*ps*0.5).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(0, outline_width)*ps*0.5).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(-outline_width,0)*ps*0.5).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(outline_width, 0)*ps*0.5).a;
maxa = max(a, maxa);
mina = min(a, mina);
//COLOR = mix(col, outline_color, maxa);
float st = step(0.3, tex_col.a);
float st2 = step(0.4, tex_col.a);
//float fact = st_2;
float fact = (st-st2);
vec4 lit = mix(col, outline_color, fact);
//COLOR = lit;
//COLOR = mix(lit, col, a);
COLOR = mix(tex_col, lit, a*1.5);
//COLOR = mix(lit, tex_col, a*0.75);
//COLOR = mix(col, outline_color, -a);
}
"
[sub_resource type="ShaderMaterial" id="2"]
shader = SubResource("1")
shader_parameter/outline_width = 2.0
shader_parameter/outline_color = Color(0, 0.827451, 0.988235, 1)
[sub_resource type="CircleShape2D" id="3"]
radius = 23.0021
[node name="Node2D" type="Node2D" groups=["colony"]]
[node name="Area2D" type="Area2D" parent="."]
script = ExtResource("1")
bullet = ExtResource("2")
[node name="Sprite2D" type="Sprite2D" parent="Area2D"]
visible = false
modulate = Color(0.32549, 0.32549, 0.32549, 1)
show_behind_parent = true
scale = Vector2(0.75, 0.75)
texture = ExtResource("4")
[node name="blue_colony" type="Sprite2D" parent="Area2D"]
scale = Vector2(0.6, 0.6)
texture = ExtResource("3")
[node name="dome" type="Node2D" parent="Area2D/blue_colony"]
visible = false
scale = Vector2(1.66667, 1.66667)
[node name="dome" type="Sprite2D" parent="Area2D/blue_colony/dome"]
material = SubResource("2")
scale = Vector2(0.6, 0.6)
texture = ExtResource("5")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("3")
[node name="bullet_container" type="Node" parent="Area2D"]
[node name="muzzle" type="Marker2D" parent="Area2D"]
[node name="gun_timer" type="Timer" parent="Area2D"]
wait_time = 1.5
one_shot = true
[node name="Label" type="Label" parent="Area2D"]
offset_top = 30.0
offset_right = 40.0
offset_bottom = 44.0
[connection signal="input_event" from="Area2D" to="Area2D" method="_on_Area2D_input_event"]