1
00:00:00,000 --> 00:00:03,510
Welcome back my fellow game developers

2
00:00:03,510 --> 00:00:04,800
to a brand new video.

3
00:00:04,800 --> 00:00:07,980
And this one, we don't do anything very fancy.

4
00:00:07,980 --> 00:00:09,510
We create a new scene.

5
00:00:09,510 --> 00:00:12,240
We have a shopping scene right now,

6
00:00:12,240 --> 00:00:14,940
and as you can see, we have three items in here.

7
00:00:14,940 --> 00:00:16,860
They are very identical.

8
00:00:16,860 --> 00:00:18,510
They don't do anything special,

9
00:00:18,510 --> 00:00:21,620
but this is just the setup for

10
00:00:21,615 --> 00:00:23,015
the next video where we will

11
00:00:23,010 --> 00:00:25,290
start actually creating things.

12
00:00:25,290 --> 00:00:29,890
So let's not waste any more time and let's get started.

13
00:00:30,710 --> 00:00:35,700
Okay, so now time to create a shop.

14
00:00:35,700 --> 00:00:37,100
And to create a shop,

15
00:00:37,095 --> 00:00:40,965
I wanted to make it a separate scene all on its own.

16
00:00:40,960 --> 00:00:44,330
That way we are inspired by the game Hades.

17
00:00:44,330 --> 00:00:46,610
We can go from one scene to the next ghetto,

18
00:00:46,610 --> 00:00:49,790
a shop, shop there then grow to the other scenes.

19
00:00:49,790 --> 00:00:51,890
So what I'm going to do is I'm going

20
00:00:51,890 --> 00:00:54,190
to duplicate the level two.

21
00:00:54,185 --> 00:00:56,065
And now we have level three

22
00:00:56,060 --> 00:00:58,130
and I'm going to call this the shop,

23
00:00:58,130 --> 00:01:01,510
can call this the shop level or shop scene or whatever.

24
00:01:01,505 --> 00:01:03,355
So I'm going to double-click and you can

25
00:01:03,350 --> 00:01:05,210
see that even though it's the same,

26
00:01:05,210 --> 00:01:07,300
but we are on the shop right now,

27
00:01:07,295 --> 00:01:08,945
up here in the hierarchy.

28
00:01:08,945 --> 00:01:11,335
So I'm going to first of all delete

29
00:01:11,330 --> 00:01:13,540
the Bitcoin, delete the weapon,

30
00:01:13,535 --> 00:01:15,615
shes the health pickups

31
00:01:15,619 --> 00:01:18,229
by dropped the breakable bought and

32
00:01:18,230 --> 00:01:20,660
let's open the room and let's go ahead and

33
00:01:20,660 --> 00:01:23,290
delete all the enemies.

34
00:01:23,285 --> 00:01:24,835
I'm just going to remove them from

35
00:01:24,830 --> 00:01:26,800
here and just keep this room as it is.

36
00:01:26,795 --> 00:01:28,795
I believe we will make this a prefab and

37
00:01:28,790 --> 00:01:30,680
be able to add it to any room we want.

38
00:01:30,680 --> 00:01:33,230
But anyways, later on we'll think about that.

39
00:01:33,230 --> 00:01:34,460
But for now we'll just delete

40
00:01:34,460 --> 00:01:38,270
all the enemies and will cause this will keep the layer,

41
00:01:38,270 --> 00:01:40,580
will keep the portal obviously because

42
00:01:40,580 --> 00:01:43,400
we want to get out of the shop later on.

43
00:01:43,400 --> 00:01:45,410
And I'm going to right-click in here

44
00:01:45,410 --> 00:01:47,270
and create an empty game object,

45
00:01:47,270 --> 00:01:51,230
which is going to be the shop item.

46
00:01:51,230 --> 00:01:55,040
And we're going to start off with health.

47
00:01:55,040 --> 00:01:58,280
There we go. So we are going to mainly

48
00:01:58,280 --> 00:02:01,300
have three shop items to focus on right now.

49
00:02:01,295 --> 00:02:04,535
Where we get health 14, the upgrade health,

50
00:02:04,535 --> 00:02:07,175
and want to buy some kind of weapon,

51
00:02:07,175 --> 00:02:08,965
a random woman, I think.

52
00:02:08,960 --> 00:02:10,850
So. Let's set these three.

53
00:02:10,850 --> 00:02:12,430
So we're going to have one here,

54
00:02:12,425 --> 00:02:13,945
one here, and one here.

55
00:02:13,940 --> 00:02:15,830
Let's start off with the most simple one,

