1
00:00:00,300 --> 00:00:05,260
And here as you can see I am referring to the name of this valuable plus.

2
00:00:05,790 --> 00:00:07,790
Your point is points.

3
00:00:08,310 --> 00:00:13,780
I am referring to the name of this variable in order to out with this value to the screen plus a new

4
00:00:13,780 --> 00:00:18,610
line character thinks the game status that set text to continue the game.

5
00:00:18,840 --> 00:00:21,350
All t actually triangulations you.

6
00:00:21,390 --> 00:00:23,500
Your point is points.

7
00:00:23,710 --> 00:00:28,570
OK and here I am assigning this value.

8
00:00:28,690 --> 00:00:32,830
This points this string where the truth is all the calculation value.

9
00:00:32,940 --> 00:00:39,040
So that the user can see the points of his or her game or tape of his or her game.

10
00:00:39,180 --> 00:00:47,280
This return statement here is saying that the application is not allowed to execute the lines of code

11
00:00:47,340 --> 00:00:49,370
after after this return statement.

12
00:00:49,390 --> 00:00:54,900
Ok so I am putting this written statement inside of this if statement here.

13
00:00:54,990 --> 00:01:02,760
OK so if the flow of the application and here is this if statement after executing these lines of code

14
00:01:02,760 --> 00:01:04,170
here OK.

15
00:01:04,560 --> 00:01:07,630
It's going to lead to this line of code here that says return.

16
00:01:08,010 --> 00:01:15,150
And this means this return is actually like a break statement it's going to actually break out of this

17
00:01:15,210 --> 00:01:15,750
method.

18
00:01:15,780 --> 00:01:17,880
Out of these unclick method.

19
00:01:18,000 --> 00:01:22,120
OK it's not going to actually execute the lines of code.

20
00:01:22,140 --> 00:01:23,680
After this return statement.

21
00:01:23,700 --> 00:01:29,970
OK and then it's going to actually break out of this uncle's method so that the user need to actually

22
00:01:29,970 --> 00:01:31,610
click on DS.

23
00:01:31,740 --> 00:01:35,900
I am GITTOES again in order to execute some other lines of code here.

24
00:01:35,910 --> 00:01:36,630
OK.

25
00:01:36,870 --> 00:01:38,820
And this return statement remember.

26
00:01:38,940 --> 00:01:41,120
Means break out of that method.

27
00:01:41,200 --> 00:01:45,420
OK you can use this return statement in all of your methods.

28
00:01:45,540 --> 00:01:50,630
If in some circumstances you want to actually break out of that if it's OK.

29
00:01:50,730 --> 00:01:55,820
So let's actually continue adding some more lines of code so that it will be more meaningful for you

30
00:01:56,340 --> 00:01:57,480
and it will make sense.

31
00:01:57,480 --> 00:02:05,350
Ok so after this and then curly brace of this if statement as you can see we have an if statement here.

32
00:02:05,380 --> 00:02:11,370
OK so after this end in curly brace of this statement let's actually continue adding some more lines

33
00:02:11,370 --> 00:02:12,070
of code here.

34
00:02:12,070 --> 00:02:17,320
OK and here still we are inside of this unclick uncle Meffert as you can see here.

35
00:02:17,360 --> 00:02:27,480
OK after this statement here let's actually create another if statement if game status is equal status

36
00:02:29,430 --> 00:02:34,760
that proceed that proceed.

37
00:02:35,760 --> 00:02:40,370
So now let's actually create an integer variable.

38
00:02:40,380 --> 00:02:43,140
Int dice.

39
00:02:43,350 --> 00:02:49,050
Some assignment operator Let's roll the dice again.

40
00:02:49,310 --> 00:02:54,710
I am trying to actually assign the return value of this method to this variable.

41
00:02:54,710 --> 00:02:55,240
OK.

42
00:02:55,330 --> 00:02:59,040
And here let's actually create and if else statement.

43
00:02:59,060 --> 00:03:06,330
If dice sum is equal two points ok.

44
00:03:06,540 --> 00:03:15,510
If the value of the dice some variable is equal two points here gain status assignment operator status

45
00:03:16,710 --> 00:03:29,710
that one the user wins the game takes the game status that said to set text you want and here let's

46
00:03:29,740 --> 00:03:39,340
actually make this I enjoy dice invisible and let's actually make the leap between restart with the

47
00:03:39,350 --> 00:03:39,600
bell.

48
00:03:39,630 --> 00:03:40,290
OK.

49
00:03:40,710 --> 00:03:49,340
And then let's actually create an ELSE IF statement here as if dice sum is equal.

