1
00:00:01,002 --> 00:00:02,000
- [Instructor] Hi.

2
00:00:02,000 --> 00:00:04,004
This is video Building a Particle System.

3
00:00:04,004 --> 00:00:05,006
In the previous video,

4
00:00:05,006 --> 00:00:08,006
we looked at the SFML drawable class.

5
00:00:08,006 --> 00:00:09,006
In this video,

6
00:00:09,006 --> 00:00:12,005
we're going to take a look
at coding the particle class,

7
00:00:12,005 --> 00:00:14,002
coding the particleSystem class,

8
00:00:14,002 --> 00:00:16,004
and using the particleSystem class.

9
00:00:16,004 --> 00:00:18,001
Before we start coding,

10
00:00:18,001 --> 00:00:20,003
it will be helpful to
see exactly what it is

11
00:00:20,003 --> 00:00:21,007
we are trying to achieve.

12
00:00:21,007 --> 00:00:24,005
Take a look at this image.

13
00:00:24,005 --> 00:00:27,006
This is an image of a particle
effect on a plain background.

14
00:00:27,006 --> 00:00:29,009
We will use the effect in our game.

15
00:00:29,009 --> 00:00:32,002
The first way we achieve the effect is

16
00:00:32,002 --> 00:00:35,006
first we spawn 1000 dots, particles,

17
00:00:35,006 --> 00:00:38,006
one on top of the other at
a chosen pixel position.

18
00:00:38,006 --> 00:00:40,009
Then, in each frame of the game,

19
00:00:40,009 --> 00:00:43,006
move each of the 1000 particles outward

20
00:00:43,006 --> 00:00:46,006
at a predetermined but
random speed and angle.

21
00:00:46,006 --> 00:00:48,008
Repeat step two for two seconds

22
00:00:48,008 --> 00:00:50,006
and then make the particles disappear.

23
00:00:50,006 --> 00:00:53,008
We will use a vertex
array to draw all the dots

24
00:00:53,008 --> 00:00:55,003
and the primitive type of point

25
00:00:55,003 --> 00:00:57,008
to represent each particle visually.

26
00:00:57,008 --> 00:01:00,000
Furthermore, we will inherit from drawable

27
00:01:00,000 --> 00:01:04,004
so that our particle system can
take care of drawing itself.

28
00:01:04,004 --> 00:01:06,007
The particle class will be a simple class

29
00:01:06,007 --> 00:01:09,006
that represents just one
of the 1000 particles.

30
00:01:09,006 --> 00:01:11,000
Let's start coding.

31
00:01:11,000 --> 00:01:14,004
Right-click Header Files
in Solution Explorer

32
00:01:14,004 --> 00:01:16,004
and select Add New Item.

33
00:01:16,004 --> 00:01:18,002
In the Add New Item window,

34
00:01:18,002 --> 00:01:21,005
click Header File and
rename the file to Particle.

35
00:01:21,005 --> 00:01:23,007
Finally, click Add button.

36
00:01:23,007 --> 00:01:25,008
We are now ready to code the header file

37
00:01:25,008 --> 00:01:27,003
for the particle class.

38
00:01:27,003 --> 00:01:30,003
Add this code to the Particle.h file.

39
00:01:30,003 --> 00:01:31,003
In this code,

40
00:01:31,003 --> 00:01:33,004
we have two Vector2f objects.

41
00:01:33,004 --> 00:01:35,006
One will represent the horizontal

42
00:01:35,006 --> 00:01:37,006
and vertical coordinates of the particle,

43
00:01:37,006 --> 00:01:39,003
and the other will
represent the horizontal

44
00:01:39,003 --> 00:01:41,008
and vertical speed.

45
00:01:41,008 --> 00:01:43,009
When you have a rate of change, speed,

46
00:01:43,009 --> 00:01:45,001
in more than one direction,

47
00:01:45,001 --> 00:01:47,008
the combined values
also define a direction.

48
00:01:47,008 --> 00:01:49,006
This is called velocity.

49
00:01:49,006 --> 00:01:53,003
Hence the Vector2f is called m_Velocity.

50
00:01:53,003 --> 00:01:55,004
We also have a number of public functions.

51
00:01:55,004 --> 00:01:57,004
First is the constructor.

52
00:01:57,004 --> 00:01:58,009
It takes a Vector2f

53
00:01:58,009 --> 00:02:01,006
which will be used to let it
know what direction velocity

54
00:02:01,006 --> 00:02:03,003
this particle will have.