56
00:02:15,830 --> 00:02:18,070
which is the regular sharp item.

57
00:02:18,065 --> 00:02:20,305
I'm going to add a component in here which

58
00:02:20,300 --> 00:02:22,880
is going to be a sprite.

59
00:02:22,880 --> 00:02:27,350
Or know what, maybe we want to go in the ER,

60
00:02:27,350 --> 00:02:30,020
know what, let's just add a sprite for now.

61
00:02:30,020 --> 00:02:32,510
So a sprite renderer.

62
00:02:32,510 --> 00:02:36,100
And we are going to go in the sprites

63
00:02:36,095 --> 00:02:41,225
in the, Where is it?

64
00:02:41,980 --> 00:02:45,320
Oh, so pickups. And there we go.

65
00:02:45,320 --> 00:02:47,060
This is the health. And I'm

66
00:02:47,060 --> 00:02:49,490
going to just add the sprite right here.

67
00:02:49,490 --> 00:02:52,210
And we're going to set it on the player layer,

68
00:02:52,205 --> 00:02:53,395
even though we said that we

69
00:02:53,390 --> 00:02:54,770
will not be doing this anymore.

70
00:02:54,770 --> 00:02:57,640
But anyways, let's continue on.

71
00:02:57,635 --> 00:03:01,495
Then we are obviously going to add a box collider 2D,

72
00:03:01,490 --> 00:03:03,530
and this will be a trigger.

73
00:03:03,530 --> 00:03:06,140
So whereas it is a trigger,

74
00:03:06,140 --> 00:03:08,300
Let's see the size and obviously

75
00:03:08,300 --> 00:03:10,820
we want to make it a lot bigger.

76
00:03:10,820 --> 00:03:13,970
So that way the player can step in here.

77
00:03:13,970 --> 00:03:16,040
And we will have, for example,

78
00:03:16,040 --> 00:03:19,570
when declare steps in the vicinity of this shopping item,

79
00:03:19,565 --> 00:03:22,525
he is going to receive a message appear.

80
00:03:22,520 --> 00:03:24,350
We will also add a canvas and

81
00:03:24,350 --> 00:03:26,390
just a bit where he will read.

82
00:03:26,390 --> 00:03:28,360
You can buy this item, for example,

83
00:03:28,355 --> 00:03:32,365
a health or replenish your health for,

84
00:03:32,360 --> 00:03:34,130
let's say, 50 coins.

85
00:03:34,130 --> 00:03:37,580
And this will appear only when the player stands near

86
00:03:37,580 --> 00:03:41,200
the button or the sharp item or whatever.

87
00:03:41,195 --> 00:03:42,835
And we also want to create

88
00:03:42,830 --> 00:03:44,810
a small box collider that will make

89
00:03:44,810 --> 00:03:48,970
sure that we do not hit this actual object.

90
00:03:48,965 --> 00:03:50,725
So a second box collider,

91
00:03:50,720 --> 00:03:53,600
we'll just make it a bit smaller to just be

92
00:03:53,600 --> 00:03:58,540
enough so we don't hit the actual object in here.

93
00:03:58,535 --> 00:04:01,855
There we go, close that, save that.

94
00:04:01,850 --> 00:04:03,560
And now what we're going to do is

95
00:04:03,560 --> 00:04:05,290
we'll add a canvas to this.

96
00:04:05,285 --> 00:04:07,405
So we'll go to the UI.

97
00:04:07,400 --> 00:04:10,660
We'll add a, where is it the canvas.

98
00:04:10,655 --> 00:04:15,325
And we'll call this D sharp item Canvas.

99
00:04:15,320 --> 00:04:18,310
And we are going to set,

100
00:04:18,305 --> 00:04:19,525
we want to see the UI,

101
00:04:19,525 --> 00:04:20,965
okay, So we can't see the UI.

102
00:04:20,960 --> 00:04:22,700
Where is it? This Is it,

103
00:04:22,700 --> 00:04:24,380
the big giant canvas?

104
00:04:24,380 --> 00:04:26,090
Let's turn on the gizmos.

105
00:04:26,090 --> 00:04:28,490
And it's not allowing me to remove

106
00:04:28,490 --> 00:04:31,330
the scale because we need to set it to world space.

107
00:04:31,325 --> 00:04:34,975
And zero-zero point five on the x-axis,

108
00:04:34,970 --> 00:04:38,420
zero-zero point five on the y-axis.

109
00:04:38,420 --> 00:04:41,510
And let's reset its position to 0.

