1
00:00:00,330 --> 00:00:05,660
In the previous lesson, we left off where we were starting the game and we enabled the start button,

2
00:00:05,970 --> 00:00:07,890
when you click it, it starts the game.

3
00:00:08,070 --> 00:00:12,950
So it really doesn't do a whole lot quite yet, lugs it into the console and that's about it.

4
00:00:13,290 --> 00:00:19,860
So let's do some interaction and set the plate, start object and apply a style to it.

5
00:00:19,980 --> 00:00:23,970
And the style that we're applying is going to be display and display none.

6
00:00:24,300 --> 00:00:25,410
So what do you think this does?

7
00:00:25,620 --> 00:00:28,530
And if you said that this is going to hide the start one, you're.

8
00:00:28,860 --> 00:00:34,020
So the start button now is gone because once we start the game, we're actually not going to need the

9
00:00:34,020 --> 00:00:35,180
start button anymore.

10
00:00:35,550 --> 00:00:37,570
And what do we want to do within start?

11
00:00:37,590 --> 00:00:40,650
So we want to build the game board.

12
00:00:40,710 --> 00:00:45,230
So this is going to be a function that we're going to launch and I'll create a placeholder for that.

13
00:00:45,480 --> 00:00:51,870
So usually when I do create these new functions that what I want to do within the function and I called

14
00:00:51,870 --> 00:00:54,090
this one guild built game board.

15
00:00:54,210 --> 00:00:58,800
So within here, this is just going to be a placeholder for the next lesson build board.

16
00:00:58,950 --> 00:00:59,870
So that's what we want to do.

17
00:00:59,880 --> 00:01:04,410
That's the first thing we want to do because we want to have an interface for the user to work with.

18
00:01:04,950 --> 00:01:08,510
And we also want to set up a few of the game objects.

19
00:01:08,730 --> 00:01:10,420
So the last offer.

20
00:01:10,620 --> 00:01:13,950
So whatever the last offer was, there's no last offer.

21
00:01:13,950 --> 00:01:15,860
So we'll just set that to false.

22
00:01:15,870 --> 00:01:22,740
So it's not going to be the last offer we do on a track to make sure and check to see if the last offer

23
00:01:22,740 --> 00:01:23,760
has been sent.

24
00:01:24,030 --> 00:01:29,370
And if it has, then we know that the game is over, that we're not sending any more offers.

25
00:01:29,550 --> 00:01:31,070
So that's why we've got that one.

26
00:01:31,080 --> 00:01:34,620
And then there's also the game object where we created the template.

27
00:01:34,680 --> 00:01:36,140
So we want to enable this.

28
00:01:36,150 --> 00:01:41,160
And as mentioned, this is the main game controller, which is going to allow the game to play or not

29
00:01:41,160 --> 00:01:41,540
play.

30
00:01:41,670 --> 00:01:43,290
So we're always going to look for that one.

31
00:01:43,500 --> 00:01:46,880
And then there's also the game offer made.

32
00:01:46,920 --> 00:01:48,420
So this is a new value.

33
00:01:48,660 --> 00:01:54,840
And we want to set this one to zero because we want to track how many offers have been made on the last

34
00:01:54,840 --> 00:01:56,250
offer and so on.

35
00:01:56,550 --> 00:02:03,450
And we also want to enable some of these pop ups because we want the user to be able to see what they're

36
00:02:03,450 --> 00:02:04,040
going to do.

37
00:02:04,080 --> 00:02:09,900
So let's create a function that's going to pop up those models and we're going to do the models in the

38
00:02:09,900 --> 00:02:10,740
next lesson.

39
00:02:10,770 --> 00:02:11,850
So show you how to do those.

40
00:02:12,000 --> 00:02:14,910
And this is going to enable those models to pop up.

41
00:02:14,910 --> 00:02:20,010
And we're going to ask the player, we're going to give the player some instructions, select a case.

42
00:02:20,220 --> 00:02:21,660
So that's how the game starts.

