forked from Leonmail2/3D_fps_game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Enemy.tscn
130 lines (97 loc) · 4.11 KB
/
Enemy.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[gd_scene load_steps=11 format=2]
[ext_resource path="res://Enemy.gd" type="Script" id=1]
[ext_resource path="res://Gun.tscn" type="PackedScene" id=2]
[sub_resource type="PhysicsMaterial" id=1]
rough = true
[sub_resource type="Shader" id=2]
code = "shader_type spatial;
uniform float hitcolor = 1.0;
void fragment(){
ALBEDO = hitcolor * vec3(1.0,0.0,0.0);
}"
[sub_resource type="ShaderMaterial" id=3]
shader = SubResource( 2 )
shader_param/hitcolor = 1.0
[sub_resource type="CapsuleMesh" id=4]
material = SubResource( 3 )
radius = 1.5
mid_height = 3.0
[sub_resource type="CapsuleShape" id=5]
radius = 1.45322
height = 3.02675
[sub_resource type="CapsuleShape" id=6]
margin = 0.065
radius = 1.5
height = 3.0
[sub_resource type="CubeMesh" id=7]
size = Vector3( 1.695, 1.675, 18.156 )
[sub_resource type="CapsuleShape" id=8]
radius = 2.28908
height = 1.40379
[node name="Enemy" type="KinematicBody"]
collision_layer = 512
collision_mask = 513
script = ExtResource( 1 )
[node name="EnemyElements" type="Spatial" parent="."]
[node name="RigidBody" type="RigidBody" parent="EnemyElements"]
collision_layer = 14
collision_mask = 14
mass = 1.07
physics_material_override = SubResource( 1 )
gravity_scale = 4.0
[node name="MeshInstance" type="MeshInstance" parent="EnemyElements/RigidBody"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
mesh = SubResource( 4 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="EnemyElements/RigidBody"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
shape = SubResource( 5 )
[node name="EnemyHitDetector" type="Area" parent="EnemyElements"]
[node name="MeshInstance2" type="CollisionShape" parent="EnemyElements/EnemyHitDetector"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
shape = SubResource( 6 )
[node name="RayCastLineOfSight" type="RayCast" parent="EnemyElements"]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 0, 1.862, 0 )
enabled = true
cast_to = Vector3( 0, 0, -200 )
collision_mask = 5
collide_with_areas = true
[node name="MeshInstance" type="MeshInstance" parent="EnemyElements/RayCastLineOfSight"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.43565e-06, 0, -25.3689 )
visible = false
mesh = SubResource( 7 )
material/0 = null
[node name="Gun" type="Spatial" parent="EnemyElements"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.853, 0, -1.25021 )
[node name="BulletSpawner" type="Spatial" parent="EnemyElements/Gun"]
transform = Transform( -7.87548e-08, 0, -1.8017, 0, 1.8017, 0, 1.8017, 0, -7.87548e-08, -0.000112295, 0.145123, -0.592498 )
[node name="Gun" parent="EnemyElements/Gun/BulletSpawner" instance=ExtResource( 2 )]
[node name="HeadLoc" type="Position3D" parent="EnemyElements"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.75161, 0 )
[node name="PositionRight" type="Position3D" parent="."]
transform = Transform( 0.950554, 0.31056, 0, -0.31056, 0.950554, 0, 0, 0, 1, 3.05609, 0, 0 )
[node name="PositionCenter" type="Position3D" parent="."]
[node name="PositionLeft" type="Position3D" parent="."]
transform = Transform( 0.935844, -0.352413, 0, 0.352413, 0.935844, 0, 0, 0, 1, -3.03768, 0, 0 )
[node name="DetectionCheckTimer" type="Timer" parent="."]
wait_time = 0.1
[node name="CoverTimer" type="Timer" parent="."]
process_mode = 0
wait_time = 3.0
one_shot = true
[node name="ShootingTimer" type="Timer" parent="."]
process_mode = 0
wait_time = 0.716
one_shot = true
[node name="GunTimer" type="Timer" parent="."]
wait_time = 0.661
[node name="MoveTimer" type="Timer" parent="."]
wait_time = 0.12
autostart = true
[node name="PhysicalCollider" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1.31134e-07, 1, 0, -1, 1.31134e-07, 0, 0.108825, 0 )
shape = SubResource( 8 )
[connection signal="timeout" from="CoverTimer" to="." method="_on_CoverTimer_timeout"]
[connection signal="timeout" from="ShootingTimer" to="." method="_on_ShootingTimer_timeout"]
[connection signal="timeout" from="GunTimer" to="." method="_on_GunTimer_timeout"]
[connection signal="timeout" from="MoveTimer" to="." method="_on_MoveTimer_timeout"]