1
00:00:00,000 --> 00:00:03,630
Welcome back My favorite game developers

2
00:00:03,630 --> 00:00:04,980
to a brand new video.

3
00:00:04,980 --> 00:00:07,820
And in this one we pick up a couple of coins,

4
00:00:07,815 --> 00:00:09,975
we get hit, we go down.

5
00:00:09,975 --> 00:00:11,315
We can either restore

6
00:00:11,310 --> 00:00:13,920
our health or we can upgrade our health.

7
00:00:13,920 --> 00:00:15,540
So let's upgrade our health.

8
00:00:15,540 --> 00:00:16,890
As you can see, it has,

9
00:00:16,890 --> 00:00:19,010
the maximum has increased by ten,

10
00:00:19,005 --> 00:00:20,555
and our health is now

11
00:00:20,550 --> 00:00:22,890
full because that's our mechanic in the game.

12
00:00:22,890 --> 00:00:27,560
So let's not waste any more time and let's get started.

13
00:00:27,555 --> 00:00:32,025
Okay, so time to upgrade our health.

14
00:00:32,025 --> 00:00:33,575
But before we do that,

15
00:00:33,570 --> 00:00:35,360
there's something bothering me

16
00:00:35,355 --> 00:00:37,125
and something that we need to fix.

17
00:00:37,120 --> 00:00:41,620
First of all, let's turn on these three campuses in here.

18
00:00:41,615 --> 00:00:45,655
And on each canvas I'm going to change the,

19
00:00:45,650 --> 00:00:47,900
whatever the price in here says.

20
00:00:47,900 --> 00:00:50,750
So for example, the price 999 instead we are going

21
00:00:50,750 --> 00:00:54,170
to save this as the restore health.

22
00:00:54,170 --> 00:00:56,570
Restore health.

23
00:00:56,570 --> 00:01:00,340
And we'll say, how much did we say it costs?

24
00:01:00,335 --> 00:01:02,875
How much is the cost of the health restore 10.

25
00:01:02,870 --> 00:01:07,760
So in here, then BTC.

26
00:01:07,760 --> 00:01:10,880
Okay, So in the second one,

27
00:01:10,880 --> 00:01:14,480
it's going to be the upgrade.

28
00:01:14,480 --> 00:01:17,030
So opens up, select the button,

29
00:01:17,030 --> 00:01:19,060
let me close those down.

30
00:01:19,055 --> 00:01:23,155
What was it? Upgrade health.

31
00:01:23,150 --> 00:01:26,600
Upgrade, health.

32
00:01:26,600 --> 00:01:31,120
And let's say this one will cost 30 BC.

33
00:01:31,115 --> 00:01:33,325
And finally the new item,

34
00:01:33,320 --> 00:01:35,720
let me close this down again and turn

35
00:01:35,720 --> 00:01:39,500
these two canvases of and finally,

36
00:01:39,500 --> 00:01:42,010
we have this one right here.

37
00:01:42,005 --> 00:01:52,035
And this will be the by weapon or by weapon.

38
00:01:52,039 --> 00:01:56,739
And this will be, let's say 40 BTC. There we go.

39
00:01:56,735 --> 00:01:58,495
Now we have everything set up

40
00:01:58,490 --> 00:02:00,890
properly At think in the next video,

41
00:02:00,890 --> 00:02:04,700
I'll also maybe add a bit of animation to each of

42
00:02:04,700 --> 00:02:06,980
these items and maybe something to the platform

43
00:02:06,980 --> 00:02:09,550
just to give it a bit more life.

44
00:02:09,545 --> 00:02:11,555
Okay, with that out of the way,

45
00:02:11,555 --> 00:02:13,945
let's drop this back down.

46
00:02:13,940 --> 00:02:15,410
But before we go, I want to

47
00:02:15,410 --> 00:02:17,620
change the actual sprite in here.

48
00:02:17,615 --> 00:02:19,915
And I've provided you with a couple of sprites.

49
00:02:19,910 --> 00:02:21,830
So we have first of all, this one,

50
00:02:21,830 --> 00:02:24,340
but honestly I found that a bit ugly.

51
00:02:24,335 --> 00:02:27,295
So I also use these ones,

52
00:02:27,290 --> 00:02:30,520
and it really depends on what you want your game to have.

53
00:02:30,515 --> 00:02:33,175
You can see there is a lot of potions in here,