110
00:04:41,509 --> 00:04:45,169
Now double-click on the shop item, and there we go.

111
00:04:45,170 --> 00:04:48,010
Now we have the little canvas around here.

112
00:04:48,005 --> 00:04:50,805
And let's just set it bow.

113
00:04:50,809 --> 00:04:54,679
Yeah, I think that's good enough up here.

114
00:04:54,680 --> 00:04:57,020
And we're going to add, first of all,

115
00:04:57,020 --> 00:05:00,180
a visit to texts.

116
00:05:00,184 --> 00:05:03,804
So we're going to go to UI text much Pro.

117
00:05:03,800 --> 00:05:05,060
This is the first one.

118
00:05:05,060 --> 00:05:06,680
This is for the,

119
00:05:06,680 --> 00:05:13,550
let's say the press press button, text.

120
00:05:13,550 --> 00:05:17,790
And another one which is going to be the

121
00:05:18,640 --> 00:05:21,980
Whereas it, this will

122
00:05:21,980 --> 00:05:25,220
be the text that represents the price of the item.

123
00:05:25,220 --> 00:05:32,050
So item, item for ice text.

124
00:05:32,045 --> 00:05:34,255
There we go. And I'm going to move

125
00:05:34,250 --> 00:05:37,060
this one down and move this one up.

126
00:05:37,055 --> 00:05:42,335
And let's do a couple of editing and make this bigger.

127
00:05:42,335 --> 00:05:44,245
Press.

128
00:05:44,240 --> 00:05:48,900
E to buy.

129
00:05:49,390 --> 00:05:52,520
And scroll down a new set it in

130
00:05:52,520 --> 00:05:55,310
the middle and make sure that it auto sizes.

131
00:05:55,310 --> 00:05:59,420
And we'll also turn this down.

132
00:05:59,420 --> 00:06:02,360
We don't want to see this and make it

133
00:06:02,360 --> 00:06:05,980
bold, make it robot.

134
00:06:05,975 --> 00:06:10,855
And we can't see it because we need

135
00:06:10,850 --> 00:06:13,130
to go into the canvas and the

136
00:06:13,130 --> 00:06:15,620
sorting layer and set it on the player.

137
00:06:15,620 --> 00:06:18,160
There we go. So now we can see everything.

138
00:06:18,155 --> 00:06:20,255
And now back in the button,

139
00:06:20,255 --> 00:06:21,505
this is the perfect fit.

140
00:06:21,500 --> 00:06:23,480
Well, I think we can increase the max.

141
00:06:23,480 --> 00:06:25,310
So when you press on the opposite side,

142
00:06:25,310 --> 00:06:26,720
you have the options right here

143
00:06:26,720 --> 00:06:28,340
to auto size option the minimum,

144
00:06:28,340 --> 00:06:30,590
the maximum, and whatever these are.

145
00:06:30,590 --> 00:06:32,900
So I just increased the maximum to fill up

146
00:06:32,900 --> 00:06:35,720
the whole space in here. There we go.

147
00:06:35,720 --> 00:06:37,910
And now back in the price item, you know what,

148
00:06:37,910 --> 00:06:42,010
let me just delete this one and then duplicate this one.

149
00:06:42,005 --> 00:06:43,885
And now we move it down.

150
00:06:43,880 --> 00:06:49,670
This will be, let's say, price two buttons.

151
00:06:49,670 --> 00:06:50,930
And then we can say,

152
00:06:50,930 --> 00:06:54,740
for example, 99, 99 coins.

153
00:06:54,740 --> 00:06:58,390
There we go. So as you can see right now is a table.

154
00:06:58,385 --> 00:07:00,245
Maybe it is a bit big,

155
00:07:00,245 --> 00:07:01,585
but no worries about that.

156
00:07:01,580 --> 00:07:04,160
We can actually decrease the sizes of these

157
00:07:04,160 --> 00:07:08,170
two because they seem a bit too bulky.

158
00:07:08,165 --> 00:07:11,975
So there we go. Something like that.

159
00:07:11,975 --> 00:07:16,355
And this one also Something like that.

160
00:07:16,355 --> 00:07:17,815
Yeah, Sure. Why not?

161
00:07:17,810 --> 00:07:20,270
So take your time to create all of these,

162
00:07:20,270 --> 00:07:23,330
make sure that they look really good for your own sake.

163
00:07:23,330 --> 00:07:24,800
And finally, I want to add

164
00:07:24,800 --> 00:07:26,990
some kind of platform under the soul,

