WEBVTT

00:00.540 --> 00:09.840
Now that we've sort of gone over the general data that we're going to need to start actually reading

00:09.840 --> 00:11.450
some sparks.

00:11.970 --> 00:16.890
So let's start with something you know we're going to need which is position

00:19.560 --> 00:20.480
sition

00:24.480 --> 00:37.470
that in course is just going to be a x and y is x and y k in.

00:37.520 --> 00:40.870
Do you keep having the size of the sprites.

00:40.880 --> 00:45.250
Let's also make that a struct struck

00:47.660 --> 00:52.460
size in in touch with

01:00.840 --> 01:04.040
so it's to the player

01:12.930 --> 01:15.980
did the player have a position.

01:15.990 --> 01:21.700
It had a missile which we know is really just a position as well.

01:21.810 --> 01:23.280
It had an animation state.

01:23.310 --> 01:31.840
So we're trying to figure out what that will be in full size in the number of lives and the score.

01:31.870 --> 01:37.660
So where will have a position type

01:40.650 --> 01:42.900
column I mean we call it.

01:43.330 --> 01:50.080
Well we'll keep it as position as less typing and call it position

01:54.770 --> 01:59.240
as a position for the missile.

02:00.800 --> 02:01.890
Right.

02:02.290 --> 02:05.280
And it has a size.

02:05.520 --> 02:08.330
Well Spryte

02:12.430 --> 02:25.350
carry in like a said hand the animation States we're going to represented as an integer.

02:25.520 --> 02:35.710
And the reason we look up here we see that we can really think of this as kind of a simple array of

02:35.710 --> 02:38.090
two elements right.

02:38.170 --> 02:44.600
So I have this as the first Sprite and this as the second sprite.

02:44.600 --> 02:54.160
So in terms of the order it would be in it be 0 and 1 and could have this be a boolean but I think an

02:54.160 --> 02:58.150
integer would be better in this case.

02:58.420 --> 03:01.010
So it's going to be an integer.

03:01.140 --> 03:09.800
And do the same for the aliens state as well and you get there.

03:10.490 --> 03:25.380
We also said it had lives a score in and well and lives and score sorry in their lives.

03:27.810 --> 03:33.880
Max 3 lives very in the score.

03:37.580 --> 03:41.650
Well OK it for now.

03:41.720 --> 03:44.690
So let's work on the

03:47.530 --> 03:49.850
work on the shields.

03:52.410 --> 03:53.730
So strong.

03:53.830 --> 03:54.200
CH

03:56.620 --> 03:57.740
shield.

04:01.190 --> 04:03.350
So it will have a position

04:07.020 --> 04:10.100
and it also has a right in.

04:10.110 --> 04:19.400
We're going to are we to represent our sprites as character pointer arrays.

04:19.410 --> 04:24.670
Sedgley so spritely this.

04:24.870 --> 04:35.940
So each in and have this be how many how high it is.

04:36.010 --> 04:39.330
So if I go up here.

04:39.420 --> 04:42.820
So each one's going to be.

04:43.050 --> 04:46.370
So this will be part of the Spryte.

04:46.710 --> 04:49.180
Or at least the first kind of entry of the sprite.

04:49.200 --> 04:51.280
This will be the second entry of this right.

04:51.310 --> 04:53.130
And this will be the third entry that's.

04:53.170 --> 04:56.240
So each kind of

04:59.580 --> 05:07.870
this will be like kind of a C string sort of or a character pointer really of this many say and all

05:07.860 --> 05:10.600
have three elements.

05:10.610 --> 05:22.120
It'll have this element in this element and this element as kind of an array of sort of CCed rings you

05:22.120 --> 05:24.420
want to think that way.

05:24.720 --> 05:27.340
Or really character arrays.

05:27.360 --> 05:29.510
OK I'm not really going to be strong.

05:30.040 --> 05:37.350
So our height is three so we should probably start having some constants.

05:38.500 --> 05:49.570
Amie's that anonymous enim trick that I used last time in Battleship iness shield sprites Heights is

05:49.740 --> 05:51.430
three.

05:52.970 --> 05:53.630
So

