Hi, welcome back.
In this video, we will learn how to set up the display service of our game, we will use by the display
set to initialize a window or a screen for display and pass it to a variable and to the function.
We will recap the code from the last video.
First, we will import by game and get by game one point nine by six, then run the second we get a
table of two numbers six Somma zero.
This means that we have six submodular initiated and zero failed.
We will pass an argument for display solution, which is a pair of numbers representing white and the
height in a table.
So our code will be as the following game underscore display equal by game.
Dot display.
Dot set.
Underscore mode.
Between two entities, a table of whites and heights separated by a comma, for example, 800 and 600,
we passed the table of eight hundred and six hundred as the argument to the set underscore moot between
two parentheses function standing for the resolution of the whites, which is eight hundred and the
height is six hundred bexell.
So the whites is eight hundred bexell and the height is six hundred back.
So not that the table contained in the instances of the function so that there are double parentheses.
And after we run our side we get a black screen has a resolution.
Eight hundred by six hundred.
You should use the engines for your games resolution often as you want to assign those numbers to variables
rather than use the numbers again and again.
This can make it easy when you need to modify your program for your game.
So you will use two variables.
One for whites and call display whites for display underscore whites and one for height and call display,
underscore height and pass these two variables to the set underscore mode function as the following.
So to recap the whole of our code again and bought by game then initialization of the by game by game
dot initialize or init function, then adding to variables the whites and the height and after the it
and assigned it to a specific value according to our game resolution.
Then best these two variables to the game underscore this play which will be equal by game display.
Those set underscore mode and between two parentheses the table of the two variables separated by a
code.
Now we want to update the display.
Updating the display.
We need to use a function called Update to update the display of the game.
Service animations are generally a change between different frames over time.
You may think of Lepp object when thinking about animations, and they consist of a series of images
that vary from one page to the following page.
These pages gave the moment when they are flipped through quickly as the contents of the page appear
to be in motion and computer game frames are used rather than pages.
So we will use the concept of loving frames so a function that can be used to update the display of
the game service that are called Flip, and it can be encoded as a following by game display dot flat
method.
But most frequently the update method or function is used and instead of function or method because
it will update only portion of the screen, rather the entire area saving memory.
So our code will be as the following by game, the display update method and run all the cells again
to restart importing by game to avoid the error of not importing by game as it restarted after every
display, after every time we run all of the cells and close this screen display, we should restart
our control.
Our convert started so we will run our cells again and again to display the display screen or run our
code correctly.
To avoid that, we can copy all the code in one cell.
At this point.
We reached the end of this lecture.
Hope you enjoyed this lecture and you get all of that.
Thanks for being here and thanks for watching t Mac Viju.