Friday, September 29, 2017

Report 3. Term Mayer & de Artiagoitia. Low difficulty game.

How we scripted our game

THIS GAME STARTS, WHEN YOU CLICK THE GREEN FLAG.

First car
First we had to make our car move. So, as you can see in the picture, we made it go forward with the up arrow key, turn 5 degrees left with the left arrow key and turn right with the right arrow key. The map has the race track and the grass, the green part. And the requirement was that when the car was on the grass, it had to move slower. I used the blocks “touching color  ?” and “set speed to 2”, to make the car only go forward by 2.

You can see that instead of using steps, we used a variable called speed. To create the variable you have to go to data and click “create a variable”. Once you have the variable, you have to make it increase using the block “change speed by -”.
You can also set the speed to 0, 1, 2, …
And to make the speed decrease, I had to make it change by a negative number (-0,15). At the top you can see a a block that says “set speed to 4”, that means that the speed will be 4 when the game starts (when you click the green flag).



Then we could also add more ideas we had. And I wanted a meter-counter, so I created a variable called “meters”, and the counter would change by 1, when you were moving, but not when it was touching the color green.
When the counter is on 750, the backdrop will change to another track. And when it arrives on 1500 it would change to another backdrop, where the winner of the two cars will glide in 1.5 seconds to a determined place.





Second car

With this car I made basically the same as with the first one. I had to change only a few things:
  • Instead of using the up, left, right and down arrow key y used the letters w (up), a (left), d (right) and s (down).
  • The variable “speed” was replaced by the variable “speed1”.

  • I also had to change some blocks, but specially the variable “meters”. I created a new variable, called “meters2”, because if you use the same meter-counter for to cars, it won’t work (increase).







Finish line


The finish line appears when the green flag is clicked.
I wanted to make the finish line disappear, when the backdrop changes to “blue sky2”, no matter which meter-counter arrives earlier to 1499.

Added information

First car:   

Second car:

Finish line:

Oval track:

Oval track2:

Blue sky2:

collage 1.jpg

No comments:

Post a Comment