﻿1
00:00:02,960 --> 00:00:05,920
hello everyone

2
00:00:04,000 --> 00:00:07,440
this is part four on how to make a tower

3
00:00:05,920 --> 00:00:09,599
defense game in scratch

4
00:00:07,440 --> 00:00:11,040
in this tutorial i'll be adding a lot of

5
00:00:09,599 --> 00:00:12,799
improvements to the turrets

6
00:00:11,040 --> 00:00:14,080
including a firing animation

7
00:00:12,799 --> 00:00:16,160
customizable range

8
00:00:14,080 --> 00:00:17,840
adding a base and making the turret

9
00:00:16,160 --> 00:00:20,160
unable to be placed on the track

10
00:00:17,840 --> 00:00:21,439
or on other turrets if you haven't seen

11
00:00:20,160 --> 00:00:22,880
parts one through three

12
00:00:21,439 --> 00:00:24,880
check them out links are in the

13
00:00:22,880 --> 00:00:27,920
description below anyways

14
00:00:24,880 --> 00:00:30,160
let's get started so first off i want to

15
00:00:27,920 --> 00:00:32,320
add a firing animation to the turret

16
00:00:30,160 --> 00:00:34,000
because right now all the turret does is

17
00:00:32,320 --> 00:00:36,079
point and shoot at the enemy

18
00:00:34,000 --> 00:00:38,320
however i wanted to switch to a firing

19
00:00:36,079 --> 00:00:39,520
costume so i'm going to go to the turret

20
00:00:38,320 --> 00:00:42,239
sprite

21
00:00:39,520 --> 00:00:46,000
and then i'm going to go into costumes

22
00:00:42,239 --> 00:00:49,200
and i'm going to duplicate this costume

23
00:00:46,000 --> 00:00:52,719
and over here i am going to draw

24
00:00:49,200 --> 00:00:53,680
some type of firing thing to show that

25
00:00:52,719 --> 00:00:58,879
the turret shot

26
00:00:53,680 --> 00:01:01,440
at the enemy so something like this

27
00:00:58,879 --> 00:01:03,199
okay i am going to make the outline

28
00:01:01,440 --> 00:01:08,640
orange

29
00:01:03,199 --> 00:01:08,640
maybe a dark orange all right

30
00:01:09,600 --> 00:01:15,439
and for the fill i'm going to have a

31
00:01:12,880 --> 00:01:19,119
sort of yellower orange

32
00:01:15,439 --> 00:01:22,320
so something like this okay

33
00:01:19,119 --> 00:01:26,479
and for the outline size i think a size

34
00:01:22,320 --> 00:01:28,799
of 7 is fine and i will select this

35
00:01:26,479 --> 00:01:31,439
and click the back button right here so

36
00:01:28,799 --> 00:01:34,560
it's going to go under the turret

37
00:01:31,439 --> 00:01:36,159
and that should be fine so

38
00:01:34,560 --> 00:01:38,720
i'm going to make a few final

39
00:01:36,159 --> 00:01:38,720
adjustments

40
00:01:38,840 --> 00:01:45,040
and all right cool

41
00:01:42,399 --> 00:01:47,360
so now we have the turret firing costume

42
00:01:45,040 --> 00:01:50,479
and i'm gonna go back to the code

43
00:01:47,360 --> 00:01:52,840
and inside of the code i am going to go

44
00:01:50,479 --> 00:01:55,280
to the part where the turret shoots the

45
00:01:52,840 --> 00:01:57,759
bullet so over here

46
00:01:55,280 --> 00:01:59,759
and then i'm going to go to looks and

47
00:01:57,759 --> 00:02:03,439
drag a switch costume

48
00:01:59,759 --> 00:02:05,200
to costume 2. so this is the turret

49
00:02:03,439 --> 00:02:07,280
firing costume

50
00:02:05,200 --> 00:02:09,759
so right when the turret fires i'm going

51
00:02:07,280 --> 00:02:12,400
to make it switch costume to costume 2

52
00:02:09,759 --> 00:02:13,520
and then i'm going to make a weight

53
00:02:12,400 --> 00:02:16,879
something like

54
00:02:13,520 --> 00:02:18,640
let's say 0.05 seconds

55
00:02:16,879 --> 00:02:20,080
and then i'm going to make it switch

56
00:02:18,640 --> 00:02:22,560
costume back to

57
00:02:20,080 --> 00:02:23,680
its original costume which was costume

58
00:02:22,560 --> 00:02:26,720
one

59
00:02:23,680 --> 00:02:28,879
all right and if we try it out then if

60
00:02:26,720 --> 00:02:31,360
we place down a turret

61
00:02:28,879 --> 00:02:32,480
then when it shoots as you can see it

62
00:02:31,360 --> 00:02:36,400
does that quick

63
00:02:32,480 --> 00:02:39,360
firing animation like so and yeah

64
00:02:36,400 --> 00:02:40,560
i think that looks a bit better and now

65
00:02:39,360 --> 00:02:43,519
the next thing i want to do

66
00:02:40,560 --> 00:02:44,319
is improve the turret range so right now

67
00:02:43,519 --> 00:02:46,800
i only have

68
00:02:44,319 --> 00:02:48,720
one size for the turret range however i

69
00:02:46,800 --> 00:02:50,560
want to make it so that if i change this

70
00:02:48,720 --> 00:02:52,480
view radius variable right here

71
00:02:50,560 --> 00:02:53,840
then the size of my turret range will

72
00:02:52,480 --> 00:02:57,200
also change

73
00:02:53,840 --> 00:03:00,400
so for example my view radius of 100

74
00:02:57,200 --> 00:03:01,280
works right now for this view radius as

75
00:03:00,400 --> 00:03:03,200
you can see

76
00:03:01,280 --> 00:03:04,400
however if i change this to something

77
00:03:03,200 --> 00:03:06,879
like 50

78
00:03:04,400 --> 00:03:08,080
then i want the size of the view radius

79
00:03:06,879 --> 00:03:12,080
to also decrease

80
00:03:08,080 --> 00:03:13,200
to 50. so to do that it's actually not

81
00:03:12,080 --> 00:03:14,959
too complicated

82
00:03:13,200 --> 00:03:16,239
so first i'm going to set this back to

83
00:03:14,959 --> 00:03:18,720
100

84
00:03:16,239 --> 00:03:20,319
and what we have to do is to drag a set

85
00:03:18,720 --> 00:03:22,879
size to block

86
00:03:20,319 --> 00:03:24,879
and i'm going to put this over here so

87
00:03:22,879 --> 00:03:27,120
inside of the forever loop

88
00:03:24,879 --> 00:03:28,319
and what i'm going to do is that i'm

89
00:03:27,120 --> 00:03:30,640
going to drag