43
00:02:21,870 --> 00:02:27,300
The player selects a case that they want to keep as their own case.

44
00:02:27,570 --> 00:02:30,780
So we're going to present them with all of the cases that are available.

45
00:02:30,960 --> 00:02:33,840
And those cases are going to be based on the values.

46
00:02:33,840 --> 00:02:35,700
So win over a number of values we have.

47
00:02:35,820 --> 00:02:36,900
That's how many cases.

48
00:02:37,020 --> 00:02:39,450
So we have to randomize where they're going to be positioned.

49
00:02:39,630 --> 00:02:45,840
And then we're going to send over this message to the user to select a case and then give them click

50
00:02:46,090 --> 00:02:53,730
any of the pillow cases and we'll have to position the cases below the start objects while position

51
00:02:53,730 --> 00:02:55,770
all the cases there in the main area.

52
00:02:55,770 --> 00:03:00,420
So that's what we want the user to do, is they want to select a case.

53
00:03:00,660 --> 00:03:05,730
And as mentioned, it's going to be these pop ups that are going to be the movement between the different

54
00:03:05,730 --> 00:03:06,930
game stages.

55
00:03:07,140 --> 00:03:10,290
So that's how the player's going to move between the game objects.

56
00:03:10,500 --> 00:03:16,320
So we're going to have a pop up screen and then we're going to be asking the user and within the Pop-Up,

57
00:03:16,320 --> 00:03:18,780
this is where we need to create the next step as well.

58
00:03:18,780 --> 00:03:21,680
And this pop up is going to be taking in a message.

59
00:03:21,720 --> 00:03:26,280
And for now with just message will console log out the message that we're displaying.

60
00:03:26,310 --> 00:03:28,740
And in the next lesson, we're going to enable the pop ups.

61
00:03:28,890 --> 00:03:32,790
So that's all we need to do to kickoff the game where we're going to start the game.

62
00:03:33,090 --> 00:03:37,710
And then once the player clicks start, then the game is started.

63
00:03:37,920 --> 00:03:43,620
We're going to build the game board and then we're also going to give the user instructions for their

64
00:03:43,620 --> 00:03:45,290
first step within the gameplay.

65
00:03:45,420 --> 00:03:49,920
So the idea is that within the game board, we're going to present all of the cases.

66
00:03:49,920 --> 00:03:51,030
They're all going to be clickable.

67
00:03:51,300 --> 00:03:53,700
The user's going to have to click a certain amount of cases.

68
00:03:53,880 --> 00:03:56,610
And every once in a while we're going to trigger an offer.

69
00:03:56,820 --> 00:03:58,440
And that offer is going to pop up.

70
00:03:58,440 --> 00:04:01,440
It's going to be based on the values of the remaining cases.

71
00:04:01,590 --> 00:04:06,570
So that's what we need to track that as well with in the background so we can calculate how many values

72
00:04:06,570 --> 00:04:08,310
and how what the offer should be.

73
00:04:08,490 --> 00:04:13,620
We're also going to be tracking to see if it's the last offer and we're also tracking the number of

74
00:04:13,620 --> 00:04:14,760
offers that are made.

75
00:04:14,760 --> 00:04:16,590
So that is all still yet to come.

76
00:04:16,770 --> 00:04:20,100
And coming up next, we're going to enable our pop up message.

77
00:04:20,250 --> 00:04:23,070
So this was a quick one and this is how to get the game started.

78
00:04:23,370 --> 00:04:28,350
So when you are creating a game, think through the logic of what's your first step when the player

79
00:04:28,350 --> 00:04:29,040
comes in?

80
00:04:29,220 --> 00:04:34,380
What's the first action that you want them to do and then build up some placeholder functions for those

81
00:04:34,380 --> 00:04:38,970
actions, build those actions and then go back to the start, play through it.

82
00:04:39,000 --> 00:04:42,300
You can continue to build out all of your game structure that way.

83
00:04:42,360 --> 00:04:44,340
So add this into your project.
