Download presentation
Presentation is loading. Please wait.
1
Street Racing Game
2
Create the opening screen
3
相信大家在之前的練習中已學會了如何加入圖片、聲音及背景等素材。
由於時間關係,我們直接開啟我們範本。 \\schoolpublic\…..
4
Create the room and set the background image.
5
Set the vertical speed to 3, therefore the background will move down slowly at a speed 3.
6
Create the controller_start to control the object in the room0.
7
Set the probability to generate a car_down is 1/50
9
Similarly, set the probability to generate a car_up is 1/100
11
Left click the mouse to add the controller_start in room0.
You can preview the game now!!!
12
Add an event to start the game by pressing any key
13
Set the transition style as you want.
14
Set the background music at the “Game Start” Event
Add event other Game Start Play sound!!!
16
Under the “Game Start” Set the “New score” = 0
17
New lives = 3
18
Add some instruction for the user
Add Event Draw
19
Select the Font and alignment
20
Select the Colour
21
Add the Text and the position as you want
22
Similarly, add the second row of text.
26
SET the Object: car_down
27
Reset the variable “dead” to “false”
28
As there are four kind of car, we set the game to generate the car randomly among the four.
29
Use the “Jump to start” the set a car created in lane 3
Set the vertical speed is 6
30
Set the car created at lane 3 with a chance 1/2
31
Preview
32
Start a block
33
Similarly, Set the Use the “Jump to start” the set a car created in lane 2
Set the vertical speed is 5
34
Set the car created at lane 3 with a chance 1/3
Similarly, Set the Use the “Jump to start” the set a car created in lane 2 Set the vertical speed is 5
35
When the car go outside the room
36
If the car y position of the car > room_height
37
Destroy the instance
38
Overlap
39
Check object Overlap
41
car_up x = 44+300 speed = 2 x = 44+240 speed = 1 x = 44+180
Similarly, Set the car_up
42
Complete the opening room
End of Lesson 1
43
Lesson 2 Create the Room 1
44
Create the required “Object”
45
Create Object: controller
It is used to control the generation of car_up, car_down, police car, petrol, score and lives.
46
Set the variable name and value as global.petrol and 1000.
47
Set the Alarm0 as 300.
48
Alarm0 is used to generate the petrol in the game.
Add Event Alarm Alarm0
49
Main1 Create Object Gas
X 40+random(320) Y -40
50
Main2 Create Set Alarm Number of Steps : 300+score/100
51
Add Event Step Score new score 1 (relative)
52
Then Set the step as below:
car_down car_up Police car
53
When there is no more lives :
Show the Highscore table 2. Restart the Game
54
Draw the score caption :
Lives (Cars left) 3. Petrol
55
Draw the petrol left box
57
480+max(0,min(100,global.petrol/10))
58
Create car_racing
59
Set the variable “dead “ as “false”
60
Set the vertical speed as 0
63
What happen after “Crash”
Racing car
66
Similarly for the car_up
67
Create the Room 1
70
What happen after “Crash”
car_down, car_up and police car
76
Control the racing car to move
Left
78
global.petrol > 0 && x >32 && not dead
80
Left: global.petrol > 0 && x >32 && not dead
Right: global.petrol > 0 && x < 360 && not dead Up: global.petrol > 0 && not dead Down: global.petrol > 0 && not dead Left: x = -2, y=0 Right: x = 2, y=0 Up: x = 0, y=-3 Down: x = 0, y=3
84
End of Lesson 2
85
When the racing car get the petrol
88
Create petrol
89
Set the speed of petrol as the background = 3
90
If the y position of the petrol as the height, destroy the instance.
91
Go back to the setting of the racing_car.
93
Create the police car
95
1. Sound = sirens, loop =true
2. Variable “dead” = false 3. Vertical speed = -1.5 4. X car_racing.x Y room_height 5. Check object ”racing car” 6. Destroy the instance 7. Check object ”racing car” 8. Destroy the instance 9. Check object ”racing car” 10. Destroy the instance
97
If dead = true 2. Exit 3. If “car_racing.x<x && place_empty(x-8,y)” 4. Jump to left (-2) relatively If “car_racing.x>x && place_empty(x+8,y)” 6. Jump to right (2) relatively
98
Similar to car_down and racing_car.
Vertical speed =3 Similar to car_down and racing_car.
99
y<0 || y > room_height+20
100
Completed!!
101
End of the Game
102
Additional tasks Add hearts to increase the lives
Add coins to increase the score Add gun to shoot the other cars
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.