05:59.000 --> 06:00.990
it's like this.

06:01.000 --> 06:08.770
And so it's three because again this will be kind of one element of the array.

06:08.810 --> 06:14.240
This whole this whole kind of string or it's whole kind of character array or character

06:16.850 --> 06:18.890
one character pointer really.

06:19.280 --> 06:22.880
And similarly this will be another one and this will be no.

06:23.160 --> 06:23.840
OK.

06:23.870 --> 06:28.200
So that's how we're going to represent it.

06:28.250 --> 06:38.220
So it's an array of character or pointer to characters an array of character pointers and all are sprites

06:38.230 --> 06:41.420
in fact will be some kind of array of characters.

06:42.680 --> 06:46.330
As you'll see in so we have the shield.

06:46.330 --> 06:49.810
All I had was the sprites and it had a position and that's it

06:52.360 --> 06:59.250
so let's go now to the aliens war.

07:04.300 --> 07:05.640
This will be a start.

07:08.880 --> 07:13.110
And of course his position as the

07:15.990 --> 07:17.400
so up here

07:20.470 --> 07:24.180
says state.

07:24.220 --> 07:29.900
So this is really the state of each alien.

07:30.200 --> 07:31.030
OK.

07:31.510 --> 07:44.860
And we know we have 11 aliens per row and are living aliens Preux and we have five rows right.

07:46.330 --> 07:56.070
So we're actually going to need a 2D array to represent all our peeps.

07:56.150 --> 07:59.440
That's all our stake states.

07:59.470 --> 08:01.040
Each alien can.

08:01.060 --> 08:09.660
So don't you actually need another enim or call alien state.

08:13.420 --> 08:22.470
An alien can be alive and make that sort of the default could be dead or could be exploding.

08:25.980 --> 08:32.720
And in fact we're going to have a 2-D array of all the aliens.

08:38.200 --> 08:45.390
Really believes this is asking me to array and Raanta need.

08:47.120 --> 08:58.260
How many rows and columns and rows and we have five in one to have

09:00.840 --> 09:04.910
the columns and there was 11.

09:05.460 --> 09:06.840
See if you remember it.

09:06.850 --> 09:11.630
Here are five rows of 11 beater's.

09:13.440 --> 09:16.690
So are

09:20.490 --> 09:23.130
rows no

09:25.710 --> 09:26.920
columns.

09:28.590 --> 09:31.230
So this is really the state it's

09:38.990 --> 09:52.730
state of each Maybe you got that for now we also need the signs of each one.

09:52.990 --> 09:54.220
This is

09:56.910 --> 09:59.310
going to need the

10:01.930 --> 10:03.250
animation.

10:03.460 --> 10:05.590
So animation speech

10:11.490 --> 10:16.700
we're going to need the direction that's going

10:19.560 --> 10:20.540
also nature.

10:20.560 --> 10:31.970
So it will be greater than one or be greater than zero for

10:34.350 --> 10:35.520
going right.

10:35.610 --> 10:37.740
In less than zero.

10:40.030 --> 10:40.460
Going

10:43.230 --> 10:43.950
left.

10:44.070 --> 10:44.490
OK.

10:44.550 --> 10:48.200
So it's really going to be either one or make one

10:54.630 --> 10:59.970
and of course we're going to need the alien bombs.

11:00.620 --> 11:14.110
But we're ready to structure the arms or a C struct union bomb in we're going to need that position.

11:18.070 --> 11:20.930
And we're going to need the animation just

11:27.850 --> 11:30.520
in set up here.

11:30.560 --> 11:37.560
If you remember in the scription it says we have a maximum of three bombs.

11:37.860 --> 11:39.030
Forty eight.

11:39.090 --> 11:44.040
So another constant here.

11:44.230 --> 11:52.180
And say max number one bombs.

11:52.350 --> 11:52.770
Three

11:57.870 --> 11:58.830
in scope.

11:58.850 --> 12:11.810
Put it this right here on say a clean bomb and call it bombs.

12:12.020 --> 12:13.830
It's going to be an array.

12:14.000 --> 12:14.580
OK.

12:16.180 --> 12:27.090
And we're also going to need if that's the case down here the number of bombs in play right.