54
00:02:33,170 --> 00:02:35,750
so I'm going to select the red.

55
00:02:35,750 --> 00:02:37,760
And we have this thick glass

56
00:02:37,760 --> 00:02:39,170
maybe should we use the thick glass?

57
00:02:39,170 --> 00:02:42,220
Nope, let's just use the regular glass.

58
00:02:42,215 --> 00:02:47,425
And I'm going to add it into the sprites in here.

59
00:02:47,420 --> 00:02:52,100
So inside of sprites opens up bigger.

60
00:02:52,100 --> 00:02:54,550
And let's go ahead

61
00:02:54,545 --> 00:02:56,905
and right-click in here and maybe create

62
00:02:56,900 --> 00:02:59,150
a separate folder for this or just added to

63
00:02:59,150 --> 00:03:02,650
the pickups if we have some or something for the health.

64
00:03:02,645 --> 00:03:04,705
Anything. Pickups? Yeah, sure.

65
00:03:04,700 --> 00:03:07,010
That's added to the pickups. No worries about that.

66
00:03:07,010 --> 00:03:08,140
Keep it in here.

67
00:03:08,135 --> 00:03:10,195
I think this is a good place.

68
00:03:10,190 --> 00:03:13,220
And then we are going to go into the item

69
00:03:13,220 --> 00:03:17,600
upgrade and give it this one. There we go.

70
00:03:17,600 --> 00:03:18,770
Nice.

71
00:03:18,770 --> 00:03:20,030
Very big.

72
00:03:20,030 --> 00:03:23,750
So I'm going to maybe make it 200,

73
00:03:23,750 --> 00:03:27,970
apply, make it bi-linear point.

74
00:03:27,965 --> 00:03:30,355
Apply. Still big.

75
00:03:30,350 --> 00:03:33,290
400, 400 I think would be too small.

76
00:03:33,290 --> 00:03:35,090
300 apply.

77
00:03:35,090 --> 00:03:39,320
And the yep seems to be good enough.

78
00:03:39,320 --> 00:03:41,030
Maybe we can move it up a bit.

79
00:03:41,030 --> 00:03:43,040
But this is why I wanted to create

80
00:03:43,040 --> 00:03:45,880
the actual item sprite in here for each one.

81
00:03:45,875 --> 00:03:48,155
Now what? Let's go ahead and do that.

82
00:03:48,155 --> 00:03:54,205
Some ongoing create the item sprite.

83
00:03:54,200 --> 00:03:55,880
And it's always better to have

84
00:03:55,880 --> 00:03:56,960
these bright on a different.

85
00:03:56,960 --> 00:03:59,080
And what we can do is select in here

86
00:03:59,075 --> 00:04:02,695
and click on Copy Component.

87
00:04:02,690 --> 00:04:05,830
So copy components, select the item sprite

88
00:04:05,825 --> 00:04:09,565
and select in here and basically component as new.

89
00:04:09,560 --> 00:04:11,500
So now I can go back in here

90
00:04:11,495 --> 00:04:13,775
and remove the component entirely.

91
00:04:13,775 --> 00:04:16,655
And now this sprite is free to move up and down

92
00:04:16,655 --> 00:04:19,915
and we can add some kind of animation to it freely.

93
00:04:19,910 --> 00:04:23,450
So I'm going to copy this and paste it for

94
00:04:23,450 --> 00:04:27,200
the first item and here.

95
00:04:27,200 --> 00:04:30,740
And then for this one also in here.

96
00:04:30,740 --> 00:04:35,620
And we should reset the position of each of those.

97
00:04:35,615 --> 00:04:38,855
And for this one.

98
00:04:41,080 --> 00:04:45,620
And in here, instead of having this red,

99
00:04:45,620 --> 00:04:50,750
we are going to add the usual sprite that we're using.

100
00:04:50,750 --> 00:04:56,090
And in here we'll just remove the component. There we go.

101
00:04:56,090 --> 00:04:57,770
Excellent. So now we can control

102
00:04:57,770 --> 00:05:00,260
this item sprite all on song.

103
00:05:00,260 --> 00:05:02,190
And what else do we want to do?

104
00:05:02,190 --> 00:05:06,130
And the last one in here, items private,

105
00:05:06,125 --> 00:05:08,875
remove this item and electron and

106
00:05:08,870 --> 00:05:11,840
the next video we'll be adding its own weapon.