90
00:03:28,319 --> 00:03:32,319
a divided by operator and also a

91
00:03:30,640 --> 00:03:34,159
multiplication operator

92
00:03:32,319 --> 00:03:35,840
and then i'm going to put this divided

93
00:03:34,159 --> 00:03:38,319
by operator on the left side of the

94
00:03:35,840 --> 00:03:40,720
multiplication operator

95
00:03:38,319 --> 00:03:42,799
and then i'm going to go to variables

96
00:03:40,720 --> 00:03:45,120
and drag the view radius variable

97
00:03:42,799 --> 00:03:46,319
onto the left side of the divided by

98
00:03:45,120 --> 00:03:48,000
operator

99
00:03:46,319 --> 00:03:50,239
and then i'm going to drag this all

100
00:03:48,000 --> 00:03:52,480
inside of the set size to block

101
00:03:50,239 --> 00:03:54,080
so now to make the turret range sprite

102
00:03:52,480 --> 00:03:56,000
increase or decrease size

103
00:03:54,080 --> 00:03:57,840
based on the view radius variable we

104
00:03:56,000 --> 00:03:59,040
have to put whatever value of the view

105
00:03:57,840 --> 00:04:01,920
radius that works

106
00:03:59,040 --> 00:04:02,959
inside of here and then the current size

107
00:04:01,920 --> 00:04:05,360
of the turret range

108
00:04:02,959 --> 00:04:07,040
inside of here so in my case a turret

109
00:04:05,360 --> 00:04:10,319
range of size 100

110
00:04:07,040 --> 00:04:12,560
with a view radius of 100 works for me

111
00:04:10,319 --> 00:04:14,799
but it depends on how big you make your

112
00:04:12,560 --> 00:04:16,880
view radius image in your costume

113
00:04:14,799 --> 00:04:17,840
so for mine i'm going to put in a

114
00:04:16,880 --> 00:04:20,880
hundred

115
00:04:17,840 --> 00:04:23,520
in this part right here and this

116
00:04:20,880 --> 00:04:24,240
is the view radius variable and then in

117
00:04:23,520 --> 00:04:26,240
this part

118
00:04:24,240 --> 00:04:28,720
i'm going to also put in 100 because

119
00:04:26,240 --> 00:04:30,639
that's the size of my turret range

120
00:04:28,720 --> 00:04:32,160
so now if i drag this inside of the

121
00:04:30,639 --> 00:04:34,000
forever loop

122
00:04:32,160 --> 00:04:36,400
then the turret range should work as

123
00:04:34,000 --> 00:04:40,160
normal so the turret should shoot

124
00:04:36,400 --> 00:04:42,639
in here as you can see it does however

125
00:04:40,160 --> 00:04:44,160
if i change the view radius to something

126
00:04:42,639 --> 00:04:46,320
like 50

127
00:04:44,160 --> 00:04:47,199
then the size should also change

128
00:04:46,320 --> 00:04:50,639
accordingly

129
00:04:47,199 --> 00:04:52,880
like this and i'll put this in here

130
00:04:50,639 --> 00:04:56,160
as you can see the turret only shoots in

131
00:04:52,880 --> 00:04:58,960
range of this view radius right here and

132
00:04:56,160 --> 00:05:00,720
if i try something like 150

133
00:04:58,960 --> 00:05:02,960
then the turret range should be much

134
00:05:00,720 --> 00:05:04,639
larger and the turret should only shoot

135
00:05:02,960 --> 00:05:07,919
inside of here

136
00:05:04,639 --> 00:05:09,919
and cool so that works

137
00:05:07,919 --> 00:05:11,360
and then if i try something again like

138
00:05:09,919 --> 00:05:14,720
70

139
00:05:11,360 --> 00:05:18,240
then it should also update and work

140
00:05:14,720 --> 00:05:20,320
like so all right cool so again

141
00:05:18,240 --> 00:05:21,600
this number right here you put in

142
00:05:20,320 --> 00:05:24,720
whatever your original

143
00:05:21,600 --> 00:05:26,320
view radius was so in my case it was 100

144
00:05:24,720 --> 00:05:28,320
and then in this number you put in

145
00:05:26,320 --> 00:05:30,160
whatever size your turret range was

146
00:05:28,320 --> 00:05:32,880
that worked with your view radius of

147
00:05:30,160 --> 00:05:36,880
this number so in my case that was 100

148
00:05:32,880 --> 00:05:39,360
also so now it should work as normal

149
00:05:36,880 --> 00:05:41,600
all right cool so now that we're done

150
00:05:39,360 --> 00:05:44,479
with our customizable turret range

151
00:05:41,600 --> 00:05:45,280
i want to now add a base to the turret

152
00:05:44,479 --> 00:05:48,560
so something

153
00:05:45,280 --> 00:05:51,600
like this where it's like a

154
00:05:48,560 --> 00:05:54,240
square at the bottom of the turret

155
00:05:51,600 --> 00:05:54,240
like so

156
00:05:55,039 --> 00:05:58,960
so i sort of want to add some base like

157
00:05:56,960 --> 00:06:00,800
this however i can't do that

158
00:05:58,960 --> 00:06:02,319
and the reason is that when i place down

159
00:06:00,800 --> 00:06:05,199
a turret then the base

160
00:06:02,319 --> 00:06:06,960
also rotates with the turret like this

161
00:06:05,199 --> 00:06:08,319
so i want to add a base to the turret

162
00:06:06,960 --> 00:06:10,800
that does not rotate

163
00:06:08,319 --> 00:06:11,680
and in this case we have to create a new

164
00:06:10,800 --> 00:06:14,720
sprite

165
00:06:11,680 --> 00:06:16,479
so over here paint a new sprite

166
00:06:14,720 --> 00:06:19,600
and then for the base i am going to

167
00:06:16,479 --> 00:06:22,639
create sort of like a rounded rectangle

168
00:06:19,600 --> 00:06:25,840
so i'm going to first shift hold click

169
00:06:22,639 --> 00:06:27,120
and then drag a rectangle and center

170
00:06:25,840 --> 00:06:29,440
this

171
00:06:27,120 --> 00:06:31,840
and then to make it rounded i am going

172
00:06:29,440 --> 00:06:33,520
to click this button right here

173
00:06:31,840 --> 00:06:35,360
and then i'm going to create two more

174
00:06:33,520 --> 00:06:39,840
points let's say

175
00:06:35,360 --> 00:06:41,680
one over here and one over here

176
00:06:39,840 --> 00:06:43,199
and then i'm gonna click the middle one

177
00:06:41,680 --> 00:06:45,840
or the edge point

178
00:06:43,199 --> 00:06:46,400
and then i'm gonna delete it and there

