1
00:00:00,770 --> 00:00:02,150
Hi, welcome back.

2
00:00:02,840 --> 00:00:12,110
In this video, we will learn how to set up the display service of our game, we will use by the display

3
00:00:12,560 --> 00:00:21,410
set to initialize a window or a screen for display and pass it to a variable and to the function.

4
00:00:21,800 --> 00:00:25,000
We will recap the code from the last video.

5
00:00:25,640 --> 00:00:36,020
First, we will import by game and get by game one point nine by six, then run the second we get a

6
00:00:36,020 --> 00:00:39,600
table of two numbers six Somma zero.

7
00:00:39,920 --> 00:00:45,880
This means that we have six submodular initiated and zero failed.

8
00:00:46,190 --> 00:00:54,530
We will pass an argument for display solution, which is a pair of numbers representing white and the

9
00:00:54,530 --> 00:00:56,040
height in a table.

10
00:00:56,270 --> 00:01:03,230
So our code will be as the following game underscore display equal by game.

11
00:01:04,040 --> 00:01:05,000
Dot display.

12
00:01:05,000 --> 00:01:05,750
Dot set.

13
00:01:05,750 --> 00:01:07,040
Underscore mode.

14
00:01:07,980 --> 00:01:18,660
Between two entities, a table of whites and heights separated by a comma, for example, 800 and 600,

15
00:01:18,780 --> 00:01:28,620
we passed the table of eight hundred and six hundred as the argument to the set underscore moot between

16
00:01:28,620 --> 00:01:38,340
two parentheses function standing for the resolution of the whites, which is eight hundred and the

17
00:01:38,340 --> 00:01:41,400
height is six hundred bexell.

18
00:01:41,580 --> 00:01:47,790
So the whites is eight hundred bexell and the height is six hundred back.

19
00:01:47,790 --> 00:01:55,580
So not that the table contained in the instances of the function so that there are double parentheses.

20
00:01:55,590 --> 00:02:00,360
And after we run our side we get a black screen has a resolution.

21
00:02:00,360 --> 00:02:02,780
Eight hundred by six hundred.

22
00:02:02,820 --> 00:02:13,080
You should use the engines for your games resolution often as you want to assign those numbers to variables

23
00:02:13,080 --> 00:02:16,050
rather than use the numbers again and again.

24
00:02:16,470 --> 00:02:22,710
This can make it easy when you need to modify your program for your game.

25
00:02:23,580 --> 00:02:26,100
So you will use two variables.

26
00:02:26,700 --> 00:02:36,420
One for whites and call display whites for display underscore whites and one for height and call display,

27
00:02:36,420 --> 00:02:47,520
underscore height and pass these two variables to the set underscore mode function as the following.

28
00:02:48,060 --> 00:02:57,780
So to recap the whole of our code again and bought by game then initialization of the by game by game

29
00:02:57,780 --> 00:03:09,300
dot initialize or init function, then adding to variables the whites and the height and after the it

30
00:03:09,330 --> 00:03:16,020
and assigned it to a specific value according to our game resolution.

31
00:03:16,020 --> 00:03:26,880
Then best these two variables to the game underscore this play which will be equal by game display.

32
00:03:26,880 --> 00:03:34,920
Those set underscore mode and between two parentheses the table of the two variables separated by a

33
00:03:34,920 --> 00:03:35,230
code.

34
00:03:35,760 --> 00:03:38,220
Now we want to update the display.

35
00:03:38,760 --> 00:03:40,170
Updating the display.

36
00:03:41,190 --> 00:03:47,210
We need to use a function called Update to update the display of the game.

37
00:03:47,220 --> 00:03:54,030
Service animations are generally a change between different frames over time.

38
00:03:54,030 --> 00:04:03,000
You may think of Lepp object when thinking about animations, and they consist of a series of images

39
00:04:03,000 --> 00:04:06,360
that vary from one page to the following page.

40
00:04:07,080 --> 00:04:16,560
These pages gave the moment when they are flipped through quickly as the contents of the page appear

41
00:04:16,560 --> 00:04:24,090
to be in motion and computer game frames are used rather than pages.

42
00:04:24,510 --> 00:04:33,600
So we will use the concept of loving frames so a function that can be used to update the display of

43
00:04:33,600 --> 00:04:42,450
the game service that are called Flip, and it can be encoded as a following by game display dot flat

44
00:04:42,660 --> 00:04:43,200
method.

45
00:04:43,920 --> 00:04:52,740
But most frequently the update method or function is used and instead of function or method because

46
00:04:52,740 --> 00:04:59,660
it will update only portion of the screen, rather the entire area saving memory.

47
00:04:59,940 --> 00:05:09,360
So our code will be as the following by game, the display update method and run all the cells again

48
00:05:09,930 --> 00:05:20,460
to restart importing by game to avoid the error of not importing by game as it restarted after every

49
00:05:20,460 --> 00:05:29,700
display, after every time we run all of the cells and close this screen display, we should restart

50
00:05:29,700 --> 00:05:30,570
our control.

51
00:05:30,600 --> 00:05:43,590
Our convert started so we will run our cells again and again to display the display screen or run our

52
00:05:43,590 --> 00:05:44,580
code correctly.

53
00:05:45,150 --> 00:05:49,740
To avoid that, we can copy all the code in one cell.

54
00:05:50,190 --> 00:05:51,300
At this point.

55
00:05:51,300 --> 00:05:53,610
We reached the end of this lecture.

56
00:05:53,690 --> 00:05:56,670
Hope you enjoyed this lecture and you get all of that.

57
00:05:56,670 --> 00:06:00,880
Thanks for being here and thanks for watching t Mac Viju.