12:27.160 --> 12:28.320
Because it could be.

12:28.360 --> 12:32.220
So this is just a maximum is the maximum.

12:32.320 --> 12:37.060
But there could be just one or it could be zero two or three or eight.

12:37.060 --> 12:41.530
So each know how many bombs are actually in play.

12:41.540 --> 12:41.840
Kurt

12:46.150 --> 12:47.450
CH for

12:50.120 --> 12:55.000
its size and direction position.

12:55.080 --> 12:56.790
That's it.

12:56.790 --> 12:59.010
This won't be everything we need.

12:59.010 --> 13:08.190
And I think the for example we're also going to need a movement timer.

13:09.540 --> 13:23.200
Movement time and this this is going to capture how fast the aliens should be going

13:27.630 --> 13:32.330
and also we're going to need the explosion for

13:38.620 --> 13:46.680
and this is going to capture how long to explode for

13:49.570 --> 13:53.830
said up here somewhere.

13:53.920 --> 13:55.260
The plane hit it.

13:55.370 --> 14:00.430
If an alien is hit they should explode for a short period of time and then they disappear.

14:00.460 --> 14:03.010
So that's what this is going to capture.

14:03.010 --> 14:04.730
So we missed this before.

14:04.950 --> 14:13.480
But if the ear should keep going back to the problem and keep kind of thinking about how you're going

14:13.480 --> 14:17.260
to represent certain data or certain things.

14:17.290 --> 14:18.460
OK.

14:18.610 --> 14:22.970
And there's one other thing I'm going to put in here.

14:23.160 --> 14:32.220
There she has a couple to say how many aliens were left.

14:32.850 --> 14:47.930
And this is to capture when to restart or when to go and go to the next level

14:52.880 --> 15:03.620
and the last thing I want is the line and this is to capture

15:05.930 --> 15:09.240
when the aliens win.

15:09.500 --> 15:09.890
OK.

15:10.010 --> 15:11.850
So if you looked up here

15:17.570 --> 15:22.590
so on the one then each drop 11 lines to reach the bottom and invade.

15:22.760 --> 15:23.150
OK.

15:23.150 --> 15:30.590
So I'm going to capture that in in so which line they're actually at current.

15:30.870 --> 15:31.730
If they're at

15:35.030 --> 15:37.390
well orchestrated at whatever level right.

15:37.400 --> 15:46.410
So it starts at the current level and decreases right.

15:49.020 --> 15:59.310
To zero case once once it's zero then the aliens win.

16:00.980 --> 16:10.100
As long as we have greater than zero aliens left so we're not going to.

16:10.470 --> 16:13.500
This isn't going to matter for a while.

16:13.530 --> 16:20.830
In fact we're not going to make the aliens for a little while but just for future reference.

16:22.110 --> 16:25.210
So keep all that stuff there.

16:26.960 --> 16:37.310
So the next thing is what else have done the alien swarm the shields and the alien bomb and the Sishen

16:37.310 --> 16:44.370
the missile you need UFO you need game you need scores and stuff.

16:45.250 --> 16:48.160
So what do the alien ufo

16:51.400 --> 16:53.120
should be pretty simple.

16:53.190 --> 16:56.910
Is this is going to be the hardest one the aliens worm.

16:57.130 --> 16:57.560
But

17:00.470 --> 17:02.700
are sorry not score of

17:06.460 --> 17:14.660
so he said for his position.

17:15.510 --> 17:24.210
It has it's size this and has the number of points that are awarded to it.

17:24.360 --> 17:24.990
OK.

17:25.030 --> 17:30.760
And this is from 50 to 200.

17:35.800 --> 17:41.570
The next thing we need is score.

17:41.890 --> 17:43.040
Score.

17:44.720 --> 17:51.250
And we have speed score value called SCORE.

17:51.250 --> 18:02.070
And we also need names or give me the string incorporate or where you see C++ strings on string.

18:02.110 --> 18:10.770
This and later we're granted vector high score table and so there.

18:10.810 --> 18:18.160
So we need the string and notice I'm using.

18:18.190 --> 18:23.640
Conan Conan because we're not using the namespace SDD we need to use.