179
00:06:45,840 --> 00:06:49,440
we go

180
00:06:46,400 --> 00:06:51,039
we have a rounded edge and then i'm

181
00:06:49,440 --> 00:06:52,639
going to do the same thing for the other

182
00:06:51,039 --> 00:06:55,840
three sides

183
00:06:52,639 --> 00:06:56,160
something like this all right and i

184
00:06:55,840 --> 00:06:58,720
think

185
00:06:56,160 --> 00:07:00,319
this is a pretty good base for my turret

186
00:06:58,720 --> 00:07:03,199
so now i'm going to click this

187
00:07:00,319 --> 00:07:04,400
and then increase the outline size a bit

188
00:07:03,199 --> 00:07:07,919
to

189
00:07:04,400 --> 00:07:09,039
i think eight is fine yep so a size of

190
00:07:07,919 --> 00:07:10,560
eight

191
00:07:09,039 --> 00:07:13,120
and then i'm going to copy this and

192
00:07:10,560 --> 00:07:16,639
paste this back into the turret costume

193
00:07:13,120 --> 00:07:17,599
to see how this looks okay i think it's

194
00:07:16,639 --> 00:07:19,520
a bit large

195
00:07:17,599 --> 00:07:20,639
so i'm going to go back to my base

196
00:07:19,520 --> 00:07:23,280
sprite

197
00:07:20,639 --> 00:07:24,720
and then decrease the size a bit all

198
00:07:23,280 --> 00:07:26,560
right

199
00:07:24,720 --> 00:07:28,880
and then i'm going to copy it go to my

200
00:07:26,560 --> 00:07:32,560
turret sprite and then paste it

201
00:07:28,880 --> 00:07:35,680
to see how it looks okay

202
00:07:32,560 --> 00:07:37,520
i think maybe still a bit too large so

203
00:07:35,680 --> 00:07:41,199
i'm going to make it smaller

204
00:07:37,520 --> 00:07:41,919
alright and then also for my turret

205
00:07:41,199 --> 00:07:46,000
sprite

206
00:07:41,919 --> 00:07:50,080
i'm going to make this part a bit longer

207
00:07:46,000 --> 00:07:53,199
so something like this all right

208
00:07:50,080 --> 00:07:56,160
and then i'm going to select all of this

209
00:07:53,199 --> 00:07:57,680
ctrl c or copy it and then go to my

210
00:07:56,160 --> 00:08:01,039
firing costume

211
00:07:57,680 --> 00:08:04,720
and then delete these two and paste

212
00:08:01,039 --> 00:08:08,560
all right and

213
00:08:04,720 --> 00:08:11,759
i am going to drag this forward a bit

214
00:08:08,560 --> 00:08:14,240
so over here and that should be fine

215
00:08:11,759 --> 00:08:15,440
all right so now we have my base image

216
00:08:14,240 --> 00:08:18,000
for my turret

217
00:08:15,440 --> 00:08:19,039
and i'm just going to name this space

218
00:08:18,000 --> 00:08:21,599
okay

219
00:08:19,039 --> 00:08:23,440
and then inside of the code i am going

220
00:08:21,599 --> 00:08:26,639
to first go to my turret

221
00:08:23,440 --> 00:08:27,919
so instead of my turret when i place

222
00:08:26,639 --> 00:08:30,560
down the turret

223
00:08:27,919 --> 00:08:31,759
or actually when i click this turret

224
00:08:30,560 --> 00:08:33,440
over here

225
00:08:31,759 --> 00:08:36,000
then i want to create a clone of the

226
00:08:33,440 --> 00:08:39,120
base which follows the turret

227
00:08:36,000 --> 00:08:40,240
so i'm going to go to control and then

228
00:08:39,120 --> 00:08:43,120
drag a

229
00:08:40,240 --> 00:08:44,000
create clone of myself and then i'm

230
00:08:43,120 --> 00:08:46,640
going to change this

231
00:08:44,000 --> 00:08:47,600
to the base and now inside of the base

232
00:08:46,640 --> 00:08:49,839
sprite

233
00:08:47,600 --> 00:08:51,600
i am going to go to events grab a

234
00:08:49,839 --> 00:08:54,480
windfly clicked

235
00:08:51,600 --> 00:08:54,959
and then i'm going to actually first

236
00:08:54,480 --> 00:08:57,680
show

237
00:08:54,959 --> 00:08:58,399
the original bass sprite because i want

238
00:08:57,680 --> 00:09:00,880
this bright

239
00:08:58,399 --> 00:09:01,920
to be shown over here so i'm going to

240
00:09:00,880 --> 00:09:04,399
show it

241
00:09:01,920 --> 00:09:05,760
and then make it go to somewhere around

242
00:09:04,399 --> 00:09:08,880
here

243
00:09:05,760 --> 00:09:12,160
so that's like x212

244
00:09:08,880 --> 00:09:13,920
and y159 alright and then

245
00:09:12,160 --> 00:09:15,760
i'm going to make the base the same size

246
00:09:13,920 --> 00:09:18,800
as the turret

247
00:09:15,760 --> 00:09:20,240
so the turret size is 65 percent so

248
00:09:18,800 --> 00:09:24,800
inside of the base

249
00:09:20,240 --> 00:09:24,800
i am going to set size to 65

250
00:09:24,880 --> 00:09:28,480
all right and now i'm also going to make

251
00:09:27,600 --> 00:09:31,440
the base

252
00:09:28,480 --> 00:09:33,200
go to the back so inside of looks let's

253
00:09:31,440 --> 00:09:36,480
drag a go to front layer

254
00:09:33,200 --> 00:09:39,360
and change this to go to back all right

255
00:09:36,480 --> 00:09:41,200
and now the base is under the turret and

256
00:09:39,360 --> 00:09:44,320
i'm going to change the y position a bit

257
00:09:41,200 --> 00:09:48,640
to maybe like 164

258
00:09:44,320 --> 00:09:51,519
162. okay so now as you can see

259
00:09:48,640 --> 00:09:52,959
in the shop area the base is exactly

260
00:09:51,519 --> 00:09:55,440
under the turret

261
00:09:52,959 --> 00:09:57,200
and now i think the turret looks nicer

262
00:09:55,440 --> 00:09:59,200
now that we have a base

263
00:09:57,200 --> 00:10:00,720
however the base does not follow the

264
00:09:59,200 --> 00:10:04,320
mouse pointer when we

265
00:10:00,720 --> 00:10:06,560
drag the turret so since the turbosprite

266
00:10:04,320 --> 00:10:08,000
created the clone of the base when we

267
00:10:06,560 --> 00:10:11,040
click on the turret

268
00:10:08,000 --> 00:10:14,480
then inside of the base we need to grab