107
00:05:11,840 --> 00:05:15,020
Okay, So that out of the way,

108
00:05:15,020 --> 00:05:17,300
also make sure to change

109
00:05:17,300 --> 00:05:20,260
the box gliders on each one of those,

110
00:05:20,255 --> 00:05:21,835
just so we don't collide with

111
00:05:21,830 --> 00:05:23,690
the items with that out of the way.

112
00:05:23,690 --> 00:05:25,400
Let's continue one and now it's

113
00:05:25,400 --> 00:05:27,550
time for the health upgrade.

114
00:05:27,545 --> 00:05:29,725
So let's go. First of all,

115
00:05:29,720 --> 00:05:30,980
create a method and

116
00:05:30,980 --> 00:05:32,870
the player health handler that will allow

117
00:05:32,870 --> 00:05:36,020
us to increase the max level 2.

118
00:05:36,020 --> 00:05:37,880
We have anything to do that? Nope, we don't.

119
00:05:37,880 --> 00:05:40,820
So I'm going to add it right here.

120
00:05:40,820 --> 00:05:44,800
So in here I'm going to create a public void.

121
00:05:44,795 --> 00:05:47,455
Increase max.

122
00:05:47,450 --> 00:05:49,360
What's that?

123
00:05:49,355 --> 00:05:52,295
Max health.

124
00:05:52,295 --> 00:05:59,425
And in here and the max health amount.

125
00:05:59,420 --> 00:06:03,440
And then we are going to get the max health and

126
00:06:03,440 --> 00:06:07,920
increase it by V-max health amount.

127
00:06:11,020 --> 00:06:13,580
And then we are going to get

128
00:06:13,580 --> 00:06:16,810
the current health and it's equal to the max health.

129
00:06:16,805 --> 00:06:19,885
Or if you want, you can avoid this and not do this.

130
00:06:19,880 --> 00:06:21,500
So we get an upgrade,

131
00:06:21,500 --> 00:06:23,510
but we don't get any health.

132
00:06:23,510 --> 00:06:25,070
Or for example, if you want,

133
00:06:25,070 --> 00:06:27,200
you can set instead of the max health,

134
00:06:27,200 --> 00:06:28,810
you can set the current health

135
00:06:28,805 --> 00:06:31,615
plus 75 percent or something.

136
00:06:31,610 --> 00:06:34,910
I believe this is something that happens in

137
00:06:34,910 --> 00:06:36,920
Hades or you can increase it by

138
00:06:36,920 --> 00:06:39,010
just ten or however you wanna do with,

139
00:06:39,005 --> 00:06:41,065
I'll just keep it simple like here.

140
00:06:41,060 --> 00:06:43,580
And then there is one more thing that we need to do,

141
00:06:43,580 --> 00:06:45,920
and that is we need to go into

142
00:06:45,920 --> 00:06:49,780
the UI Manager Door instance,

143
00:06:49,775 --> 00:06:55,465
and we need to update The Wait a second,

144
00:06:55,460 --> 00:06:57,140
whereas the UI Manager,

145
00:06:57,140 --> 00:07:00,620
we need to update the half bar

146
00:07:00,620 --> 00:07:02,810
so we need to make sure that it shows what's happening.

147
00:07:02,810 --> 00:07:04,730
Increase the max value and

148
00:07:04,730 --> 00:07:07,420
the value of our health in here,

149
00:07:07,415 --> 00:07:09,205
in the UI Manager Instance,

150
00:07:09,200 --> 00:07:11,360
we upgrade the max value,

151
00:07:11,360 --> 00:07:14,600
which is the max health of the slider.

152
00:07:14,600 --> 00:07:16,700
And this is important because this will

153
00:07:16,700 --> 00:07:18,980
determine how the slugged works.

154
00:07:18,980 --> 00:07:21,230
So after we upgrade the max health,

155
00:07:21,230 --> 00:07:24,100
we need to go to the UI Manager dot instance,

156
00:07:24,095 --> 00:07:27,715
dot health slider dot max value.

157
00:07:27,710 --> 00:07:31,060
And it's going to be equal to the max Hello again.

158
00:07:31,055 --> 00:07:32,575
So save that.

159
00:07:32,570 --> 00:07:34,940
And we'll also make sure to update

160
00:07:34,940 --> 00:07:37,910
the player health you are at the end.

161
00:07:37,910 --> 00:07:39,430
Save that. Okay, great.