18:23.680 --> 18:27.660
We need to always do this before.

18:27.730 --> 18:28.210
So

18:32.350 --> 18:38.770
that because you're not saying using

18:41.210 --> 18:52.170
space standard that they in this file.

18:52.410 --> 18:56.220
So we have the score and we're also going to need the high score table

18:58.700 --> 19:00.160
score table

19:02.690 --> 19:06.210
in to use a vector.

19:06.290 --> 19:13.960
It also needs the SDD call in calling for that same reason and it can be a vector of scores

19:16.360 --> 19:17.400
that go.

19:17.990 --> 19:20.240
It's simple.

19:20.910 --> 19:22.230
We just need the game

19:24.680 --> 19:35.170
so game C struct game like this it's going to need the game state.

19:35.240 --> 19:36.060
Right.

19:36.290 --> 19:37.470
Go up here.

19:37.490 --> 19:44.230
He said the game state so we're going to need it.

19:44.510 --> 19:53.720
And then you come up here for the game state and what are the states.

19:54.190 --> 19:59.030
So you know you see it this

20:05.180 --> 20:09.080
was like to have a prefix for my IEMs.

20:09.780 --> 20:16.560
So the game state should be well is going to be the intro screen and we think that the first screen

20:16.560 --> 20:23.730
you see later we're going to have the high score table

20:26.430 --> 20:34.280
in we're going have a game state for just playing the game and we're going to have a state for

20:37.550 --> 20:38.370
player

20:40.980 --> 20:49.410
is exploding our players dead I guess because once if there if the players hit then we kind of want

20:49.410 --> 20:50.310
to pause the game.

20:50.310 --> 20:59.680
He said the above before I pause the game and then they have to hit another key or something to restart

20:59.680 --> 21:00.280
the game.

21:00.280 --> 21:03.610
So Steve for that as well.

21:03.720 --> 21:07.840
And we're going to need a game overstate ch

21:11.250 --> 21:21.070
in one of the things we may want is a game state for waiting for the game maybe to restart itself or

21:21.070 --> 21:21.900
something.

21:22.000 --> 21:29.650
Just so like if you press that button you don't have to go directly in we can't go to a waiting state

21:29.680 --> 21:34.100
first for a couple seconds and then kind of start something.

21:35.350 --> 21:36.800
We'll see.

21:37.540 --> 21:38.820
This might change.

21:39.010 --> 21:39.520
We'll see.

21:41.240 --> 21:54.600
So we're going to need game state and the current state we're in its current state this is going to

21:54.600 --> 21:55.560
need the level

21:59.330 --> 22:09.980
that we're going to need the size size pier size for the window size just to keep track of that

22:14.340 --> 22:20.160
and it's think for now that you carry

22:22.750 --> 22:27.580
so we just leave it like this for.

22:27.870 --> 22:32.390
There's still some things that again we haven't really gone over.

22:32.490 --> 22:37.200
But all this will start making sense when we actually start using everything we're going to start with

22:37.380 --> 22:40.320
Lehre first.

22:40.380 --> 22:47.790
And like I said before we're not going to do a traditional top down design for this.

22:48.000 --> 22:54.880
We're going to kind of break off pieces based off the data that we need.

22:54.880 --> 22:57.640
So for example part of it is player.

22:57.650 --> 22:58.590
Right.

22:58.810 --> 23:02.770
And so we're going to use this player and we're going to

23:05.620 --> 23:14.120
actually just implement this and see how far we can get and then kind of add some add staff as we go.

23:14.320 --> 23:15.480
OK.

23:15.670 --> 23:21.690
So one thing I kind of want is the actual maximum of lives.

23:25.320 --> 23:27.670
It's read that at some point.

23:27.810 --> 23:31.110
OK just for just for this.

23:31.400 --> 23:38.880
So that's kind of it for the data at least for the day definitions for now and the next lecture.

23:38.900 --> 23:43.630
I want to go over kind of setting up the game.

23:43.640 --> 23:49.910
All the kind of basic functions we're going we're going to need and then we're going to start doing

23:50.330 --> 23:51.140
the player stuff.
