1
00:00:00,360 --> 00:00:05,160
The objective of the game is to move the plane and hit the target, and we are going to be creating

2
00:00:05,160 --> 00:00:06,290
a target eventually.

3
00:00:06,690 --> 00:00:13,470
So what we want is the plane to actually automatically be flying in the one direction, incrementing

4
00:00:13,470 --> 00:00:14,670
X all the time.

5
00:00:14,880 --> 00:00:15,690
So it doesn't matter.

6
00:00:15,690 --> 00:00:19,970
Even if the player is pressing X, it'll just speed it up.

7
00:00:20,310 --> 00:00:24,180
But we always have a default value here where we're taking player X.

8
00:00:24,390 --> 00:00:30,570
So before we're out putting it in our left position substate in the style position, we're going to

9
00:00:30,570 --> 00:00:36,380
increment the value of player X and taking our player speed value.

10
00:00:36,630 --> 00:00:40,950
So we try to keep it as dynamic as possible, multiplying it by two.

11
00:00:40,980 --> 00:00:45,240
So what this will do is this will always keep our plane moving.

12
00:00:45,480 --> 00:00:48,150
So always, always, always moving our plane along.

13
00:00:48,270 --> 00:00:55,230
And one of the problems that we immediately see is that it continues to move along and it's passing

14
00:00:55,230 --> 00:00:58,250
over the area where it's supposed to actually be.

15
00:00:58,470 --> 00:01:01,190
So it's moving past our offset area.

16
00:01:01,200 --> 00:01:04,200
So let's do a check for that and that's account for that.

17
00:01:04,380 --> 00:01:11,910
So taking player X and checking to see if it's larger than game area and we'll use that offset width

18
00:01:11,910 --> 00:01:15,980
again to get that last side value, the right side value.

19
00:01:15,990 --> 00:01:20,750
And if it is, then we're taking player X and we're going to set it back to zero.

20
00:01:21,060 --> 00:01:23,430
So this will put the position back.

21
00:01:23,430 --> 00:01:30,090
And we're also going to take the player score because ultimately we want the player to be able to bomb

22
00:01:30,090 --> 00:01:32,400
the position as quickly as possible.

23
00:01:32,410 --> 00:01:37,560
So if he flies by it, if he makes multiple passes, then that's not going to be a good thing.

24
00:01:37,590 --> 00:01:44,220
And also what the score I want to set a default score whenever it starts to 2000.

25
00:01:44,230 --> 00:01:46,260
So we have something to subtract off of.

26
00:01:46,560 --> 00:01:51,900
So now let's try that and press start and we can see that, of course, we're not showing the score

27
00:01:51,900 --> 00:01:56,010
quite yet, but now we can see that the plane is continuously flying.

28
00:01:56,160 --> 00:01:58,590
If I push the right arrow, it goes a little faster.

29
00:01:58,710 --> 00:02:03,900
If I push the left, it slows it down, but it's still always going over to the right hand side.

30
00:02:04,020 --> 00:02:10,860
And that's exactly the movement that we want it to have so that we can have our player score constantly

31
00:02:10,860 --> 00:02:11,610
progressing.

32
00:02:11,620 --> 00:02:18,600
We also want to decrease the score as it takes longer for the player to hit the target.

33
00:02:18,900 --> 00:02:22,350
So we're always going to be decreasing the score constantly.

34
00:02:22,650 --> 00:02:26,630
And then lastly, I don't want the score ever to go less than zero.

35
00:02:26,850 --> 00:02:30,030
So we're going to do a quick check to see if it is less than zero.

36
00:02:30,210 --> 00:02:36,180
And if it is, then we're simply going to take player score and equal it to zero so that we don't ever

37
00:02:36,180 --> 00:02:37,570
go less than zero.

38
00:02:37,650 --> 00:02:40,170
So coming up next, we need to output the score.

39
00:02:40,740 --> 00:02:45,180
So outputting the score and we already set up an area here to output the score.

40
00:02:45,390 --> 00:02:46,320
So it's coming up next.

41
00:02:46,320 --> 00:02:50,870
We'll do some styling to that and output it within our visible area of our gameplay.

42
00:02:50,910 --> 00:02:57,900
So go ahead and add in this automatic movement and start adding in the scoring mechanism as well in

43
00:02:57,900 --> 00:02:58,980
addition to your project.