55
00:02:03,003 --> 00:02:05,000
This implies that the system,

56
00:02:05,000 --> 00:02:06,002
not the particle itself,

57
00:02:06,002 --> 00:02:07,009
will be choosing the velocity.

58
00:02:07,009 --> 00:02:10,001
Next is the update function,

59
00:02:10,001 --> 00:02:12,008
which takes the previous frame has taken.

60
00:02:12,008 --> 00:02:14,007
We will use this to move the particle

61
00:02:14,007 --> 00:02:17,006
by precisely the correct amount.

62
00:02:17,006 --> 00:02:18,007
The final two functions,

63
00:02:18,007 --> 00:02:20,008
setPosition and getPosition,

64
00:02:20,008 --> 00:02:23,001
are used to move the
particle into position

65
00:02:23,001 --> 00:02:25,001
and find out its position, respectively.

66
00:02:25,001 --> 00:02:27,004
All these functions
will make complete sense

67
00:02:27,004 --> 00:02:28,006
when we code them.

68
00:02:28,006 --> 00:02:32,002
Now, moving on to coding
the Particle.cpp file.

69
00:02:32,002 --> 00:02:35,006
First right-click Source
Files in the Solution Explorer

70
00:02:35,006 --> 00:02:37,006
and select Add New Item.

71
00:02:37,006 --> 00:02:40,007
In the open window, click C++ File,

72
00:02:40,007 --> 00:02:44,009
and then in the Name field, type Particle.

73
00:02:44,009 --> 00:02:46,008
Lastly, click Add.

74
00:02:46,008 --> 00:02:49,004
We are now ready to code the .cpp file

75
00:02:49,004 --> 00:02:50,009
for the particle class.

76
00:02:50,009 --> 00:02:53,004
Add this highlighted code to the file.

77
00:02:53,004 --> 00:02:57,001
All these functions use
concepts we've seen before.

78
00:02:57,001 --> 00:03:00,009
The constructor sets up
the m_Velocity value .x

79
00:03:00,009 --> 00:03:03,001
and m_Velocity.y values

80
00:03:03,001 --> 00:03:06,000
using the passed in Vector2f object,

81
00:03:06,000 --> 00:03:07,001
that is, direction.

82
00:03:07,001 --> 00:03:09,007
The update function moves the horizontal

83
00:03:09,007 --> 00:03:11,006
and vertical positions of the particle

84
00:03:11,006 --> 00:03:16,009
by multiplying m_Velocity by
the elapsed time, dtAsSeconds.

85
00:03:16,009 --> 00:03:18,007
Notice that to achieve this,

86
00:03:18,007 --> 00:03:22,001
we simply add the two
Vector2f objects together.

87
00:03:22,001 --> 00:03:24,001
There is no need to perform calculations

88
00:03:24,001 --> 00:03:27,001
for both the x and y members separately.

89
00:03:27,001 --> 00:03:31,000
The setPosition function
initializes the m_Position object

90
00:03:31,000 --> 00:03:32,009
with the passed in values.

91
00:03:32,009 --> 00:03:36,007
The getPosition function
returns m_Position

92
00:03:36,007 --> 00:03:38,000
to the calling code.

93
00:03:38,000 --> 00:03:40,004
We now have a fully
functioning particle class.

94
00:03:40,004 --> 00:03:42,008
Next we will code a particleSystem class

95
00:03:42,008 --> 00:03:45,004
to spawn and control the particles.

96
00:03:45,004 --> 00:03:48,007
So for coding header file
for the particleSystem class,

97
00:03:48,007 --> 00:03:51,002
create a .h file as we always do.

98
00:03:51,002 --> 00:03:53,007
Just keep in mind the particleSystem class

99
00:03:53,007 --> 00:03:56,004
does most of the work
for our particle effects.

100
00:03:56,004 --> 00:03:58,009
It is this class that we
will create an instance of

101
00:03:58,009 --> 00:04:00,006
in the engine class.

102
00:04:00,006 --> 00:04:02,004
Name the particle system.

103
00:04:02,004 --> 00:04:05,001
So the name would be ParticleSystem.h.

104
00:04:05,001 --> 00:04:07,007
Click on Add once you rename it.

105
00:04:07,007 --> 00:04:08,006
Cool.

106
00:04:08,006 --> 00:04:10,002
We're now ready to code the header file

107
00:04:10,002 --> 00:04:11,009
for the particleSystem class.

108
00:04:11,009 --> 00:04:14,007
Add this code for the
particleSystem class.