50
00:03:49,350 --> 00:03:53,650
Remember this double equals operated is the equal operator.

51
00:03:53,910 --> 00:03:58,910
Else if dice sum is equal to 7.

52
00:03:59,490 --> 00:04:02,370
Here I am referring to the name of that constant 7.

53
00:04:02,510 --> 00:04:08,680
OK then game status is equal to status.

54
00:04:09,190 --> 00:04:10,530
That's last.

55
00:04:10,530 --> 00:04:12,410
So this means the last game.

56
00:04:12,570 --> 00:04:17,120
And here I can't just typing DX the game status that said text.

57
00:04:17,700 --> 00:04:29,770
And then inside Apprentice's I can just type in your last OK and then let's actually make this r i g

58
00:04:29,820 --> 00:04:32,110
Jesus invisible OK.

59
00:04:32,410 --> 00:04:36,930
And let's make the restart button visible between restart.

60
00:04:37,570 --> 00:04:38,150
Visible.

61
00:04:38,290 --> 00:04:39,230
OK.

62
00:04:39,790 --> 00:04:42,120
So hopefully that makes sense.

63
00:04:42,130 --> 00:04:46,370
So let me actually explain this block of code here again here.

64
00:04:46,390 --> 00:04:52,500
I am actually creating an if statement and I am saying that if the value of this game status variable

65
00:04:52,510 --> 00:04:54,560
is equal to status that proceed.

66
00:04:54,620 --> 00:05:01,590
So remember when it when the flow of the program reaches two these are case statements here.

67
00:05:01,810 --> 00:05:07,060
As you can see the status of the game is status that proceed and then it's going to actually reach this

68
00:05:07,300 --> 00:05:07,990
line of code.

69
00:05:08,140 --> 00:05:10,620
And then it's going to break out of this method.

70
00:05:10,690 --> 00:05:10,920
OK.

71
00:05:10,930 --> 00:05:13,420
It's not going to actually execute.

72
00:05:13,420 --> 00:05:15,500
These are lines of code here anymore.

73
00:05:15,730 --> 00:05:21,390
So the user need to actually click on this image one more time.

74
00:05:21,700 --> 00:05:27,120
And when it when the user clicks on this image one more time is going to actually check this condition

75
00:05:27,130 --> 00:05:30,850
again if game status is equal to status that not started yet.

76
00:05:30,850 --> 00:05:33,240
So this condition is not true.

77
00:05:33,460 --> 00:05:38,540
So it's going to actually start to execute these lines of code here.

78
00:05:38,560 --> 00:05:40,810
Game status is equal to status that proceed.

79
00:05:40,810 --> 00:05:41,610
That's right.

80
00:05:41,650 --> 00:05:42,410
OK.

81
00:05:42,770 --> 00:05:46,870
Here we actually put this value to the game status.

82
00:05:46,870 --> 00:05:49,090
So it's going actually to execute these lines of code here.

83
00:05:49,090 --> 00:05:55,030
Here I am actually creating an integer variable into this sum and that I am assigning the return value

84
00:05:55,030 --> 00:05:56,720
of the Smurfette which is valuable.

85
00:05:56,890 --> 00:06:03,430
And here I am saying that if the value of this by some value is equal to value of this point's valuable

86
00:06:03,700 --> 00:06:09,760
then game status is equal to a status that one takes the games that is that set text you've won.

87
00:06:09,830 --> 00:06:11,960
Maybe I and GITTOES invisible.

88
00:06:12,040 --> 00:06:14,200
Maybe it's bit and visible.

89
00:06:14,380 --> 00:06:17,620
So hopefully these lines of code make sense to you.

90
00:06:18,130 --> 00:06:23,880
And here I am saying that if the value of this though some value is equal to 7.

91
00:06:24,060 --> 00:06:29,260
OK so remember the value 7 here is assigned to this constant.

92
00:06:29,470 --> 00:06:37,030
OK and here I am saying that if else if the value of the stay so valuable is equal to 7 then game status

93
00:06:37,030 --> 00:06:38,460
is equal to that is not lost.

94
00:06:38,470 --> 00:06:39,660
So the user loses.

95
00:06:39,670 --> 00:06:45,510
Lost the game and here I am assigning this value to the sticks the game status makes.

96
00:06:45,580 --> 00:06:48,370
I am Judo's invisible and make between a start.

97
00:06:48,370 --> 00:06:48,980
Visible.

98
00:06:49,040 --> 00:06:57,030
OK so hopefully that makes sense in sight of this uncreate method after the end the curly brace that