269
00:10:11,040 --> 00:10:18,480
a when i receive clone

270
00:10:14,480 --> 00:10:21,120
or when it starts a clone then

271
00:10:18,480 --> 00:10:22,079
let's grab a set size 2 block first of

272
00:10:21,120 --> 00:10:24,720
all

273
00:10:22,079 --> 00:10:26,160
and then let's see the turret size when

274
00:10:24,720 --> 00:10:29,200
it's selected

275
00:10:26,160 --> 00:10:30,800
so that's 75 percent so let's set the

276
00:10:29,200 --> 00:10:34,240
base size to also

277
00:10:30,800 --> 00:10:37,040
75 percent and then

278
00:10:34,240 --> 00:10:38,000
let's see we also need to create a new

279
00:10:37,040 --> 00:10:39,920
variable

280
00:10:38,000 --> 00:10:41,440
and we have to make the same variable we

281
00:10:39,920 --> 00:10:44,240
have for the turret sprite

282
00:10:41,440 --> 00:10:45,360
which is the mouse action variable and

283
00:10:44,240 --> 00:10:49,279
then we have to select

284
00:10:45,360 --> 00:10:51,680
for the sprite only and then click ok

285
00:10:49,279 --> 00:10:52,399
all right and then right under here

286
00:10:51,680 --> 00:10:55,600
let's

287
00:10:52,399 --> 00:10:58,880
set mouse action to

288
00:10:55,600 --> 00:10:59,600
selected since when the turret creates

289
00:10:58,880 --> 00:11:01,839
the clone

290
00:10:59,600 --> 00:11:03,519
once we click the turret that means

291
00:11:01,839 --> 00:11:06,880
we're selecting the turret and the base

292
00:11:03,519 --> 00:11:10,000
as well and then let's go to control

293
00:11:06,880 --> 00:11:11,440
grab a forever loop and then i'm going

294
00:11:10,000 --> 00:11:15,440
to forever

295
00:11:11,440 --> 00:11:18,720
check if the mouse action

296
00:11:15,440 --> 00:11:22,240
is equal to

297
00:11:18,720 --> 00:11:22,880
selected so if we're currently selecting

298
00:11:22,240 --> 00:11:25,360
the turret

299
00:11:22,880 --> 00:11:26,399
and the base then i'm going to make the

300
00:11:25,360 --> 00:11:29,600
base

301
00:11:26,399 --> 00:11:31,920
go to the mouse pointer

302
00:11:29,600 --> 00:11:33,360
so grab it go to and then change this to

303
00:11:31,920 --> 00:11:35,839
mouse pointer

304
00:11:33,360 --> 00:11:37,360
all right cool so let's try it out once

305
00:11:35,839 --> 00:11:39,839
we click this turret

306
00:11:37,360 --> 00:11:41,680
then as you can see the base also

307
00:11:39,839 --> 00:11:44,160
follows the mouse pointer

308
00:11:41,680 --> 00:11:46,640
however if we place down the turret then

309
00:11:44,160 --> 00:11:48,480
the bass stills follow the mouse pointer

310
00:11:46,640 --> 00:11:50,240
so let's fix that so we have to go

311
00:11:48,480 --> 00:11:53,839
inside of the turret

312
00:11:50,240 --> 00:11:54,800
and then inside of here let's go to

313
00:11:53,839 --> 00:11:57,680
events

314
00:11:54,800 --> 00:11:58,000
and drag a broadcast message one and

315
00:11:57,680 --> 00:11:59,360
then

316
00:11:58,000 --> 00:12:01,120
i'm going to change this to something

317
00:11:59,360 --> 00:12:05,120
like broadcast

318
00:12:01,120 --> 00:12:07,839
let's call it place turret all right

319
00:12:05,120 --> 00:12:08,320
and then let's drag this under the wait

320
00:12:07,839 --> 00:12:11,519
until

321
00:12:08,320 --> 00:12:13,920
not mouse down so once we click again

322
00:12:11,519 --> 00:12:16,079
then we are going to place the turret

323
00:12:13,920 --> 00:12:18,240
and then inside of the basebrite

324
00:12:16,079 --> 00:12:19,360
we are going to receive the place turret

325
00:12:18,240 --> 00:12:21,120
message

326
00:12:19,360 --> 00:12:23,200
so essentially the turret is telling the

327
00:12:21,120 --> 00:12:26,800
base that we have placed the turret

328
00:12:23,200 --> 00:12:30,880
and then in this case we want to set

329
00:12:26,800 --> 00:12:32,880
the mouse action to none

330
00:12:30,880 --> 00:12:34,000
all right cool and since the mouse

331
00:12:32,880 --> 00:12:35,680
action is none

332
00:12:34,000 --> 00:12:37,120
then the bass won't follow the mouse

333
00:12:35,680 --> 00:12:40,160
pointer anymore

334
00:12:37,120 --> 00:12:40,800
and now if we try it once we click it

335
00:12:40,160 --> 00:12:43,600
follows

336
00:12:40,800 --> 00:12:44,880
however if you click again then the base

337
00:12:43,600 --> 00:12:47,600
stops moving

338
00:12:44,880 --> 00:12:48,720
along with the turret all right cool and

339
00:12:47,600 --> 00:12:51,200
now as you can see

340
00:12:48,720 --> 00:12:52,079
the base does not rotate however only

341
00:12:51,200 --> 00:12:55,360
the turret head

342
00:12:52,079 --> 00:12:55,920
does so let's try it again as you can

343
00:12:55,360 --> 00:12:58,160
see

344
00:12:55,920 --> 00:12:59,519
the base does not rotate and only the

345
00:12:58,160 --> 00:13:02,880
turret does

346
00:12:59,519 --> 00:13:04,720
and cool i think that looks a lot better

347
00:13:02,880 --> 00:13:06,240
um i think it looks like an actual

348
00:13:04,720 --> 00:13:07,920
turret now

349
00:13:06,240 --> 00:13:09,600
but i think i'm going to make the sizes

350
00:13:07,920 --> 00:13:13,600
of the turrets a bit smaller

351
00:13:09,600 --> 00:13:16,800
so i might change this to maybe 50

352
00:13:13,600 --> 00:13:18,880
and 40 for these two values and then

353
00:13:16,800 --> 00:13:20,320
instead of the turret i'm also going to

354
00:13:18,880 --> 00:13:23,760
change these so

355
00:13:20,320 --> 00:13:26,800
40 and 50

356
00:13:23,760 --> 00:13:29,920
and if we try it again then

357
00:13:26,800 --> 00:13:30,560
the turret is smaller and replace it all

358
00:13:29,920 --> 00:13:33,920
right cool

359
00:13:30,560 --> 00:13:35,440
i think this is a more appropriate size