109
00:04:14,007 --> 00:04:17,007
This is the entire highlighted code.

110
00:04:17,007 --> 00:04:20,001
Let's go through this a bit at a time.

111
00:04:20,001 --> 00:04:23,005
Firstly, notice that we are
inheriting from Drawable.

112
00:04:23,005 --> 00:04:24,009
This is what will enable us

113
00:04:24,009 --> 00:04:29,003
to pass our particleSystem
instance to m_Window.draw

114
00:04:29,003 --> 00:04:31,007
because ParticleSystem is a drawable.

115
00:04:31,007 --> 00:04:35,008
There is a vector named
m_Particles of type Particle.

116
00:04:35,008 --> 00:04:39,005
This vector will hold each and
every instance of Particle.

117
00:04:39,005 --> 00:04:43,005
Next we have a VertexArray
called m_Vertices.

118
00:04:43,005 --> 00:04:45,009
This will be used to
draw all the particles

119
00:04:45,009 --> 00:04:48,003
in the form of a whole
bunch of point primitives.

120
00:04:48,003 --> 00:04:51,006
The m_Duration float variable

121
00:04:51,006 --> 00:04:53,007
is how long each effect will last.

122
00:04:53,007 --> 00:04:56,004
We will initialize it in
the Constructor function.

123
00:04:56,004 --> 00:04:59,007
The Boolean m_IsRunning variable

124
00:04:59,007 --> 00:05:02,001
will be used to indicate
whether the particle system

125
00:05:02,001 --> 00:05:04,000
is currently in use or not.

126
00:05:04,000 --> 00:05:05,009
For now we have set it to false.

127
00:05:05,009 --> 00:05:08,001
Next, in the public section,

128
00:05:08,001 --> 00:05:10,007
we first have the pure
virtual function draw

129
00:05:10,007 --> 00:05:12,008
that we will soon implement
to handle what happens

130
00:05:12,008 --> 00:05:15,001
when we pass our instance
of ParticleSystem

131
00:05:15,001 --> 00:05:17,009
to m_Window.draw.

132
00:05:17,009 --> 00:05:20,006
The init function will
prepare the vertex array

133
00:05:20,006 --> 00:05:21,008
and the vector.

134
00:05:21,008 --> 00:05:24,003
It will also initialize
all the particle objects

135
00:05:24,003 --> 00:05:25,003
held by the vector

136
00:05:25,003 --> 00:05:27,007
with their velocities
and initial positions.

137
00:05:27,007 --> 00:05:29,004
The update function will loop

138
00:05:29,004 --> 00:05:32,000
through each and every
particle instance in the vector

139
00:05:32,000 --> 00:05:34,003
and call their individual
update functions.

140
00:05:34,003 --> 00:05:36,004
The running function provides access

141
00:05:36,004 --> 00:05:38,009
to the m_IsRunning variable

142
00:05:38,009 --> 00:05:40,005
so that the game engine can query

143
00:05:40,005 --> 00:05:43,002
whether or not the particle
system is currently in use.

144
00:05:43,002 --> 00:05:45,003
Let's code the function definitions

145
00:05:45,003 --> 00:05:48,001
to see what goes on inside ParticleSystem.

146
00:05:48,001 --> 00:05:51,003
So for coding ParticleSystem.cpp file,

147
00:05:51,003 --> 00:05:54,000
right-click Source Files
in the Solution Explorer

148
00:05:54,000 --> 00:05:55,007
and select Add New Item.

149
00:05:55,007 --> 00:05:59,005
In the Add New Item
window, click C++ File,

150
00:05:59,005 --> 00:06:02,005
and then in the Name
field, type ParticleSystem.

151
00:06:02,005 --> 00:06:04,006
Finally, click the Add button.

152
00:06:04,006 --> 00:06:05,005
Great.

153
00:06:05,005 --> 00:06:07,008
We're ready to code the .cpp file

154
00:06:07,008 --> 00:06:09,007
for the ParticleSystem class.

155
00:06:09,007 --> 00:06:12,000
We'll split the file into
five sections to code

156
00:06:12,000 --> 00:06:13,005
and discuss it better.

157
00:06:13,005 --> 00:06:16,003
Here I've added the first
section of the code.

158
00:06:16,003 --> 00:06:18,009
You'll have to add this highlighted code.

159
00:06:18,009 --> 00:06:20,002
Let's take a look at it.

160
00:06:20,002 --> 00:06:23,000
We've added the necessary
includes at the start.

161
00:06:23,000 --> 00:06:26,002
Then we have the definition
of the init function.

