1
00:00:00,060 --> 00:00:02,670
How's it going so far, how's your game coming along?

2
00:00:02,970 --> 00:00:06,360
I made a quick adjustment to the player speed to bring it back to two.

3
00:00:06,570 --> 00:00:11,960
So it's not moving around as quickly because this is a dynamic value that's going to be constantly moving.

4
00:00:12,270 --> 00:00:16,860
And in order to introduce gravity, gravity, it's going to be very, very simple.

5
00:00:17,110 --> 00:00:22,230
So we're taking the value of player Y and before we're out putting it on the screen, we're going to

6
00:00:22,230 --> 00:00:30,150
just simply add in a value and we want to add the gravity to be whatever the player speed times to.

7
00:00:30,330 --> 00:00:33,140
Or we could set an actual value here for gravity.

8
00:00:33,390 --> 00:00:35,580
But for now, we'll use the player speed.

9
00:00:35,800 --> 00:00:41,850
So what's going to happen here is before we hit the setting, it's going to drop the player down.

10
00:00:41,860 --> 00:00:45,690
So unless they're actually clicking, it's not going to fly them up.

11
00:00:45,960 --> 00:00:51,390
And that means that we also need to increase that a little bit quicker, because what's happening here

12
00:00:51,390 --> 00:00:55,200
is we're dropping it down and we're running way, way down there.

13
00:00:55,410 --> 00:01:03,260
So we want to make sure that the player has an opportunity to decrease their position for their y value.

14
00:01:03,570 --> 00:01:10,370
So taking that player speed and let's multiply it, we can multiply it by a factor of five.

15
00:01:10,680 --> 00:01:13,170
And then there's also that option to make it dynamic.

16
00:01:13,480 --> 00:01:19,590
So doing a factor of five is going to give the player the ability to touch it a few times and it's going

17
00:01:19,590 --> 00:01:22,500
to move up faster than it's moving down.

18
00:01:22,650 --> 00:01:26,270
But we still have that downward lag on the character.

19
00:01:27,120 --> 00:01:29,450
So let's also introduce scoring.

20
00:01:29,760 --> 00:01:31,710
So that was really easy to add in.

21
00:01:31,710 --> 00:01:34,410
And we also want to add in the scoring.

22
00:01:34,740 --> 00:01:40,830
So updating our player score so the longer the player is able to play the game, the better they're

23
00:01:40,830 --> 00:01:41,500
going to score.

24
00:01:41,850 --> 00:01:46,980
So over here, we're we're seeing some of the player values and that should be player.

25
00:01:48,570 --> 00:01:54,810
So started out at zero, and then we're going to increment the player score and we should also output

26
00:01:54,810 --> 00:01:55,350
the score.

27
00:01:55,360 --> 00:02:02,880
So using that score object, updating our entire text of it, we're going to output the value to the

28
00:02:02,880 --> 00:02:03,260
player.

29
00:02:03,990 --> 00:02:09,120
So taking score and our player score, object and output that to the player.

30
00:02:09,810 --> 00:02:14,320
So now the longer they're staying alive, the higher the score is going to go.

31
00:02:14,970 --> 00:02:20,220
And there's also one other thing that we need to do, and that's going to be that we need to have a

32
00:02:20,220 --> 00:02:21,470
way to lose.

33
00:02:21,990 --> 00:02:30,240
So having this constant decrease and constant lag down, we can take the value of bird and check its

34
00:02:30,240 --> 00:02:31,560
offset position.

35
00:02:32,250 --> 00:02:43,740
And if the offset top position is greater than game area offset height, then what's going to happen

36
00:02:43,740 --> 00:02:45,720
here is that the game's over.

37
00:02:46,350 --> 00:02:54,140
So we can say in the console we can output the game over and we can introduce our game over functionality.

38
00:02:54,930 --> 00:02:57,880
So that can be another function that we can set up at a later time.

39
00:02:58,560 --> 00:03:08,520
So for now, add in the score, add in the automatic gravity, adjust your player up arrow speed so

40
00:03:08,520 --> 00:03:11,880
that they can move up faster than it drags them down.

41
00:03:12,360 --> 00:03:18,420
And you're ready to move on to the next part of the game where we can have the play over area and we

42
00:03:18,420 --> 00:03:25,830
can also have the restarting of the game and have all of the conditions and functions working.

43
00:03:26,310 --> 00:03:28,180
And then we're going to introduce the obstacles.

44
00:03:28,200 --> 00:03:29,550
So that's still all yet to come.