360
00:13:33,920 --> 00:13:37,040
and yeah

361
00:13:35,440 --> 00:13:38,880
all right cool so now that we have the

362
00:13:37,040 --> 00:13:41,040
base down one more problem

363
00:13:38,880 --> 00:13:42,639
is that we can place this turret

364
00:13:41,040 --> 00:13:45,839
anywhere on the map

365
00:13:42,639 --> 00:13:48,320
and also we can stack these turrets so

366
00:13:45,839 --> 00:13:50,880
we have to fix these problems

367
00:13:48,320 --> 00:13:53,040
i am going to duplicate the base sprite

368
00:13:50,880 --> 00:13:54,880
to create a turret glider sprite

369
00:13:53,040 --> 00:13:56,880
and this sprite is going to essentially

370
00:13:54,880 --> 00:13:59,040
check whether it's touching the track

371
00:13:56,880 --> 00:14:00,000
or the other turrets so i'm going to

372
00:13:59,040 --> 00:14:03,839
call this

373
00:14:00,000 --> 00:14:05,920
something like turret collider

374
00:14:03,839 --> 00:14:07,839
all right and then inside of the

375
00:14:05,920 --> 00:14:11,839
costumes

376
00:14:07,839 --> 00:14:15,199
i am going to select the rectangle tool

377
00:14:11,839 --> 00:14:16,800
and then draw a rectangle over the base

378
00:14:15,199 --> 00:14:18,480
and i think i'm going to make it a bit

379
00:14:16,800 --> 00:14:22,000
smaller than the base

380
00:14:18,480 --> 00:14:23,680
so something like this all right

381
00:14:22,000 --> 00:14:27,120
and then i'm going to take out the

382
00:14:23,680 --> 00:14:28,800
outline so outline 0

383
00:14:27,120 --> 00:14:30,399
and then for the color i think i'm going

384
00:14:28,800 --> 00:14:34,160
to make it a super

385
00:14:30,399 --> 00:14:36,720
obvious color so maybe a red

386
00:14:34,160 --> 00:14:37,839
all right and then i'm going to delete

387
00:14:36,720 --> 00:14:41,120
the base

388
00:14:37,839 --> 00:14:42,320
okay so now inside of the code for the

389
00:14:41,120 --> 00:14:45,199
turret collider

390
00:14:42,320 --> 00:14:45,680
um let's see so under the wind fly

391
00:14:45,199 --> 00:14:48,399
clicked

392
00:14:45,680 --> 00:14:49,120
i'm going to first go to looks and then

393
00:14:48,399 --> 00:14:52,320
set

394
00:14:49,120 --> 00:14:54,000
the ghost effect to 100

395
00:14:52,320 --> 00:14:56,800
so we want the turret glider to be

396
00:14:54,000 --> 00:14:58,320
invisible and i'm also going to actually

397
00:14:56,800 --> 00:15:01,680
hide the turret collider

398
00:14:58,320 --> 00:15:03,600
so i'm going to hide this

399
00:15:01,680 --> 00:15:04,800
and in this case we don't actually need

400
00:15:03,600 --> 00:15:06,720
the set ghost effect

401
00:15:04,800 --> 00:15:08,160
and we also want the turret glider to

402
00:15:06,720 --> 00:15:08,959
follow the mouse pointer when we touch

403
00:15:08,160 --> 00:15:10,560
the turret

404
00:15:08,959 --> 00:15:13,360
because we want it to detect whether

405
00:15:10,560 --> 00:15:15,680
it's touching a track or another turret

406
00:15:13,360 --> 00:15:17,120
so in this case let's actually go to the

407
00:15:15,680 --> 00:15:20,079
turret

408
00:15:17,120 --> 00:15:21,920
and then when we click on the turret we

409
00:15:20,079 --> 00:15:26,480
want to also

410
00:15:21,920 --> 00:15:28,320
create clone of the turret collider

411
00:15:26,480 --> 00:15:29,600
okay and then inside of the turret

412
00:15:28,320 --> 00:15:32,079
glider sprite

413
00:15:29,600 --> 00:15:33,680
once the user is dragging the turret we

414
00:15:32,079 --> 00:15:36,000
want the collider to actually

415
00:15:33,680 --> 00:15:38,320
show so let's track a show under the

416
00:15:36,000 --> 00:15:41,759
when i saw as a clone

417
00:15:38,320 --> 00:15:43,680
and then let's see um

418
00:15:41,759 --> 00:15:46,160
let's keep all of this mouse action

419
00:15:43,680 --> 00:15:47,279
stuff and i'm also going to drag a go to

420
00:15:46,160 --> 00:15:49,360
front layer block

421
00:15:47,279 --> 00:15:51,680
and put this inside of the forever loop

422
00:15:49,360 --> 00:15:52,000
because i want the collider to show on

423
00:15:51,680 --> 00:15:55,360
top

424
00:15:52,000 --> 00:15:57,759
of everything and then inside of this

425
00:15:55,360 --> 00:16:02,320
mouse action equals selected part

426
00:15:57,759 --> 00:16:05,600
i'm going to check let's grab an if else

427
00:16:02,320 --> 00:16:06,880
if the turret lighter is touching the

428
00:16:05,600 --> 00:16:09,759
track

429
00:16:06,880 --> 00:16:10,800
so if touching and oh yeah we actually

430
00:16:09,759 --> 00:16:12,480
can't detect

431
00:16:10,800 --> 00:16:13,600
if it's touching the track sprite

432
00:16:12,480 --> 00:16:14,720
because the track is part of the

433
00:16:13,600 --> 00:16:17,600
backdrop

434
00:16:14,720 --> 00:16:19,279
so inside of the stage let's actually

435
00:16:17,600 --> 00:16:21,600
select this track

436
00:16:19,279 --> 00:16:23,120
so i'm going to actually do control x or

437
00:16:21,600 --> 00:16:25,040
cut

438
00:16:23,120 --> 00:16:26,480
and then i'm going to create a new

439
00:16:25,040 --> 00:16:28,320
sprite

440
00:16:26,480 --> 00:16:29,600
and inside of the costumes i'm going to

441
00:16:28,320 --> 00:16:31,360
paste

442
00:16:29,600 --> 00:16:32,880
so now we have our track sprite by

443
00:16:31,360 --> 00:16:35,360
itself and

444
00:16:32,880 --> 00:16:36,560
i'm also going to quickly drag a go to

445
00:16:35,360 --> 00:16:39,360
xy block

446
00:16:36,560 --> 00:16:41,279
and set it to zero zero alright so now

447
00:16:39,360 --> 00:16:43,759
we have our track

448
00:16:41,279 --> 00:16:45,120
and i'm also going to make it go to the