162
00:07:39,425 --> 00:07:40,925
Now with that out of the way,

163
00:07:40,925 --> 00:07:43,775
time to actually buy the item in here.

164
00:07:43,775 --> 00:07:46,595
So I'm going to issue it to you as a challenge.

165
00:07:46,595 --> 00:07:47,675
And that is to create

166
00:07:47,675 --> 00:07:50,015
a another case for the health upgrade.

167
00:07:50,015 --> 00:07:51,935
So create a new case that

168
00:07:51,935 --> 00:07:54,865
takes the health upgrade item type.

169
00:07:54,860 --> 00:07:56,330
Then you'll need to find the

170
00:07:56,330 --> 00:07:57,800
player health system just like

171
00:07:57,800 --> 00:08:00,790
with previously or if you're using the collision,

172
00:08:00,785 --> 00:08:05,185
then finally increase the max health of our player.

173
00:08:05,180 --> 00:08:07,990
Was that although the way pause the video right now

174
00:08:07,985 --> 00:08:11,875
and go to the challenge.

175
00:08:11,870 --> 00:08:14,360
Oh, hey, welcome back.

176
00:08:14,360 --> 00:08:17,090
So back in the shop item in here

177
00:08:17,090 --> 00:08:20,030
we have a another case that we're going

178
00:08:20,030 --> 00:08:26,480
to call the case item type dot health upgrade.

179
00:08:26,479 --> 00:08:29,149
And we are going to do the same.

180
00:08:29,150 --> 00:08:32,620
We are going to find the layer health handler.

181
00:08:32,615 --> 00:08:34,555
And then we are going to increase

182
00:08:34,550 --> 00:08:38,560
the max health by how much do we increase the Mac South?

183
00:08:38,555 --> 00:08:40,435
Let's just keep it at 10.

184
00:08:40,430 --> 00:08:42,590
Keep things simple so we can easily

185
00:08:42,590 --> 00:08:45,640
understand it and then we are going to break.

186
00:08:45,635 --> 00:08:48,305
So back in our game,

187
00:08:48,305 --> 00:08:52,435
Let's see, we said that this will cause 13 Bitcoins.

188
00:08:52,430 --> 00:08:55,940
So anywhere let's make it 30.

189
00:08:55,940 --> 00:08:59,540
Save that, run the game.

190
00:08:59,540 --> 00:09:04,060
Now, we should see we pick up a couple of coins.

191
00:09:04,055 --> 00:09:06,025
We can get hurt if you want. There we go.

192
00:09:06,020 --> 00:09:07,790
So now we are at 200.

193
00:09:07,790 --> 00:09:08,990
We can either restore

194
00:09:08,990 --> 00:09:11,360
the health or we can upgrade our health.

195
00:09:11,360 --> 00:09:13,610
So if I upgrade the health, There you go.

196
00:09:13,610 --> 00:09:19,000
You can see that I have 310 now and I can also upgraded.

197
00:09:18,995 --> 00:09:21,175
I can buy it but nothing gets upgraded.

198
00:09:21,170 --> 00:09:22,820
If you think this is unfair

199
00:09:22,820 --> 00:09:24,860
that we can actually buy the item,

200
00:09:24,860 --> 00:09:27,110
but we don't get any benefit from it,

201
00:09:27,110 --> 00:09:28,280
then be my guest.

202
00:09:28,280 --> 00:09:30,860
I do recommend that you try to check, first of all,

203
00:09:30,860 --> 00:09:32,600
before we increase the health,

204
00:09:32,600 --> 00:09:34,550
do we actually have it at max?

205
00:09:34,550 --> 00:09:36,080
If you do have it at max,

206
00:09:36,080 --> 00:09:39,410
Let's not take it or not buy it or something like that.

207
00:09:39,410 --> 00:09:41,230
So with that out of the way,

208
00:09:41,225 --> 00:09:43,765
I hope you enjoy it and I'll see you in

209
00:09:43,760 --> 00:09:45,260
the next one where we will be

210
00:09:45,260 --> 00:09:47,270
actually buying the weapons.

211
00:09:47,270 --> 00:09:50,290
Next, let's set it from now, 40. Save that.

212
00:09:50,285 --> 00:09:52,615
And I'll see you then.

213
00:09:52,610 --> 00:09:55,100
Oh, and don't forget to of

214
00:09:55,100 --> 00:09:58,410
course commit your changes. See you in the next one.

