Now that we've sort of gone over the general data that we're going to need to start actually reading
some sparks.
So let's start with something you know we're going to need which is position
sition
that in course is just going to be a x and y is x and y k in.
Do you keep having the size of the sprites.
Let's also make that a struct struck
size in in touch with
so it's to the player
did the player have a position.
It had a missile which we know is really just a position as well.
It had an animation state.
So we're trying to figure out what that will be in full size in the number of lives and the score.
So where will have a position type
column I mean we call it.
Well we'll keep it as position as less typing and call it position
as a position for the missile.
Right.
And it has a size.
Well Spryte
carry in like a said hand the animation States we're going to represented as an integer.
And the reason we look up here we see that we can really think of this as kind of a simple array of
two elements right.
So I have this as the first Sprite and this as the second sprite.
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
integer would be better in this case.
So it's going to be an integer.
And do the same for the aliens state as well and you get there.
We also said it had lives a score in and well and lives and score sorry in their lives.
Max 3 lives very in the score.
Well OK it for now.
So let's work on the
work on the shields.
So strong.
CH
shield.
So it will have a position
and it also has a right in.
We're going to are we to represent our sprites as character pointer arrays.
Sedgley so spritely this.
So each in and have this be how many how high it is.
So if I go up here.
So each one's going to be.
So this will be part of the Spryte.
Or at least the first kind of entry of the sprite.
This will be the second entry of this right.
And this will be the third entry that's.
So each kind of
this will be like kind of a C string sort of or a character pointer really of this many say and all
have three elements.
It'll have this element in this element and this element as kind of an array of sort of CCed rings you
want to think that way.
Or really character arrays.
OK I'm not really going to be strong.
So our height is three so we should probably start having some constants.
Amie's that anonymous enim trick that I used last time in Battleship iness shield sprites Heights is
three.
So
it's like this.
And so it's three because again this will be kind of one element of the array.
This whole this whole kind of string or it's whole kind of character array or character
one character pointer really.
And similarly this will be another one and this will be no.
OK.
So that's how we're going to represent it.
So it's an array of character or pointer to characters an array of character pointers and all are sprites
in fact will be some kind of array of characters.
As you'll see in so we have the shield.
All I had was the sprites and it had a position and that's it
so let's go now to the aliens war.
This will be a start.
And of course his position as the
so up here
says state.
So this is really the state of each alien.
OK.
And we know we have 11 aliens per row and are living aliens Preux and we have five rows right.
So we're actually going to need a 2D array to represent all our peeps.
That's all our stake states.
Each alien can.
So don't you actually need another enim or call alien state.
An alien can be alive and make that sort of the default could be dead or could be exploding.
And in fact we're going to have a 2-D array of all the aliens.
Really believes this is asking me to array and Raanta need.
How many rows and columns and rows and we have five in one to have
the columns and there was 11.
See if you remember it.
Here are five rows of 11 beater's.
So are
rows no
columns.
So this is really the state it's
state of each Maybe you got that for now we also need the signs of each one.
This is
going to need the
animation.
So animation speech
we're going to need the direction that's going
also nature.
So it will be greater than one or be greater than zero for
going right.
In less than zero.
Going
left.
OK.
So it's really going to be either one or make one
and of course we're going to need the alien bombs.
But we're ready to structure the arms or a C struct union bomb in we're going to need that position.
And we're going to need the animation just
in set up here.
If you remember in the scription it says we have a maximum of three bombs.
Forty eight.
So another constant here.
And say max number one bombs.
Three
in scope.
Put it this right here on say a clean bomb and call it bombs.
It's going to be an array.
OK.
And we're also going to need if that's the case down here the number of bombs in play right.
Because it could be.
So this is just a maximum is the maximum.
But there could be just one or it could be zero two or three or eight.
So each know how many bombs are actually in play.
Kurt
CH for
its size and direction position.
That's it.
This won't be everything we need.
And I think the for example we're also going to need a movement timer.
Movement time and this this is going to capture how fast the aliens should be going
and also we're going to need the explosion for
and this is going to capture how long to explode for
said up here somewhere.
The plane hit it.
If an alien is hit they should explode for a short period of time and then they disappear.
So that's what this is going to capture.
So we missed this before.
But if the ear should keep going back to the problem and keep kind of thinking about how you're going
to represent certain data or certain things.
OK.
And there's one other thing I'm going to put in here.
There she has a couple to say how many aliens were left.
And this is to capture when to restart or when to go and go to the next level
and the last thing I want is the line and this is to capture
when the aliens win.
OK.
So if you looked up here
so on the one then each drop 11 lines to reach the bottom and invade.
OK.
So I'm going to capture that in in so which line they're actually at current.
If they're at
well orchestrated at whatever level right.
So it starts at the current level and decreases right.
To zero case once once it's zero then the aliens win.
As long as we have greater than zero aliens left so we're not going to.
This isn't going to matter for a while.
In fact we're not going to make the aliens for a little while but just for future reference.
So keep all that stuff there.
So the next thing is what else have done the alien swarm the shields and the alien bomb and the Sishen
the missile you need UFO you need game you need scores and stuff.
So what do the alien ufo
should be pretty simple.
Is this is going to be the hardest one the aliens worm.
But
are sorry not score of
so he said for his position.
It has it's size this and has the number of points that are awarded to it.
OK.
And this is from 50 to 200.
The next thing we need is score.
Score.
And we have speed score value called SCORE.
And we also need names or give me the string incorporate or where you see C++ strings on string.
This and later we're granted vector high score table and so there.
So we need the string and notice I'm using.
Conan Conan because we're not using the namespace SDD we need to use.
We need to always do this before.
So
that because you're not saying using
space standard that they in this file.
So we have the score and we're also going to need the high score table
score table
in to use a vector.
It also needs the SDD call in calling for that same reason and it can be a vector of scores
that go.
It's simple.
We just need the game
so game C struct game like this it's going to need the game state.
Right.
Go up here.
He said the game state so we're going to need it.
And then you come up here for the game state and what are the states.
So you know you see it this
was like to have a prefix for my IEMs.
So the game state should be well is going to be the intro screen and we think that the first screen
you see later we're going to have the high score table
in we're going have a game state for just playing the game and we're going to have a state for
player
is exploding our players dead I guess because once if there if the players hit then we kind of want
to pause the game.
He said the above before I pause the game and then they have to hit another key or something to restart
the game.
So Steve for that as well.
And we're going to need a game overstate ch
in one of the things we may want is a game state for waiting for the game maybe to restart itself or
something.
Just so like if you press that button you don't have to go directly in we can't go to a waiting state
first for a couple seconds and then kind of start something.
We'll see.
This might change.
We'll see.
So we're going to need game state and the current state we're in its current state this is going to
need the level
that we're going to need the size size pier size for the window size just to keep track of that
and it's think for now that you carry
so we just leave it like this for.
There's still some things that again we haven't really gone over.
But all this will start making sense when we actually start using everything we're going to start with
Lehre first.
And like I said before we're not going to do a traditional top down design for this.
We're going to kind of break off pieces based off the data that we need.
So for example part of it is player.
Right.
And so we're going to use this player and we're going to
actually just implement this and see how far we can get and then kind of add some add staff as we go.
OK.
So one thing I kind of want is the actual maximum of lives.
It's read that at some point.
OK just for just for this.
So that's kind of it for the data at least for the day definitions for now and the next lecture.
I want to go over kind of setting up the game.
All the kind of basic functions we're going we're going to need and then we're going to start doing
the player stuff.