449
00:16:43,759 --> 00:16:47,839
back layer

450
00:16:45,120 --> 00:16:49,600
so everything goes in front of it let's

451
00:16:47,839 --> 00:16:51,920
go to back

452
00:16:49,600 --> 00:16:54,240
and now we should be fine we have our

453
00:16:51,920 --> 00:16:56,639
track sprite as normal

454
00:16:54,240 --> 00:16:57,839
okay and now inside of our turret

455
00:16:56,639 --> 00:17:01,680
collider sprite

456
00:16:57,839 --> 00:17:05,839
we can detect if touching the track

457
00:17:01,680 --> 00:17:05,839
so i'm going to name this track

458
00:17:06,000 --> 00:17:10,799
okay then i'm going to make the collider

459
00:17:09,600 --> 00:17:13,280
slightly visible

460
00:17:10,799 --> 00:17:15,120
so i'm going to drag a set and then

461
00:17:13,280 --> 00:17:17,520
change this to ghost

462
00:17:15,120 --> 00:17:18,559
to something like 20 so make it sort of

463
00:17:17,520 --> 00:17:20,799
transparent

464
00:17:18,559 --> 00:17:22,079
else if it's not touching the track that

465
00:17:20,799 --> 00:17:26,240
means we're okay

466
00:17:22,079 --> 00:17:29,760
so i'm going to set the ghost to 100

467
00:17:26,240 --> 00:17:31,120
so that makes it invisible and now if we

468
00:17:29,760 --> 00:17:34,480
try it out

469
00:17:31,120 --> 00:17:35,440
then if we click on the turret and go

470
00:17:34,480 --> 00:17:37,360
over the track

471
00:17:35,440 --> 00:17:40,080
then as you can see the collider turns

472
00:17:37,360 --> 00:17:43,679
red however once we leave it

473
00:17:40,080 --> 00:17:44,000
then it hides alright cool however one

474
00:17:43,679 --> 00:17:46,880
thing

475
00:17:44,000 --> 00:17:48,080
is that we can still place the turret so

476
00:17:46,880 --> 00:17:50,880
to avoid that

477
00:17:48,080 --> 00:17:52,559
let's go to variables and then i'm going

478
00:17:50,880 --> 00:17:55,440
to create a new variable

479
00:17:52,559 --> 00:17:55,919
and call this something like um can

480
00:17:55,440 --> 00:17:59,200
place

481
00:17:55,919 --> 00:18:03,120
tower okay and then i'm going to select

482
00:17:59,200 --> 00:18:04,799
for this sprite only all right

483
00:18:03,120 --> 00:18:06,160
and then i'm gonna check if it's

484
00:18:04,799 --> 00:18:08,000
touching the track

485
00:18:06,160 --> 00:18:09,840
then of course we don't want to place

486
00:18:08,000 --> 00:18:12,960
the tower so let's set

487
00:18:09,840 --> 00:18:15,200
can place tower to no else

488
00:18:12,960 --> 00:18:18,160
we can place a tower so i'm going to set

489
00:18:15,200 --> 00:18:18,160
it to yes

490
00:18:18,240 --> 00:18:22,720
however the code that is used to place

491
00:18:20,400 --> 00:18:24,400
the turret is inside of a turret sprite

492
00:18:22,720 --> 00:18:25,919
so we want to move it inside of the

493
00:18:24,400 --> 00:18:29,120
turret collider sprite

494
00:18:25,919 --> 00:18:32,320
so inside of the turbosprite let's

495
00:18:29,120 --> 00:18:35,120
find the part where we place the turret

496
00:18:32,320 --> 00:18:36,320
so it's over here so let's drag this

497
00:18:35,120 --> 00:18:38,240
entire block

498
00:18:36,320 --> 00:18:39,679
and then move it inside of our turret

499
00:18:38,240 --> 00:18:42,400
collider

500
00:18:39,679 --> 00:18:44,080
so like this all right so now we have

501
00:18:42,400 --> 00:18:46,640
the turret placing code

502
00:18:44,080 --> 00:18:48,320
inside of the turret collider and now

503
00:18:46,640 --> 00:18:51,919
inside of the turret

504
00:18:48,320 --> 00:18:54,960
we can take this part out and

505
00:18:51,919 --> 00:18:58,640
back inside of the collider

506
00:18:54,960 --> 00:19:02,640
let's also add an if statement and check

507
00:18:58,640 --> 00:19:05,679
if can place tower

508
00:19:02,640 --> 00:19:08,160
is equal to yes so

509
00:19:05,679 --> 00:19:08,960
pretty much since we set can place tower

510
00:19:08,160 --> 00:19:11,039
to no

511
00:19:08,960 --> 00:19:12,640
if the clyder is touching the track that

512
00:19:11,039 --> 00:19:13,440
means that we can only place down the

513
00:19:12,640 --> 00:19:15,440
turret

514
00:19:13,440 --> 00:19:18,160
once the glider is not touching the

515
00:19:15,440 --> 00:19:20,320
track so once we place down the turret

516
00:19:18,160 --> 00:19:21,760
we want to of course set the mouse

517
00:19:20,320 --> 00:19:24,160
action to none

518
00:19:21,760 --> 00:19:25,440
and also we can take out the set cancho

519
00:19:24,160 --> 00:19:27,280
radius circle to no

520
00:19:25,440 --> 00:19:29,280
because that's part of the turret which

521
00:19:27,280 --> 00:19:33,360
we will change later

522
00:19:29,280 --> 00:19:37,120
but let's also set the ken place tower

523
00:19:33,360 --> 00:19:38,320
to no and now since we took this block

524
00:19:37,120 --> 00:19:40,480
out of the turret sprite

525
00:19:38,320 --> 00:19:42,480
the turret still needs to set the mouse

526
00:19:40,480 --> 00:19:43,440
action and the can show radius circle

527
00:19:42,480 --> 00:19:46,720
variables

528
00:19:43,440 --> 00:19:48,160
so inside of the turret sprite let's go

529
00:19:46,720 --> 00:19:51,360
to events

530
00:19:48,160 --> 00:19:54,160
and drag a when i receive place turret

531
00:19:51,360 --> 00:19:54,640
that means the turret is placed down

532
00:19:54,160 --> 00:19:58,240
then

533
00:19:54,640 --> 00:20:01,679
we want to set

534
00:19:58,240 --> 00:20:05,600
can show radius circle to no

535
00:20:01,679 --> 00:20:09,200
and also set the mouse action

536
00:20:05,600 --> 00:20:11,919
to none all right cool

537
00:20:09,200 --> 00:20:14,159
and everything should work so if we try

538
00:20:11,919 --> 00:20:14,159
it out

539
00:20:14,720 --> 00:20:17,919
then if we try placing it down on the