165
00:07:26,990 --> 00:07:29,990
the player or whoever is playing your game doesn't just

166
00:07:29,990 --> 00:07:33,220
confuse this for some kind of item on the ground.

167
00:07:33,215 --> 00:07:36,055
So I'm going to go into my resources

168
00:07:36,050 --> 00:07:39,140
and I have this some kind of teleport,

169
00:07:39,140 --> 00:07:41,840
I'm going to use it as the platform.

170
00:07:41,840 --> 00:07:46,930
So let's drag it into the sprites right here.

171
00:07:46,925 --> 00:07:50,485
And it's annoying when we have the files so small.

172
00:07:50,480 --> 00:07:51,620
So right-click in here,

173
00:07:51,620 --> 00:07:56,000
create the shop platform.

174
00:07:56,000 --> 00:07:58,390
And let's add it in here.

175
00:07:58,385 --> 00:08:00,385
And we have this right now.

176
00:08:00,380 --> 00:08:03,220
So I'm going to make it a multiple,

177
00:08:03,215 --> 00:08:07,115
make it point, apply the changes go Sprite Editor.

178
00:08:07,115 --> 00:08:09,955
And how are we going to slice this baby up?

179
00:08:09,950 --> 00:08:14,960
Let's see, I believe this as a one of the bigger sprites.

180
00:08:14,960 --> 00:08:19,000
So you can see right here that it's 128 by 320.

181
00:08:18,995 --> 00:08:21,985
So back in the Sprite Editor,

182
00:08:21,980 --> 00:08:24,920
I think let's try automatic.

183
00:08:24,920 --> 00:08:27,220
Yeah, sure why not? Automatic seems good.

184
00:08:27,215 --> 00:08:28,585
If you want, you can go ahead and

185
00:08:28,580 --> 00:08:30,830
create animations for this.

186
00:08:30,830 --> 00:08:33,280
I do recommend it so you can play all the time.

187
00:08:33,275 --> 00:08:34,525
Maybe we will do this.

188
00:08:34,520 --> 00:08:38,780
So I'm going to go back into the item right here.

189
00:08:38,780 --> 00:08:43,180
And let's just add this teleport.

190
00:08:43,175 --> 00:08:53,125
There we go. So this will be the item plat form.

191
00:08:53,120 --> 00:08:56,470
And we should set it on the layer,

192
00:08:56,465 --> 00:08:59,165
layer. It's very small.

193
00:08:59,165 --> 00:09:02,665
So we are going to go in the, where is it?

194
00:09:02,660 --> 00:09:04,820
Okay, So here, let's make it 50.

195
00:09:04,820 --> 00:09:06,500
See how that looks.

196
00:09:06,500 --> 00:09:08,120
Let's make it even bigger.

197
00:09:08,120 --> 00:09:11,530
25. Now that we have 25.

198
00:09:11,525 --> 00:09:13,895
Nope, that's a bit too big.

199
00:09:13,895 --> 00:09:15,095
Now.

200
00:09:15,095 --> 00:09:18,025
What's between 25 and 50?

201
00:09:18,020 --> 00:09:19,750
That's truck 14.

202
00:09:19,745 --> 00:09:23,005
Apply. Great. So 40 seems to be

203
00:09:23,000 --> 00:09:25,550
the right size and I'm going

204
00:09:25,550 --> 00:09:29,950
to set it to 00 and then move it down a bit.

205
00:09:29,945 --> 00:09:31,675
Well, let's keep it. Maybe if you want,

206
00:09:31,670 --> 00:09:33,760
you can start moving this up and down.

207
00:09:33,755 --> 00:09:35,605
And but I'm just going

208
00:09:35,600 --> 00:09:37,340
to keep it as it is for the button,

209
00:09:37,340 --> 00:09:38,680
maybe want to rotate it.

210
00:09:38,675 --> 00:09:39,715
I recommend you do that.

211
00:09:39,710 --> 00:09:42,140
But remember that if you want to move

212
00:09:42,140 --> 00:09:45,020
the actual plus in here,

213
00:09:45,020 --> 00:09:46,690
the green plus, you need to make sure to

214
00:09:46,685 --> 00:09:48,745
set it as a separate object.

215
00:09:48,740 --> 00:09:50,510
Because if we move this one around,

216
00:09:50,510 --> 00:09:53,020
look what happens on the wide, everything flips.

217
00:09:53,015 --> 00:09:55,435
So you need to make sure if you want to

218
00:09:55,430 --> 00:09:58,250
add some kind of animation to animate this also,