99
00:06:57,040 --> 00:07:02,980
is actually related to the set and click listener of this I ended dice here.

100
00:07:02,980 --> 00:07:06,870
I want to actually refer to the name of the city and restart the game.

101
00:07:07,300 --> 00:07:19,090
That said on click listener new view that unclick listener and here I can actually put the lines of

102
00:07:19,090 --> 00:07:23,960
code that are actually related to the uncle listener of this PTEN restart game.

103
00:07:23,990 --> 00:07:26,440
OK so here I am just typing.

104
00:07:26,470 --> 00:07:39,610
Game status is equal to status but not started yet th's the game status that set text to double quotes

105
00:07:39,960 --> 00:07:47,840
TXI the calculations that said text to double quotes and all.

106
00:07:48,330 --> 00:07:54,030
All it takes the calculations value assignment operator to double quotes.

107
00:07:54,160 --> 00:07:59,220
As you can see I am assigning an empty value an empty string value to these variables.

108
00:07:59,250 --> 00:08:12,130
OK and then I can actually make the IMJ dice visible OK and make the restart button invisible.

109
00:08:12,790 --> 00:08:14,460
PTM restart invisible.

110
00:08:14,600 --> 00:08:21,100
OK when the user clicks on this restart the game button is going to actually execute these lines of

111
00:08:21,100 --> 00:08:21,550
code here.

112
00:08:21,550 --> 00:08:25,720
First of all it's going to assigned a value status that not started yet.

113
00:08:25,840 --> 00:08:31,060
To these games that is valuable and then it can actually assign the empty value to these takes the game

114
00:08:31,060 --> 00:08:38,050
start and then it's going to assign the value is empty value to this to the calculations and then it's

115
00:08:38,050 --> 00:08:39,920
going to actually assign this empty value to this.

116
00:08:39,930 --> 00:08:43,890
All the calculations value and then it's going to make this.

117
00:08:43,930 --> 00:08:48,960
I N G dice visible and make BT or restart invisible again.

118
00:08:49,050 --> 00:08:55,320
OK so let's actually run our project and let's see how our game is actually running ok.

119
00:08:55,510 --> 00:08:57,530
Use the same device for future launches.

120
00:08:57,560 --> 00:09:05,500
OK so as you can see here are actually the our application is actually running on this emulator so let's

121
00:09:05,500 --> 00:09:09,960
actually click on this image here in order to start the game.

122
00:09:10,180 --> 00:09:14,980
So it says you rolled 6 plus free equals number nine.

123
00:09:14,980 --> 00:09:16,900
Your point is number 9.

124
00:09:16,900 --> 00:09:18,040
Continue the game.

125
00:09:18,130 --> 00:09:20,400
So let's actually click on this image again.

126
00:09:20,560 --> 00:09:21,160
You won.

127
00:09:21,190 --> 00:09:26,410
So our point is number 9 and we rolled four plus five.

128
00:09:26,410 --> 00:09:26,950
Number nine.

129
00:09:26,950 --> 00:09:31,410
So because these were these two values are actually equal equal to each other.

130
00:09:31,450 --> 00:09:32,620
So we won the game.

131
00:09:32,710 --> 00:09:38,440
Let's restart the game and then let's actually click on this image here.

132
00:09:38,470 --> 00:09:41,210
You wrote 1 plus 2 free you lost.

133
00:09:41,530 --> 00:09:42,030
OK.

134
00:09:42,160 --> 00:09:47,590
Because we actually because the value of this dice sum is free.

135
00:09:47,620 --> 00:09:48,580
We lost the game.

136
00:09:48,610 --> 00:09:50,200
Let's restart the game.

137
00:09:50,200 --> 00:09:51,400
Click on this image.

138
00:09:51,520 --> 00:09:53,880
You wrote four plus five nine.

139
00:09:53,890 --> 00:09:55,000
Your point is nine.

140
00:09:55,000 --> 00:09:56,780
Continue with the game.

141
00:09:56,950 --> 00:09:58,420
Your point is nine.

142
00:09:58,460 --> 00:09:59,910
You roll two plus five.

143
00:09:59,920 --> 00:10:00,820
Seven.

144
00:10:01,090 --> 00:10:01,440
OK.

145
00:10:01,450 --> 00:10:04,570
Because the value of these dice here is seven.

146
00:10:04,570 --> 00:10:05,410
We lost the game.

147
00:10:05,440 --> 00:10:09,580
So now we can actually restart the game and continue playing this game.