540
00:20:17,360 --> 00:20:20,960
track

541
00:20:17,919 --> 00:20:22,080
then we can not however if we place it

542
00:20:20,960 --> 00:20:25,280
normally

543
00:20:22,080 --> 00:20:28,320
then we can all right cool

544
00:20:25,280 --> 00:20:29,120
so that works however the next thing we

545
00:20:28,320 --> 00:20:31,280
have to do

546
00:20:29,120 --> 00:20:32,880
is to make it so that it cannot be

547
00:20:31,280 --> 00:20:36,799
placed on top of other

548
00:20:32,880 --> 00:20:39,360
turrets so let's do that so let's see

549
00:20:36,799 --> 00:20:41,919
um so i'm going to right click and

550
00:20:39,360 --> 00:20:45,039
duplicate my base sprite

551
00:20:41,919 --> 00:20:46,240
and then i'm going to name this let's

552
00:20:45,039 --> 00:20:49,679
call this a

553
00:20:46,240 --> 00:20:49,679
placed turret lighter

554
00:20:49,840 --> 00:20:53,520
so as the name suggests this collider is

555
00:20:52,400 --> 00:20:56,080
only going to show

556
00:20:53,520 --> 00:20:58,720
when the turret is placed so i'm going

557
00:20:56,080 --> 00:21:01,200
to go inside of the costumes

558
00:20:58,720 --> 00:21:03,200
and for the place turret glider it's

559
00:21:01,200 --> 00:21:04,559
going to be the exact same size as my

560
00:21:03,200 --> 00:21:06,240
normal turret glider

561
00:21:04,559 --> 00:21:07,919
so i'm going to select this and then

562
00:21:06,240 --> 00:21:09,840
control c

563
00:21:07,919 --> 00:21:12,480
and then inside of the place turret

564
00:21:09,840 --> 00:21:15,840
lighter i'm going to delete this one

565
00:21:12,480 --> 00:21:17,120
and then ctrl v all right and then for

566
00:21:15,840 --> 00:21:20,080
the color

567
00:21:17,120 --> 00:21:20,960
just to um know which one's which i'm

568
00:21:20,080 --> 00:21:24,000
going to make this

569
00:21:20,960 --> 00:21:28,320
a different color so i might make this a

570
00:21:24,000 --> 00:21:31,440
let's say purple all right

571
00:21:28,320 --> 00:21:33,760
and now inside of the code i am going to

572
00:21:31,440 --> 00:21:37,679
hide the place turret glider

573
00:21:33,760 --> 00:21:40,720
so hide when the flag is clicked

574
00:21:37,679 --> 00:21:43,120
and everything else should be okay

575
00:21:40,720 --> 00:21:46,559
um all right so we actually don't need

576
00:21:43,120 --> 00:21:47,360
the go to x or set size or go to back

577
00:21:46,559 --> 00:21:50,480
layer

578
00:21:47,360 --> 00:21:53,760
so i'm going to take these out and then

579
00:21:50,480 --> 00:21:55,360
inside of the windows of clone i'm going

580
00:21:53,760 --> 00:21:59,200
to grab also a hide

581
00:21:55,360 --> 00:22:01,280
just in case and i'm going to set mouse

582
00:21:59,200 --> 00:22:03,520
action to selected okay

583
00:22:01,280 --> 00:22:05,440
and also all of this and i'm also going

584
00:22:03,520 --> 00:22:07,679
to drag a go to front layer

585
00:22:05,440 --> 00:22:09,280
inside of the forever loop just to make

586
00:22:07,679 --> 00:22:12,880
sure that this clutter

587
00:22:09,280 --> 00:22:15,360
goes on top of everything else and

588
00:22:12,880 --> 00:22:17,840
under the when i receive place turret

589
00:22:15,360 --> 00:22:19,919
which means that the turret is placed

590
00:22:17,840 --> 00:22:21,679
then i want to show the place turret

591
00:22:19,919 --> 00:22:25,200
glider

592
00:22:21,679 --> 00:22:27,440
and also set the mouse action to none

593
00:22:25,200 --> 00:22:28,640
which we already have here and now one

594
00:22:27,440 --> 00:22:30,240
last thing i want to do

595
00:22:28,640 --> 00:22:31,840
is that inside of the normal turret

596
00:22:30,240 --> 00:22:35,520
collider

597
00:22:31,840 --> 00:22:38,559
after it places a turret i want to

598
00:22:35,520 --> 00:22:40,960
delete its clone so delete it

599
00:22:38,559 --> 00:22:41,679
all right now finally in the turret

600
00:22:40,960 --> 00:22:44,159
glider

601
00:22:41,679 --> 00:22:45,200
we also want to detect if it's touching

602
00:22:44,159 --> 00:22:50,000
the track

603
00:22:45,200 --> 00:22:52,480
or touching the placed turret collider

604
00:22:50,000 --> 00:22:53,440
then of course we cannot place down the

605
00:22:52,480 --> 00:22:56,159
turret

606
00:22:53,440 --> 00:22:57,600
so let's drag the place turret glider

607
00:22:56,159 --> 00:23:00,720
and the ore

608
00:22:57,600 --> 00:23:01,919
and drag this back and oh yeah one last

609
00:23:00,720 --> 00:23:04,559
thing i forgot to do

610
00:23:01,919 --> 00:23:05,919
is that inside of the turret sprite i

611
00:23:04,559 --> 00:23:08,240
have to also

612
00:23:05,919 --> 00:23:09,200
create a clone of the placed turret

613
00:23:08,240 --> 00:23:12,159
collider

614
00:23:09,200 --> 00:23:13,360
so i'm going to go to control and then

615
00:23:12,159 --> 00:23:16,480
create clone

616
00:23:13,360 --> 00:23:17,760
of placed turret collider and now let's

617
00:23:16,480 --> 00:23:20,880
try it out

618
00:23:17,760 --> 00:23:24,480
so if we place the turret

619
00:23:20,880 --> 00:23:26,480
all right here is the clyder and now

620
00:23:24,480 --> 00:23:28,799
as you can see we cannot place the

621
00:23:26,480 --> 00:23:32,320
turrets on top of each other

622
00:23:28,799 --> 00:23:34,720
so it works all right cool

623
00:23:32,320 --> 00:23:36,799
so now of course i want to hide the

624
00:23:34,720 --> 00:23:38,720
colliders once they're placed

625
00:23:36,799 --> 00:23:41,120
sew inside of the place turret glider

626
00:23:38,720 --> 00:23:44,159
sprite

627
00:23:41,120 --> 00:23:45,039
i'm going to go to looks and then drag a

628
00:23:44,159 --> 00:23:47,760
set

