Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
The creation of our first enemy is going to be very similar to the player but
Minor diff
So
Let's get right into it
So we're going to use control and to create a new scene
And we're going to Sylhet
Other note here
And you're going to
Add a character body to Diaz r
Routenote
Now we're going to call this a basic enemy
Using past ok
And what does go ahead and save that so
We're going to save
You can use the up arrow here to go up a path
My saved things I want to save in the game camera folder but I don't
Somebody got up a path create a new folder here
Basic
Enemy
And then
Save the Day
In there
How many klikovits in inspector tab right here so I have everything available to me
Ever gonna need to find a
Sprite for our enemy as well
So go back to your candy ass
An
Go into the individual tiles here
Subtitled by online-courses.club We compress knowledge for you!
And trying to find a car to spray that you want to use it
Your first enemy
You can also look at the tilemap at said to see what looks like a good enemy type
Looks like we got a couple of Monsters here as well as some characters
I think I'm going to choose the rat
As my first
Perhaps the
Grey
Is well used for the first time
I'm gonna go into my individual tiles and I'm going to find
The
Grey
Rat
The grey rat
Tile underscore 01
24
I'm going to drag that right over into my
File system in Godot
I dragged my tile underscore 0124
Military names
2
Keep a consistent income and basic and
And I want to drag that into the scenes basic
My folder so I've got the right alongside the tsyn
Now just as a quick aside
You can
Use the Windows file system or the Linux and Mac file system
To manage your
Directory
So it's more comfortable for you to copy and paste
The row
Sprayed or your character spread
Beer the native operating system
File manager you can definitely do that and then when you click back into Adele it will detect that change and Order
Liam Porter
I find it easier to drag and drop a thing
Inmo
Cases
Something to my basic anime scene
And we are going to create
No I want you to think of a little bit about what we need what kind of nose
Create
In order to display a visual
So I'm going to hit ctrl a
If you answer
Sprayed TV that's correct so we're going to add
Spray to die again
Control a brings of the adenoid
Dialogue
The number just gonna drag that text your overall
The text
And there is our little
Typically out configure the offset such that the right
Feet are at the Orange
In so I can do that by again holding control
And then clicking and dragging on the offset why property
But you'll notice that the rats feet
Sort of
Right here
So I'm just going to align the origin up with that
I think that will look
5
Now we got this morning right here which is note configuration warning it has no shape
So let's go ahead and add a collision
2D
So go ahead and get your ad no dialogue
Control a
And then search for collision
2D
Go ahead and
Then in the shape
Property
Create a new
Circle shape
Change that radius by clicking into it and say
5
And then you can
Move the position of it by scrolling down to the transform position
And then
Building control
And clicking and dragging to the la
With your mouth
On Wye
Adjust position in a way that makes sense to you
Perfect
Basic enemy setup let's go ahead and add a script to it so click on the root note
Click add script
All these default should be fine so go ahead
Create
Once again in
Control the movement
Of this auntie simulator Howie
Control the player
So what we're going to do
Is we are going to
Create a new function in here by creating two new lines at the end of the file
Funk
Jet
Direction
2
Claire
This is going to do exactly what it says get direction to player is going to return
The direction
At the end
You should move in
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
Is equal to
Get tree
Get nodes
Group we can also use
First note in
So let's go ahead and use that here instead
Claire
My name is variable two player
So get first loading group player
Unless do as no
2D
Then we need to check if player no
Is not equal to
We're going to return
And then vector subtraction is how you get a direct
Show the position that you
2.2 comes first in the subtract
So Player download
Global position
Miners
The global position of the end
No again same issue
Supplier
We want this to be a unit vector
So that when we
Quiet by speed
It's x
A magnitude of 1%
So we're going to put a parentheses around that and you can do that by highlighting this
Line and then
Doing shift in an open parenthesis in that will
The parenthesize that for you
And then you can type
Normalized at the end
And that will return
The direction to the player Northern line
Now what happens if the player is no we're just going to return
For 2
0
Perfect
Ok up at 8
Let's create a new line up here and sake
Max
Speed
Is equal to
What's a 2 something like 75
In our process nothing what we're going to do
Is we are going to say
Via Direction
Is equal to
We're going to call R function get direction to player
Set up a last week because again this is a character body 2
Velocity is equal to
Direction
Time
Speed
And I would
Move on
Slide
Ok let's give that a try
So we're going to go back to our main scene
And again we cannot forget to add our and
The same so
The way to add
Instantiated seen
To you
Seen is 2
Hit ctrl shift a
And that will bring up your instantiated child scene window
In the week
Clique basic and
And then
Here is that
To move the position of the enemy within the scene you can click w or them
Mode
Tool up here
And then you can just click and drag to move
The Entity around
And just place The Entity in the middle of the room some
And then
Play and you can see that our enemy is now moving slowly
The player and changing direction as we move out
Now there is a problem here which is
The Entity and the player can collide with each other
What's fix that really
What's good for a player scene
Select the route character by 2D and scroll down until you see
And so here is collision layers and collision masks
What is this is this determines how things or if things can kill
And what these two settings do
Determinate things should register
Collision
Sew a collision layer
Is the layer in which the object exist
And the mass
Is the layers that the object checks for
So the reason that
The player and the enemy are colliding
Is because
The player for an example
Exist on layer 1
And the enemy is checking for collisions on laya
And the player is checking for collisions on layer 1
Any anime exist online
So they're both colliding with each other because they both
In the layer that the other one looks for collisions for
Given that information
What do you think
We need a chat
In order to make them not come
And the answer is
We just want to turn off the layer
We don't want entities to exist on a layer
That registers movement collisions we don't want that
As I was going to unkick a player one
By clicking
In the enemy and also do the same thing
In the player
So now they're only looking for
Nuclear war
But neither of them exist in there
So they're not going to collide with each other
But when we add terrine in the future
Michael adebolajo
We're going to set the terrain to exist in lair
So that entities and the player career
With
What's verify real quick that fix it
Is a now I cannot collide with enemies anymore
That's a basic enemy AI and move
In the next lesson we're going to start implementing the players ability
To damage
And kill Em
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.