162
00:06:26,002 --> 00:06:29,007
We call setPrimitiveType
with Points as the argument

163
00:06:29,007 --> 00:06:33,008
so that m_VertexArray knows
what types of primitive

164
00:06:33,008 --> 00:06:35,003
it will be dealing with.

165
00:06:35,003 --> 00:06:39,003
We resize m_Vertices with numParticles,

166
00:06:39,003 --> 00:06:42,000
which was passed to the init
function when it was called.

167
00:06:42,000 --> 00:06:45,009
The for loop creates random
values for speed and angle.

168
00:06:45,009 --> 00:06:48,004
It then uses trigonometric functions

169
00:06:48,004 --> 00:06:50,006
to convert those values into a vector,

170
00:06:50,006 --> 00:06:53,002
which is stored in the Vector2f direction.

171
00:06:53,002 --> 00:06:55,005
The last thing that
happens in the for loop

172
00:06:55,005 --> 00:06:56,007
and the init function

173
00:06:56,007 --> 00:06:59,008
is that the vector is passed
into the particle constructor.

174
00:06:59,008 --> 00:07:03,007
The new particle instance
is stored in m_Particles

175
00:07:03,007 --> 00:07:06,004
using the push_back function.

176
00:07:06,004 --> 00:07:09,003
Therefore, a call to
init with a value of 1000

177
00:07:09,003 --> 00:07:12,004
would mean we have 1000
instances of Particle

178
00:07:12,004 --> 00:07:16,000
with random velocity
stashed away in m_Particles

179
00:07:16,000 --> 00:07:18,007
just waiting to blow.

180
00:07:18,007 --> 00:07:22,008
Next add the update function
to ParticleSystem.cpp.

181
00:07:22,008 --> 00:07:25,003
I've highlighted the code you need to add.

182
00:07:25,003 --> 00:07:27,006
The update function is
simpler than it looks

183
00:07:27,006 --> 00:07:28,007
at first glance.

184
00:07:28,007 --> 00:07:29,006
First of all,

185
00:07:29,006 --> 00:07:34,001
m_Duration is reduced by
the passed in time dt.

186
00:07:34,001 --> 00:07:36,006
This is so we know when the
two seconds have elapsed.

187
00:07:36,006 --> 00:07:41,007
A vector iterator i is declared
for use with m_Particles

188
00:07:41,007 --> 00:07:44,000
and currentVertex is set to zero.

189
00:07:44,000 --> 00:07:47,003
The for loop goes through
each of the particle instances

190
00:07:47,003 --> 00:07:49,002
in m_Particles.

191
00:07:49,002 --> 00:07:50,006
For each and every one,

192
00:07:50,006 --> 00:07:52,003
it calls its update function

193
00:07:52,003 --> 00:07:54,001
and passes in dt.

194
00:07:54,001 --> 00:07:55,009
Each particle will update its position.

195
00:07:55,009 --> 00:07:58,006
After the particle has updated itself,

196
00:07:58,006 --> 00:08:01,004
the appropriate vertex in m_Vetices

197
00:08:01,004 --> 00:08:04,006
is updated by using the
particle's getPosition function.

198
00:08:04,006 --> 00:08:06,009
At the end of each pass through,

199
00:08:06,009 --> 00:08:09,007
the for loop currentVertex is incremented,

200
00:08:09,007 --> 00:08:11,004
ready for the next vertex.

201
00:08:11,004 --> 00:08:14,000
After the for loop has completed,

202
00:08:14,000 --> 00:08:16,003
the if statement checks whether it's time

203
00:08:16,003 --> 00:08:17,008
to switch off the effect.

204
00:08:17,008 --> 00:08:19,007
If two seconds have elapsed,

205
00:08:19,007 --> 00:08:22,000
m_IsRunning is set to false.

206
00:08:22,000 --> 00:08:25,003
Next add the emitParticles function.

207
00:08:25,003 --> 00:08:27,004
This is the code you need to add.

208
00:08:27,004 --> 00:08:29,009
This is the function we will call

209
00:08:29,009 --> 00:08:31,008
to start the particle system running.

210
00:08:31,008 --> 00:08:35,003
So first we set m_IsRunning to true

211
00:08:35,003 --> 00:08:37,007
and m_Duration to two.

212
00:08:37,007 --> 00:08:39,005
We declare an iterator, i,

213
00:08:39,005 --> 00:08:43,004
to iterate through all the
particle objects in m_Particles,