629
00:23:45,039 --> 00:23:49,200
ghost effect to 100 when the flag is

630
00:23:47,760 --> 00:23:52,400
clicked

631
00:23:49,200 --> 00:23:54,480
right so let's try it again now the

632
00:23:52,400 --> 00:23:57,200
place turret gliders do not show

633
00:23:54,480 --> 00:23:58,240
however you cannot place turrets on top

634
00:23:57,200 --> 00:24:01,200
of each other

635
00:23:58,240 --> 00:24:01,200
or on the map

636
00:24:01,360 --> 00:24:09,039
alright cool so everything seems to work

637
00:24:05,760 --> 00:24:10,320
and yeah now we have better turret

638
00:24:09,039 --> 00:24:12,000
placement

639
00:24:10,320 --> 00:24:14,559
and one last thing i want to do is that

640
00:24:12,000 --> 00:24:17,840
i want to create a layering system

641
00:24:14,559 --> 00:24:20,240
because for example um sometimes for

642
00:24:17,840 --> 00:24:23,279
some reason the base

643
00:24:20,240 --> 00:24:24,240
might actually be on top of the turret

644
00:24:23,279 --> 00:24:27,120
or something like that

645
00:24:24,240 --> 00:24:28,720
like this for example so i just want to

646
00:24:27,120 --> 00:24:31,679
make sure that everything

647
00:24:28,720 --> 00:24:33,600
is ordered correctly and to do that i am

648
00:24:31,679 --> 00:24:36,320
going to go through all of these sprites

649
00:24:33,600 --> 00:24:38,400
and set the correct layer so first off

650
00:24:36,320 --> 00:24:41,600
in the turret

651
00:24:38,400 --> 00:24:44,960
um i am going to grab another

652
00:24:41,600 --> 00:24:46,400
when i start as a clone and a forever

653
00:24:44,960 --> 00:24:49,600
loop

654
00:24:46,400 --> 00:24:52,799
and then i'm going to forever make it

655
00:24:49,600 --> 00:24:53,760
go to the front layer and i'm going to

656
00:24:52,799 --> 00:24:56,880
make it go

657
00:24:53,760 --> 00:24:59,600
backwards one layer

658
00:24:56,880 --> 00:25:00,400
okay and then of course we want the base

659
00:24:59,600 --> 00:25:05,120
directly

660
00:25:00,400 --> 00:25:06,880
under this turret so inside of the base

661
00:25:05,120 --> 00:25:08,960
in the forever loop i am going to make

662
00:25:06,880 --> 00:25:11,600
it go to front layer

663
00:25:08,960 --> 00:25:13,600
and then make it go backwards something

664
00:25:11,600 --> 00:25:15,919
like five layers

665
00:25:13,600 --> 00:25:17,440
okay just to make sure that the base is

666
00:25:15,919 --> 00:25:20,960
behind the actual

667
00:25:17,440 --> 00:25:23,440
turret and then for the turret range

668
00:25:20,960 --> 00:25:25,679
we want to make sure that it's behind

669
00:25:23,440 --> 00:25:29,279
the turret and the turret base

670
00:25:25,679 --> 00:25:31,679
so in the range i am going to make it

671
00:25:29,279 --> 00:25:32,720
go to front layer and make it go

672
00:25:31,679 --> 00:25:35,520
backwards

673
00:25:32,720 --> 00:25:36,400
let's say like 10 layers all right just

674
00:25:35,520 --> 00:25:38,480
to make sure

675
00:25:36,400 --> 00:25:40,559
and then for the turret and place turret

676
00:25:38,480 --> 00:25:41,120
sprites let's make them go to front

677
00:25:40,559 --> 00:25:43,679
layer

678
00:25:41,120 --> 00:25:44,400
all right we have go to front layer and

679
00:25:43,679 --> 00:25:47,840
for this one

680
00:25:44,400 --> 00:25:49,440
also go to front layer okay and lastly

681
00:25:47,840 --> 00:25:51,840
for the enemy sprite

682
00:25:49,440 --> 00:25:52,559
we actually always want them to appear

683
00:25:51,840 --> 00:25:57,840
under

684
00:25:52,559 --> 00:25:57,840
the turret range so inside of the enemy

685
00:25:58,080 --> 00:26:01,600
inside of the forever loop i am going to

686
00:26:01,279 --> 00:26:04,000
grab

687
00:26:01,600 --> 00:26:05,760
a go to back layer because we wanted to

688
00:26:04,000 --> 00:26:06,640
make sure that it goes under everything

689
00:26:05,760 --> 00:26:09,120
else

690
00:26:06,640 --> 00:26:10,240
and then i'm going to drag a go forward

691
00:26:09,120 --> 00:26:12,320
one layer

692
00:26:10,240 --> 00:26:14,000
and that's because we want to make sure

693
00:26:12,320 --> 00:26:17,200
that the enemy is of course

694
00:26:14,000 --> 00:26:20,880
above the track and for the track

695
00:26:17,200 --> 00:26:24,159
i'm going to drag a windfly clicked

696
00:26:20,880 --> 00:26:24,880
and forever loop then always go to back

697
00:26:24,159 --> 00:26:27,840
layer

698
00:26:24,880 --> 00:26:29,440
so the track is always on the bottom and

699
00:26:27,840 --> 00:26:30,880
now everything should be layered

700
00:26:29,440 --> 00:26:34,640
correctly

701
00:26:30,880 --> 00:26:35,600
all right cool and now i'm going to hide

702
00:26:34,640 --> 00:26:38,080
these variables

703
00:26:35,600 --> 00:26:41,919
so i'm going to hide the base variable

704
00:26:38,080 --> 00:26:46,000
and also the turret collider variable

705
00:26:41,919 --> 00:26:46,960
all right cool anyways that's it for

706
00:26:46,000 --> 00:26:48,720
this tutorial

707
00:26:46,960 --> 00:26:50,000
if you enjoyed it then give it a thumbs

708
00:26:48,720 --> 00:26:52,320
up and subscribe too

709
00:26:50,000 --> 00:26:53,840
if you haven't already in the next video

710
00:26:52,320 --> 00:26:55,440
i'll make it so that you can view a

711
00:26:53,840 --> 00:26:57,520
specific turret's range

712
00:26:55,440 --> 00:26:59,039
and i'll also start creating new enemies

713
00:26:57,520 --> 00:27:01,200
and a wave system

714
00:26:59,039 --> 00:27:02,240
by the way this project is shared on my

715
00:27:01,200 --> 00:27:04,960
scratch profile

716
00:27:02,240 --> 00:27:06,559
link is in the description below anyways

717
00:27:04,960 --> 00:27:16,159
that's it for this tutorial

718
00:27:06,559 --> 00:27:16,159
see ya


