Let's create the tile maps basically, and we're gonna create.
So we're going to get rid of this square ground for now.
So let's select the ground game object in the hierarchy.
Go over to Inspector.
And you can just click over here in order to disable that.
Or you can simply enable as well by clicking there.
So we're just deactivating or we just disabling that.
For now let's create our tile map.
But before we do what we need to do, we need to move over to this hierarchy.
So right click on hierarchy or click on this plus icon.
Then go to 2D objects, then Tile map and then click on this rectangular.
And it's going to create the grid for us.
And if you want to see the grid you can just click over here in the top you can see.
So you need to just click there.
And we can see in the scene view we have a tile palette in the top left corner uh top left corner.
You can have it anywhere something like that.
You're gonna have it in the bottom in the scene view, anywhere in this interview.
So make sure you just find that first.
And then click on this Open Tile palette.
And we are ready to create our tile palette.
So basically we need to create our palette first as you can see create new tile palette.
So just click there and then click on this Create New palette.
And you have to name the palette what you want to name it.
So I'm going to call it something like tile.
And after doing that click on this create button in the bottom right.
And we have to choose a folder where we want to create that.
So I'm going to move over to this assets.
In assets we have animation folder audio prefabs.
So when we create a separate folder for our tile maps.
So just right click there and then go to new and then folder.
And I'm going to name this folder to something like tiles.
So let's call it tiles and double click on it in order to open that up.
And let's click on this select folder in the bottom right we can see and it's going to create the tile
palette right away.
And what we have to do over here, we need to drag the tile set over here.
So we need to drag our tile set here.
So we need to create that first.
So let's click on this card tab for now.
And you're gonna have this open tile palette anywhere in the scene view.
Make sure you just find that first.
So let's move over to our project tab then assets folder.
And then we're going to move over to this sprites folder I have a environment folder.
As you can see in this project tab of course I will have a link in the resources.
You can go and check that out of this assets.
So I'm going to move over to my free folder.
And we can see we have backgrounds and the tiles.
So we're going to select our tiles.
And we have it over here terrain we can see.
So we need to slice individually.
So make sure you select the first uh terrain in your from that folder select that sprite spreadsheet.
Then go over to Inspector and then click on this open Sprite Editor in the Inspector.
As soon as we click, we can see an Sprite Editor tab.
Just open up.
Open it up right away.
So what we need to do, we need to slice individually something like 16 by 16 in the x and y in the
width.
Or you can simply say in the height.
So we need to split that.
So make sure you just go to Inspector in the right and sprite mode to choose multiple and pixel per
unit.
We're going to choose something like 16 in order to make this sprite large in size.
So we're going to make it something like 16 and scroll down.
We need to choose this filter mode to point no filter.
Why?
If you take a closer look by scrolling your mouse in this sprite editor, we can see the sprite just
looks a little bit blurry.
So to get rid of that, we need to choose this filter mode to point filter in the inspector.
And after doing all of these things in the bottom, scroll down and then click on this apply button
in the bottom.
You can see as soon as we click apply.
Now we can see the blurry is gone by now and we are ready to slice individually.
So in the top left Sprite editor tab you can see slice.
So just click there and select automatic to create by cell cell size and go and basically put in the
width x basically means the width something like 16 as we have done in pixel per unit.
And we're going to do the same thing in Y like a square.
So we're going to put 16 by 16.
And after doing that click on this slice button and then click on this apply button in the top right
in Sprite Editor tab.
So as soon as you're going to click on this apply button, it's going to split individually with uh
with uh 16 in the width and 16 in the height.
So we can just go over to.
So I'm going to select my game view once again over here.
And let's go to that sprite sheet.
And let's click on this arrow.
As soon as we click we can see the individual slice by now.
So what we have to do.
So make sure you select the Tile Map GameObject in the hierarchy.
Basically select the grid and then Tile Map and move over to this scene view.
And then click on this Open Tile palette.
You're going to have it anywhere in the scene view.
So I'm just uh, just explaining it one more time.
So you need to find that so I can see I have it over here.
So just click on this Open Tile palette in order to open the tile palette.
And now we need to drag the sprite over here.
As you can see it says drag tile sprite or texture.
So we split.
So we're going to select our sprite sheet.
So make sure you select the whole sprite sheet which we recently slice it individually by 16 by 16.
So make sure you select the whole not the by clicking this arrow and then individual or individual ones.
Instead, you need to select the whole sprite sheet and then drag it over to this tile palette over
here.
As you can see, and we need to choose a folder where we just want to drag them.
So we're going to move over to these assets and an assets folder.
As you can see we created a styles folder.
So we're going to select that folder.
Let's click on this select folder.
As soon as you're going to select all of the sprites.
Just going to be dragged over here in this style palette.
So just wait a little moment.
And now we can see all of our tile by scrolling our mouse.
And you can just make this type bigger as well by just extending in the width as well as in the height.
So I'm going to make it a little bit bigger to be able to or see or notice.
So what we're going to do now if we select our create, firstly we're going to make an empty game object.
And that game object is just going to be a parent one.
And then we're going to make this crate or this tiles a child of that game object.
So let me do that.
So basically make sure you just go to hierarchy right click or hit this plus icon.
Then create an empty game object and we're going to call this game object to something like round one.
So let's call it round underscore one and go over to Inspector in the right.
And then right click on this transform and click on this reset.
So it's going to reset the position into center.
And then select this arrow.
Uh sorry.
Select this tool from in this from this in view.
And if you want to choose an icon you can just go over to this inspector.
Click on this box and you can choose an icon as well.
So I'm going to select this yellow one something like that.
And now we are able to see I'm going to drag my player game object a little bit over here.
Something like that.
So I'm going to select my Game player game object in the hierarchy.
And let's drag it somewhere over here in the top left side.
And we are ready to do so.
You can just scroll your mouse in order to zoom in or zoom out.
So why we created this, uh, ground underscore one game object first?
Because that at this point, or this position or this game object is just going to represent the first
or the, uh, you can say start position of that crown.
So that's why.
And now what we're gonna do, we're going to select our crown.
So select the crown and drag it on top of this crown.
Underscore one game object.
So now if I select my crown underscore one object in the hierarchy and try to move anywhere in the scene
view, you will see this crown game.
A great game object is also moving with it.
So I'm gonna set the position once again to something like zero.
And let's do that.
Let's uh, we are ready to place our tiles.
So what we need to do, we need to just click on that tile palette.
So but before you do, make sure you select the Create Game object in the hierarchy.
Then click on this Open Tile palette in the scene view.
So it's gonna open our tile palette.
And we are ready to place our tiles.
So we're going to click over here.
And we can choose the tile map as well, or we can simply choose the create.
So let's choose that and we are ready to place our tile.
So move over to this Tile palette tab and we're going to place our tile.
So let's see.
You can scroll your mouse and you can just move your mouse in order to look around in this tile palette.
So we are ready to place our tile.
So this one.
So this one the left one.
So I'm going to drag it somewhere around here you can simply say.
So we created this ground underscore or basically a parent game object in order to represent the first
position or where from the ground just going to start.
So that's why we created.
So basically that is the thing and what we're going to do now we're going to move this up here I guess
it's fine.
And you you can see there are many tools.
We have the brush tool and the shortcut key.
Sorry.
The shortcut key we can see is B.
As you can see is B.
So if you simply press down B on your keyboard it's going to move over to this brush tool.
And we're going to move this up here.
And this is that how you can do that.
You can just place.
And let's suppose you just place a a wrong tile anywhere anywhere over here.
Then you can just remove that by selecting this eraser tool here D.
So we're going to remove.
So let's suppose I just place this one.
So I just want to remove.
So I can just click there in order to erase that or add the shortcut key is D.
You can simply press down T on your keyboard in order to select that eraser tool in order to erase the
tile, which you just want to erase.
So I'm going to paste my tile.
So let's paste this one.
And this one should be here something like that.
And this is pretty much fine.
And let's suppose if you just want to move this tile, this whole tile, something like over here in
the top position or in the bottom position or anywhere in the scene view.
Then what you have to do, you need to select this tool.
And the shortcut key is S.
So select the that tool and then select the tiles that you just want to move anywhere in this view as
in view.
So in my case let's suppose I just want to move this a little bit down as something over here.
So I'm going to select all of the tiles that I want to move.
So select an area that you really want to move.
And then after doing that make sure you select the next tool.
And the shortcut key you can see is M or move selection.
We can see.
So we can select that tool in order to move this tile in the bottom or up or anywhere in the scene view.
So we can move it.
Something like this as you can see and this is cool thing.
And now what we're going to do now we're going to place our tile.
So let's place this and I'm going to move this one.
And if you just want to make it copy instead of, uh, basically pasting, uh, one by one tiles, you
can just simply copy these tiles and you can just paste it over here in order to make your work more,
a lot more easy.
And the tool you can select for that is a brush tool.
And the shortcut key I guess not.
It's make or mark selection tool.
Sorry.
And the shortcut key you can see I so you need to select that tool from the tile palette.
Uh so make sure you just do that first and you can just select the area that you want to copy.
So let's suppose I just want to copy this much.
So I'm going to select.
And now I can paste it anywhere uh like this as you can see.
So let's suppose I just want to paste it over here I want to paste it over here.
So make sure you created the parent game object and start pasting the tiles from that point.
Because we're going to have the logic that how we can create, uh, just spawn multiple fronts because
this is our endless runner game.
So we need to spawn multiple grounds.
So make sure after your first point or the A game object you just made it a parent.
From that position you should start pasting your tile.
So make sure you just do that and do uh, don't go outside of that area or this point.
Something like if I just paste it over here.
So it's going to be to the left side.
So just don't do this because we're gonna spawn from this position.
So that's why we created an empty game object first.
From that position we just want to spawn.
So that's why we're going to start pasting our tiles from that point.
So you need to do that.
Make sure you just do it.
And this is the cool thing.
And then next up we're gonna talk about all of these tools that how you can do it.
I hope you get the idea that how you can just create your tile or how you can start your, uh, pasting
your tiles in your game in order to make the ground.