Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,256 --> 00:00:04,352
The creation of our first enemy is going to be very similar to the player but
2
00:00:04,608 --> 00:00:05,888
Minor diff
3
00:00:06,400 --> 00:00:07,168
So
4
00:00:07,424 --> 00:00:08,192
Let's get right into it
5
00:00:08,704 --> 00:00:12,288
So we're going to use control and to create a new scene
6
00:00:12,544 --> 00:00:14,080
And we're going to Sylhet
7
00:00:14,336 --> 00:00:15,616
Other note here
8
00:00:15,872 --> 00:00:17,152
And you're going to
9
00:00:17,408 --> 00:00:19,968
Add a character body to Diaz r
10
00:00:20,224 --> 00:00:20,736
Routenote
11
00:00:20,992 --> 00:00:23,552
Now we're going to call this a basic enemy
12
00:00:24,832 --> 00:00:26,112
Using past ok
13
00:00:27,136 --> 00:00:29,184
And what does go ahead and save that so
14
00:00:29,696 --> 00:00:30,464
We're going to save
15
00:00:30,720 --> 00:00:33,792
You can use the up arrow here to go up a path
16
00:00:34,048 --> 00:00:37,888
My saved things I want to save in the game camera folder but I don't
17
00:00:38,144 --> 00:00:40,704
Somebody got up a path create a new folder here
18
00:00:40,960 --> 00:00:42,496
Basic
19
00:00:42,752 --> 00:00:43,264
Enemy
20
00:00:43,520 --> 00:00:44,288
And then
21
00:00:44,544 --> 00:00:45,312
Save the Day
22
00:00:46,080 --> 00:00:46,592
In there
23
00:00:46,848 --> 00:00:51,456
How many klikovits in inspector tab right here so I have everything available to me
24
00:00:51,712 --> 00:00:53,248
Ever gonna need to find a
25
00:00:53,504 --> 00:00:55,808
Sprite for our enemy as well
26
00:00:56,576 --> 00:00:58,112
So go back to your candy ass
27
00:00:58,368 --> 00:00:58,880
An
28
00:00:59,392 --> 00:01:01,037
Go into the individual tiles here
29
00:01:01,039 --> 00:01:03,387
Subtitled by
online-courses.club
We compress knowledge for you!
30
00:01:03,388 --> 00:01:06,560
And trying to find a car to spray that you want to use it
31
00:01:06,816 --> 00:01:07,584
Your first enemy
32
00:01:08,096 --> 00:01:12,448
You can also look at the tilemap at said to see what looks like a good enemy type
33
00:01:12,960 --> 00:01:16,800
Looks like we got a couple of Monsters here as well as some characters
34
00:01:17,056 --> 00:01:18,848
I think I'm going to choose the rat
35
00:01:19,104 --> 00:01:20,128
As my first
36
00:01:20,640 --> 00:01:21,408
Perhaps the
37
00:01:21,920 --> 00:01:22,688
Grey
38
00:01:22,944 --> 00:01:24,992
Is well used for the first time
39
00:01:25,248 --> 00:01:28,064
I'm gonna go into my individual tiles and I'm going to find
40
00:01:28,320 --> 00:01:28,832
The
41
00:01:29,088 --> 00:01:29,600
Grey
42
00:01:29,856 --> 00:01:30,368
Rat
43
00:01:30,624 --> 00:01:31,648
The grey rat
44
00:01:31,904 --> 00:01:34,208
Tile underscore 01
45
00:01:34,464 --> 00:01:34,976
24
46
00:01:35,232 --> 00:01:37,536
I'm going to drag that right over into my
47
00:01:37,792 --> 00:01:39,328
File system in Godot
48
00:01:39,584 --> 00:01:43,168
I dragged my tile underscore 0124
49
00:01:43,424 --> 00:01:44,704
Military names
50
00:01:45,472 --> 00:01:45,984
2
51
00:01:46,752 --> 00:01:49,312
Keep a consistent income and basic and
52
00:01:49,824 --> 00:01:53,152
And I want to drag that into the scenes basic
53
00:01:53,408 --> 00:01:56,736
My folder so I've got the right alongside the tsyn
54
00:01:57,248 --> 00:01:59,040
Now just as a quick aside
55
00:01:59,296 --> 00:02:00,576
You can
56
00:02:00,832 --> 00:02:04,416
Use the Windows file system or the Linux and Mac file system
57
00:02:04,672 --> 00:02:06,208
To manage your
58
00:02:06,464 --> 00:02:07,488
Directory
59
00:02:08,000 --> 00:02:10,816
So it's more comfortable for you to copy and paste
60
00:02:11,072 --> 00:02:11,584
The row
61
00:02:12,096 --> 00:02:13,632
Sprayed or your character spread
62
00:02:13,888 --> 00:02:15,936
Beer the native operating system
63
00:02:16,448 --> 00:02:22,080
File manager you can definitely do that and then when you click back into Adele it will detect that change and Order
64
00:02:22,336 --> 00:02:22,848
Liam Porter
65
00:02:23,360 --> 00:02:25,408
I find it easier to drag and drop a thing
66
00:02:25,664 --> 00:02:26,176
Inmo
67
00:02:26,432 --> 00:02:26,944
Cases
68
00:02:27,712 --> 00:02:29,504
Something to my basic anime scene
69
00:02:29,760 --> 00:02:31,552
And we are going to create
70
00:02:31,808 --> 00:02:35,392
No I want you to think of a little bit about what we need what kind of nose
71
00:02:35,648 --> 00:02:36,160
Create
72
00:02:36,416 --> 00:02:37,952
In order to display a visual
73
00:02:38,464 --> 00:02:39,744
So I'm going to hit ctrl a
74
00:02:40,000 --> 00:02:40,768
If you answer
75
00:02:41,024 --> 00:02:43,840
Sprayed TV that's correct so we're going to add
76
00:02:44,096 --> 00:02:45,376
Spray to die again
77
00:02:45,632 --> 00:02:47,680
Control a brings of the adenoid
78
00:02:48,192 --> 00:02:48,704
Dialogue
79
00:02:48,960 --> 00:02:51,776
The number just gonna drag that text your overall
80
00:02:52,032 --> 00:02:52,544
The text
81
00:02:53,056 --> 00:02:54,848
And there is our little
82
00:02:55,360 --> 00:02:58,176
Typically out configure the offset such that the right
83
00:02:58,432 --> 00:03:00,224
Feet are at the Orange
84
00:03:00,736 --> 00:03:03,808
In so I can do that by again holding control
85
00:03:04,320 --> 00:03:07,904
And then clicking and dragging on the offset why property
86
00:03:08,160 --> 00:03:09,952
But you'll notice that the rats feet
87
00:03:10,208 --> 00:03:10,976
Sort of
88
00:03:11,232 --> 00:03:12,000
Right here
89
00:03:12,512 --> 00:03:15,584
So I'm just going to align the origin up with that
90
00:03:15,840 --> 00:03:17,120
I think that will look
91
00:03:17,376 --> 00:03:17,888
5
92
00:03:18,400 --> 00:03:22,496
Now we got this morning right here which is note configuration warning it has no shape
93
00:03:23,008 --> 00:03:25,568
So let's go ahead and add a collision
94
00:03:25,824 --> 00:03:26,336
2D
95
00:03:26,848 --> 00:03:28,640
So go ahead and get your ad no dialogue
96
00:03:28,896 --> 00:03:29,664
Control a
97
00:03:29,920 --> 00:03:31,712
And then search for collision
98
00:03:31,968 --> 00:03:32,480
2D
99
00:03:32,736 --> 00:03:34,016
Go ahead and
100
00:03:34,528 --> 00:03:35,808
Then in the shape
101
00:03:36,064 --> 00:03:36,576
Property
102
00:03:36,832 --> 00:03:37,856
Create a new
103
00:03:38,112 --> 00:03:38,880
Circle shape
104
00:03:40,160 --> 00:03:43,488
Change that radius by clicking into it and say
105
00:03:43,744 --> 00:03:44,256
5
106
00:03:44,512 --> 00:03:45,536
And then you can
107
00:03:45,792 --> 00:03:49,376
Move the position of it by scrolling down to the transform position
108
00:03:49,632 --> 00:03:50,144
And then
109
00:03:50,656 --> 00:03:51,680
Building control
110
00:03:51,936 --> 00:03:53,728
And clicking and dragging to the la
111
00:03:54,240 --> 00:03:55,008
With your mouth
112
00:03:55,264 --> 00:03:56,544
On Wye
113
00:03:56,800 --> 00:03:59,360
Adjust position in a way that makes sense to you
114
00:04:00,128 --> 00:04:00,640
Perfect
115
00:04:01,152 --> 00:04:07,040
Basic enemy setup let's go ahead and add a script to it so click on the root note
116
00:04:07,296 --> 00:04:08,576
Click add script
117
00:04:08,832 --> 00:04:11,136
All these default should be fine so go ahead
118
00:04:11,648 --> 00:04:12,672
Create
119
00:04:12,928 --> 00:04:13,952
Once again in
120
00:04:15,232 --> 00:04:16,768
Control the movement
121
00:04:17,024 --> 00:04:19,583
Of this auntie simulator Howie
122
00:04:19,839 --> 00:04:20,607
Control the player
123
00:04:20,863 --> 00:04:21,887
So what we're going to do
124
00:04:22,143 --> 00:04:23,679
Is we are going to
125
00:04:24,191 --> 00:04:27,775
Create a new function in here by creating two new lines at the end of the file
126
00:04:28,287 --> 00:04:28,799
Funk
127
00:04:29,055 --> 00:04:29,567
Jet
128
00:04:29,823 --> 00:04:30,591
Direction
129
00:04:31,615 --> 00:04:32,127
2
130
00:04:32,895 --> 00:04:33,407
Claire
131
00:04:34,431 --> 00:04:38,271
This is going to do exactly what it says get direction to player is going to return
132
00:04:38,527 --> 00:04:39,295
The direction
133
00:04:39,551 --> 00:04:40,063
At the end
134
00:04:40,319 --> 00:04:41,855
You should move in
135
00:04:42,111 --> 00:04:47,487
And how we can do this whilst going to be the same thing that we did in the camera we're going to save our player notes
136
00:04:48,255 --> 00:04:49,279
Is equal to
137
00:04:49,535 --> 00:04:50,559
Get tree
138
00:04:51,839 --> 00:04:52,863
Get nodes
139
00:04:53,375 --> 00:04:55,167
Group we can also use
140
00:04:55,423 --> 00:04:56,703
First note in
141
00:04:56,959 --> 00:04:59,263
So let's go ahead and use that here instead
142
00:04:59,775 --> 00:05:00,287
Claire
143
00:05:00,543 --> 00:05:02,591
My name is variable two player
144
00:05:03,103 --> 00:05:05,151
So get first loading group player
145
00:05:05,407 --> 00:05:06,943
Unless do as no
146
00:05:07,199 --> 00:05:07,711
2D
147
00:05:07,967 --> 00:05:10,271
Then we need to check if player no
148
00:05:10,527 --> 00:05:12,319
Is not equal to
149
00:05:13,343 --> 00:05:14,879
We're going to return
150
00:05:15,391 --> 00:05:18,719
And then vector subtraction is how you get a direct
151
00:05:18,975 --> 00:05:20,255
Show the position that you
152
00:05:20,511 --> 00:05:22,559
2.2 comes first in the subtract
153
00:05:23,071 --> 00:05:24,607
So Player download
154
00:05:24,863 --> 00:05:25,631
Global position
155
00:05:26,655 --> 00:05:27,167
Miners
156
00:05:27,935 --> 00:05:29,727
The global position of the end
157
00:05:30,751 --> 00:05:32,287
No again same issue
158
00:05:32,543 --> 00:05:33,055
Supplier
159
00:05:33,311 --> 00:05:35,103
We want this to be a unit vector
160
00:05:35,359 --> 00:05:36,127
So that when we
161
00:05:36,383 --> 00:05:37,663
Quiet by speed
162
00:05:37,919 --> 00:05:39,199
It's x
163
00:05:39,455 --> 00:05:41,247
A magnitude of 1%
164
00:05:41,759 --> 00:05:45,343
So we're going to put a parentheses around that and you can do that by highlighting this
165
00:05:45,599 --> 00:05:46,623
Line and then
166
00:05:46,879 --> 00:05:50,207
Doing shift in an open parenthesis in that will
167
00:05:50,463 --> 00:05:51,743
The parenthesize that for you
168
00:05:51,999 --> 00:05:53,279
And then you can type
169
00:05:53,535 --> 00:05:55,071
Normalized at the end
170
00:05:55,327 --> 00:05:56,607
And that will return
171
00:05:57,375 --> 00:05:59,167
The direction to the player Northern line
172
00:05:59,423 --> 00:06:02,751
Now what happens if the player is no we're just going to return
173
00:06:03,007 --> 00:06:03,519
For 2
174
00:06:04,031 --> 00:06:04,543
0
175
00:06:05,311 --> 00:06:05,823
Perfect
176
00:06:06,079 --> 00:06:07,359
Ok up at 8
177
00:06:07,615 --> 00:06:10,431
Let's create a new line up here and sake
178
00:06:10,943 --> 00:06:11,455
Max
179
00:06:11,711 --> 00:06:12,223
Speed
180
00:06:12,479 --> 00:06:13,503
Is equal to
181
00:06:13,759 --> 00:06:16,063
What's a 2 something like 75
182
00:06:16,575 --> 00:06:18,879
In our process nothing what we're going to do
183
00:06:19,391 --> 00:06:20,159
Is we are going to say
184
00:06:20,671 --> 00:06:21,951
Via Direction
185
00:06:22,463 --> 00:06:23,487
Is equal to
186
00:06:23,743 --> 00:06:26,559
We're going to call R function get direction to player
187
00:06:27,327 --> 00:06:30,655
Set up a last week because again this is a character body 2
188
00:06:30,911 --> 00:06:32,447
Velocity is equal to
189
00:06:32,703 --> 00:06:33,471
Direction
190
00:06:33,983 --> 00:06:34,495
Time
191
00:06:35,519 --> 00:06:36,031
Speed
192
00:06:36,287 --> 00:06:37,055
And I would
193
00:06:37,567 --> 00:06:38,335
Move on
194
00:06:38,591 --> 00:06:39,103
Slide
195
00:06:40,127 --> 00:06:41,663
Ok let's give that a try
196
00:06:41,919 --> 00:06:43,967
So we're going to go back to our main scene
197
00:06:44,223 --> 00:06:46,527
And again we cannot forget to add our and
198
00:06:47,039 --> 00:06:48,063
The same so
199
00:06:48,319 --> 00:06:49,087
The way to add
200
00:06:49,599 --> 00:06:51,135
Instantiated seen
201
00:06:51,647 --> 00:06:52,159
To you
202
00:06:52,671 --> 00:06:53,695
Seen is 2
203
00:06:53,951 --> 00:06:55,743
Hit ctrl shift a
204
00:06:55,999 --> 00:06:59,327
And that will bring up your instantiated child scene window
205
00:06:59,839 --> 00:07:00,351
In the week
206
00:07:00,607 --> 00:07:01,887
Clique basic and
207
00:07:02,399 --> 00:07:02,911
And then
208
00:07:03,167 --> 00:07:03,935
Here is that
209
00:07:04,959 --> 00:07:09,823
To move the position of the enemy within the scene you can click w or them
210
00:07:10,079 --> 00:07:10,591
Mode
211
00:07:10,847 --> 00:07:11,871
Tool up here
212
00:07:12,127 --> 00:07:14,431
And then you can just click and drag to move
213
00:07:14,943 --> 00:07:15,967
The Entity around
214
00:07:16,479 --> 00:07:19,039
And just place The Entity in the middle of the room some
215
00:07:19,551 --> 00:07:20,063
And then
216
00:07:20,319 --> 00:07:24,671
Play and you can see that our enemy is now moving slowly
217
00:07:24,927 --> 00:07:27,743
The player and changing direction as we move out
218
00:07:28,255 --> 00:07:30,047
Now there is a problem here which is
219
00:07:30,559 --> 00:07:33,119
The Entity and the player can collide with each other
220
00:07:33,631 --> 00:07:34,655
What's fix that really
221
00:07:35,167 --> 00:07:36,447
What's good for a player scene
222
00:07:37,471 --> 00:07:41,823
Select the route character by 2D and scroll down until you see
223
00:07:43,103 --> 00:07:46,431
And so here is collision layers and collision masks
224
00:07:47,455 --> 00:07:52,319
What is this is this determines how things or if things can kill
225
00:07:52,831 --> 00:07:54,623
And what these two settings do
226
00:07:54,879 --> 00:07:57,183
Determinate things should register
227
00:07:57,439 --> 00:07:57,951
Collision
228
00:07:58,463 --> 00:08:00,255
Sew a collision layer
229
00:08:00,767 --> 00:08:04,095
Is the layer in which the object exist
230
00:08:05,119 --> 00:08:06,143
And the mass
231
00:08:06,399 --> 00:08:09,727
Is the layers that the object checks for
232
00:08:10,751 --> 00:08:12,031
So the reason that
233
00:08:12,287 --> 00:08:15,359
The player and the enemy are colliding
234
00:08:15,871 --> 00:08:16,895
Is because
235
00:08:17,151 --> 00:08:18,943
The player for an example
236
00:08:19,199 --> 00:08:20,735
Exist on layer 1
237
00:08:20,991 --> 00:08:23,807
And the enemy is checking for collisions on laya
238
00:08:24,319 --> 00:08:27,391
And the player is checking for collisions on layer 1
239
00:08:27,647 --> 00:08:29,439
Any anime exist online
240
00:08:30,207 --> 00:08:33,535
So they're both colliding with each other because they both
241
00:08:33,791 --> 00:08:37,375
In the layer that the other one looks for collisions for
242
00:08:38,655 --> 00:08:39,935
Given that information
243
00:08:40,191 --> 00:08:41,215
What do you think
244
00:08:41,471 --> 00:08:42,239
We need a chat
245
00:08:42,495 --> 00:08:44,287
In order to make them not come
246
00:08:44,799 --> 00:08:45,567
And the answer is
247
00:08:45,823 --> 00:08:47,359
We just want to turn off the layer
248
00:08:47,615 --> 00:08:50,943
We don't want entities to exist on a layer
249
00:08:51,199 --> 00:08:54,527
That registers movement collisions we don't want that
250
00:08:54,783 --> 00:08:57,343
As I was going to unkick a player one
251
00:08:57,599 --> 00:08:58,367
By clicking
252
00:08:58,623 --> 00:09:00,927
In the enemy and also do the same thing
253
00:09:01,439 --> 00:09:01,951
In the player
254
00:09:02,207 --> 00:09:05,279
So now they're only looking for
255
00:09:05,535 --> 00:09:06,047
Nuclear war
256
00:09:06,303 --> 00:09:08,351
But neither of them exist in there
257
00:09:08,863 --> 00:09:10,399
So they're not going to collide with each other
258
00:09:10,655 --> 00:09:13,215
But when we add terrine in the future
259
00:09:13,471 --> 00:09:14,495
Michael adebolajo
260
00:09:15,007 --> 00:09:17,823
We're going to set the terrain to exist in lair
261
00:09:18,335 --> 00:09:20,639
So that entities and the player career
262
00:09:20,895 --> 00:09:21,663
With
263
00:09:22,175 --> 00:09:24,223
What's verify real quick that fix it
264
00:09:24,479 --> 00:09:27,807
Is a now I cannot collide with enemies anymore
265
00:09:28,063 --> 00:09:31,647
That's a basic enemy AI and move
266
00:09:32,159 --> 00:09:35,743
In the next lesson we're going to start implementing the players ability
267
00:09:35,999 --> 00:09:36,767
To damage
268
00:09:37,023 --> 00:09:38,303
And kill Em
16809
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.