Hi, in this post we are going to tell you the basics of how we created the driving Game.
We started first with an oval track(the oval track and the sprites were provided by scratch).Then we started to create the scripts.
Up to now everything in the scripts was inside a forever
-The first thing was making the car turn left and right wich we did this way :
(if the "left or right " arrow is pressed the car will turn in the following direction)
After it we should make the car go forward that is when things get a little bit difficult.
First we should create a variable called speed, it is made like this:
After you press the make a variable button it is pretty much self explanatory,but you just give it a name and now you can use it for what you want .
We will use this variable like this:
(when you press the up arrow the "speed" is going to raise)
And after this an other requirement was to move the car in many different speeds that is why the variable comes in.
As a solution to be able to regulate the different speeds we did the same with the down arrow(the thing shown in the picture above) but we change the positive value for a negative one.
To this we had to add as a requirement that if you are touching the green zone the car should go slower.That in the scripts was something like this:
By this every time you are touching the "grass" it should go slower.
As a non obligatory thing we added a lap counter,and it was something like this:
-we created a variable called laps
-if you were touching the red zone "the start" the counter should go one up.
And that is how we created the game, we hope you enjoyed it and the only thing left is to set the parameters in which you want the car to start and play !!!!
No comments:
Post a Comment