214
00:08:43,004 --> 00:08:45,005
and then we do so in a for loop.

215
00:08:45,005 --> 00:08:47,004
Inside the for loop,

216
00:08:47,004 --> 00:08:50,001
we set each particle and
vertex array to Yellow

217
00:08:50,001 --> 00:08:52,004
and set each position to startPosition,

218
00:08:52,004 --> 00:08:54,007
which was passed in as a parameter.

219
00:08:54,007 --> 00:08:57,000
Remember that each particle starts life

220
00:08:57,000 --> 00:08:58,006
in exactly the same position,

221
00:08:58,006 --> 00:09:01,000
but they are each assigned
a different velocity.

222
00:09:01,000 --> 00:09:06,001
Lastly we increment current vertex.

223
00:09:06,001 --> 00:09:09,004
Now add the pure virtual
draw function definition.

224
00:09:09,004 --> 00:09:18,002
I'm writing the code you'll need to add.

225
00:09:18,002 --> 00:09:19,000
In this code,

226
00:09:19,000 --> 00:09:20,007
we simply use target to call draw

227
00:09:20,007 --> 00:09:25,001
passing in m_Vertices and states.

228
00:09:25,001 --> 00:09:27,002
This is exactly as we discussed

229
00:09:27,002 --> 00:09:30,006
when talking about drawable
earlier in the session,

230
00:09:30,006 --> 00:09:32,005
except we pass in our vertex array,

231
00:09:32,005 --> 00:09:35,000
which holds 1000 point primitives,

232
00:09:35,000 --> 00:09:37,007
instead of the hypothetical
spaceship sprite.

233
00:09:37,007 --> 00:09:42,004
Finally we have the running function.

234
00:09:42,004 --> 00:09:44,005
The running function is
a simple getter function

235
00:09:44,005 --> 00:09:47,007
that returns the value of m_IsRunning.

236
00:09:47,007 --> 00:09:49,003
We will see where this is useful

237
00:09:49,003 --> 00:09:52,003
to determine the current
state of the particle system.

238
00:09:52,003 --> 00:09:54,009
To put our particle system
to work is straightforward,

239
00:09:54,009 --> 00:09:57,008
especially because we
inherited from Drawable.

240
00:09:57,008 --> 00:09:59,002
Open Engine.h,

241
00:09:59,002 --> 00:10:02,004
add an include directive
for ParticleSystem.h,

242
00:10:02,004 --> 00:10:05,009
and then we'll write
ParticleSystem object, also.

243
00:10:05,009 --> 00:10:07,009
After TextureHolder th,

244
00:10:07,009 --> 00:10:09,001
add a comment.

245
00:10:09,001 --> 00:10:10,008
Create a particle system,

246
00:10:10,008 --> 00:10:14,002
ParticleSystem m_PS.

247
00:10:14,002 --> 00:10:16,005
Next we initialize the system.

248
00:10:16,005 --> 00:10:18,009
Open the Engine.cpp file

249
00:10:18,009 --> 00:10:20,003
and then we'll write a short code

250
00:10:20,003 --> 00:10:22,006
right at the end of
the engine constructor.

251
00:10:22,006 --> 00:10:24,000
First write a comment.

252
00:10:24,000 --> 00:10:26,000
Initialize the particle system.

253
00:10:26,000 --> 00:10:29,007
Then we'll write m_PS.init(1000).

254
00:10:29,007 --> 00:10:32,006
So the vertex array and the
vector of particle instances

255
00:10:32,006 --> 00:10:34,005
are ready for action.

256
00:10:34,005 --> 00:10:38,002
Moving on to updating the
particle system in each frame,

257
00:10:38,002 --> 00:10:40,007
open the Update.cpp file

258
00:10:40,007 --> 00:10:43,003
and we'll write a code for
updating the particle system.

259
00:10:43,003 --> 00:10:46,005
We'll write this code after
the closing curly braces

260
00:10:46,005 --> 00:10:49,006
and before the End of
Update Function comment.

261
00:10:49,006 --> 00:10:50,007
First a comment.

262
00:10:50,007 --> 00:10:52,000
Update the particles.

263
00:10:52,000 --> 00:10:54,004
Then if m_PS is running

264
00:10:54,004 --> 00:10:59,007
inside the block m_PS.update(dtAsSeconds).

265
00:10:59,007 --> 00:11:03,000
All that is needed in the
code is the call to update.

266
00:11:03,000 --> 00:11:05,002
Notice that it is wrapped in a check

267
00:11:05,002 --> 00:11:07,002
to make sure the system
is currently running.