219
00:09:58,250 --> 00:10:00,080
maybe I will in later on,

220
00:10:00,080 --> 00:10:03,200
but for now let's focus on creating the actual item.

221
00:10:03,200 --> 00:10:07,730
So I'm going to move this a bit down right here.

222
00:10:07,730 --> 00:10:11,090
So there we go. So now we can see that this is an item.

223
00:10:11,090 --> 00:10:15,130
I'm going to create a script in here that will be,

224
00:10:15,125 --> 00:10:20,935
and the scripts, I'm going to make this a bit bigger.

225
00:10:20,930 --> 00:10:22,630
And do we have anything?

226
00:10:22,625 --> 00:10:24,565
Okay, so let's go ahead and right-click in

227
00:10:24,560 --> 00:10:27,950
here and create a new folder.

228
00:10:27,950 --> 00:10:30,790
And this will be for the shop.

229
00:10:30,785 --> 00:10:36,125
And inside of your ongoing to create the shop item.

230
00:10:36,580 --> 00:10:39,580
There we go. Wait for it to compile

231
00:10:39,575 --> 00:10:41,735
and I'm going to know,

232
00:10:41,735 --> 00:10:43,555
Thank you what this open.

233
00:10:43,550 --> 00:10:48,730
And I'm going to add to the what's the matter.

234
00:10:48,725 --> 00:10:52,115
So the new Unity is very awful.

235
00:10:52,115 --> 00:10:54,905
It keeps crashing, keep stopping.

236
00:10:54,905 --> 00:10:58,165
The loading of the game takes a lot of time.

237
00:10:58,160 --> 00:11:00,790
Because the script cannot be found.

238
00:11:00,785 --> 00:11:02,995
Excellent, Great.

239
00:11:02,990 --> 00:11:04,150
So we have the script,

240
00:11:04,145 --> 00:11:05,885
the script cannot be found.

241
00:11:05,885 --> 00:11:08,635
Our case, obviously there is a problem.

242
00:11:08,630 --> 00:11:10,270
Let me delete this.

243
00:11:10,265 --> 00:11:12,985
Oh, so sorry.

244
00:11:12,980 --> 00:11:14,720
It was because of me because I

245
00:11:14,720 --> 00:11:16,550
just noticed as I'm deleting it,

246
00:11:16,550 --> 00:11:18,950
that I added a space option,

247
00:11:18,950 --> 00:11:20,780
sharp item, we cannot add

248
00:11:20,780 --> 00:11:23,000
spaces in between them. So sharp item.

249
00:11:23,000 --> 00:11:25,460
Now this should work. Okay, There we go.

250
00:11:25,460 --> 00:11:27,410
So open the script up.

251
00:11:27,410 --> 00:11:28,990
Now we have this sharp item.

252
00:11:28,985 --> 00:11:35,845
Let me duplicate this once and twice.

253
00:11:35,840 --> 00:11:38,650
And now we have these three items.

254
00:11:38,645 --> 00:11:40,435
Let me move this a bit to

255
00:11:40,430 --> 00:11:45,440
the left and move this one a bit also to the left.

256
00:11:45,440 --> 00:11:47,980
And finally, this one also,

257
00:11:47,975 --> 00:11:49,795
maybe we can make them a bit smaller,

258
00:11:49,790 --> 00:11:51,200
but no worries for now,

259
00:11:51,200 --> 00:11:53,540
we have these three items later on,

260
00:11:53,540 --> 00:11:54,670
we will be changing them.

261
00:11:54,665 --> 00:11:55,765
Obviously this will be

262
00:11:55,760 --> 00:12:04,720
the health upgrade and this one will be the weapons.

263
00:12:04,715 --> 00:12:08,665
Weapons hit Enter. I hope you enjoyed.

264
00:12:08,660 --> 00:12:11,300
This was just the setup of our items.

265
00:12:11,300 --> 00:12:13,990
In the next video, we'll be starting on

266
00:12:13,985 --> 00:12:17,485
the whole process of scripting, changing behaviors.

267
00:12:17,480 --> 00:12:19,190
And before I go, let me just create

268
00:12:19,190 --> 00:12:21,880
an empty game object, reset its position.

269
00:12:21,875 --> 00:12:23,755
And this will be

270
00:12:23,750 --> 00:12:27,170
the shop items just so we

271
00:12:27,170 --> 00:12:30,770
have a nice hierarchy in here for everything.

272
00:12:30,770 --> 00:12:31,550
Save that.

273
00:12:31,550 --> 00:12:36,030
And I'll see you in the next video.