268
00:11:07,002 --> 00:11:08,002
If it isn't running,

269
00:11:08,002 --> 00:11:10,004
there is no point updating it.

270
00:11:10,004 --> 00:11:13,006
Next let's see starting
the particle system.

271
00:11:13,006 --> 00:11:16,006
Open the DetectCollisions.cpp file,

272
00:11:16,006 --> 00:11:19,004
which has the DetectCollisions
function in it.

273
00:11:19,004 --> 00:11:20,008
We left a comment in it

274
00:11:20,008 --> 00:11:23,006
when we originally
coded it back in section

275
00:11:23,006 --> 00:11:26,000
Building Playable Levels
and Collision Detection.

276
00:11:26,000 --> 00:11:28,007
We'll add a code here after this comment.

277
00:11:28,007 --> 00:11:30,007
This is the code to be added.

278
00:11:30,007 --> 00:11:32,009
Here, first the code checks

279
00:11:32,009 --> 00:11:35,000
that the particle system
is already running.

280
00:11:35,000 --> 00:11:35,008
If it isn't,

281
00:11:35,008 --> 00:11:37,007
checks if the current tile being checked

282
00:11:37,007 --> 00:11:39,009
is either a water or fire tile.

283
00:11:39,009 --> 00:11:41,001
If either is the case,

284
00:11:41,001 --> 00:11:43,005
it checks whether the
character's feet are in contact.

285
00:11:43,005 --> 00:11:46,005
When each of these if statements is true,

286
00:11:46,005 --> 00:11:48,000
the particle system is started

287
00:11:48,000 --> 00:11:50,000
by calling the emitParticles function

288
00:11:50,000 --> 00:11:51,002
and passing in the location

289
00:11:51,002 --> 00:11:52,008
of the center of the character

290
00:11:52,008 --> 00:11:55,000
as the coordinates to start the effect.

291
00:11:55,000 --> 00:11:57,002
Now for drawing the particle system.

292
00:11:57,002 --> 00:12:00,003
First open the Draw.cpp file.

293
00:12:00,003 --> 00:12:03,005
We'll write a few lines of
code in full screen code block

294
00:12:03,005 --> 00:12:06,001
as well as right and left code block.

295
00:12:06,001 --> 00:12:08,007
After Draw Bob, write a comment.

296
00:12:08,007 --> 00:12:11,005
Draw the particle system.

297
00:12:11,005 --> 00:12:15,005
And write if m_PS.running function.

298
00:12:15,005 --> 00:12:17,005
Inside the if block,

299
00:12:17,005 --> 00:12:22,000
we write m_Window.draw(m_PS).

300
00:12:22,000 --> 00:12:23,004
This is the best bit.

301
00:12:23,004 --> 00:12:26,000
See how easy it is to
draw the particle system?

302
00:12:26,000 --> 00:12:30,007
We pass our instance directly
to the m_Window.draw function

303
00:12:30,007 --> 00:12:32,007
that is m_PS

304
00:12:32,007 --> 00:12:35,009
after checking that the particle
system is actually running.

305
00:12:35,009 --> 00:12:39,004
We have the same code inside
the split screen view also.

306
00:12:39,004 --> 00:12:42,005
Notice I'm adding the
same code to left view,

307
00:12:42,005 --> 00:12:59,005
and we have to do that
for right view, as well.

308
00:12:59,005 --> 00:13:01,001
So we have drawn particle system

309
00:13:01,001 --> 00:13:04,003
in all the left, right, and
full screen code blocks.

310
00:13:04,003 --> 00:13:05,007
You can now run the game

311
00:13:05,007 --> 00:13:07,004
and move one of the character's feet

312
00:13:07,004 --> 00:13:09,004
over the edge of a fire tile.

313
00:13:09,004 --> 00:13:11,002
You'll notice the particle system

314
00:13:11,002 --> 00:13:12,007
burst into life.

315
00:13:12,007 --> 00:13:13,008
I'll show you.

316
00:13:13,008 --> 00:13:16,000
See, there's our particle system.

317
00:13:16,000 --> 00:13:16,009
Awesome.

318
00:13:16,009 --> 00:13:18,002
In this video,

319
00:13:18,002 --> 00:13:20,009
we have learned building
the particle system.

320
00:13:20,009 --> 00:13:21,007
Cool.

321
00:13:21,007 --> 00:13:25,000
Next we'll take a look at OpenGL, Shaders,

322
00:13:25,000 --> 00:13:25,008
and GLSL.

