Wednesday, September 27, 2017

Report 3rd Term Lucia Kulzer and Pia Palacios

Report: Low difficulty game




We needed to use this blocks obligatory: 

If we weren't using one of them, is because we were doing something wrong.

We created "Driving Game" like this:


We made a multiplayer game with two cars: the red car, and the blue car. Each one has his own keys on the keyboard. The red car uses the arrows, and the blue car uses the combination of the letters; w,a,s and d.
It has also laps: when you cross the finish line, a number is added to the variable for laps. If the blue car crosses the finish line, a point is added to the variable for "Laps (blue car)". 
When a car has 3 laps, the background changes, so there's another map to play another race. If a car has 5 laps, the game ends, and you have to click on the green flag to play again.
Finally, we added a counter of how many Gas each car has. At the beginning, they start with 3 liters of Gas. 6 Seconds later, the counter goes 1 liter down, and if you have the number 0 on your Gas counter, the car doesn't move. If you want to recharge your Gas, you need to go to the "GAS" station, where your counter of liters will be on 3.

Let see how we made these things:

We created variables:


There are two variables like this ones too, for the blue car. We use them to show the player how the speed of his/her car is, how many laps they go and their Gas counter. 

How the cars move:


For the red car, we used this blocks to make it move. If you press the right arrow (in the blue car it is the letter "d"), it turns five degrees to the right, and if you press the left arrow (in the blue car it is the letter "a") it turns five degrees to the left. If you press the up arrow ( in the blue car it is the letter "w") the variable for speed changes 0.2 each time you press the up arrow. If you press the down arrow (in the blue car it is the letter "s") the variable for speed changes -0.2 every time you press the down arrow.

How we make them go slower on the grass:


When any car touches the green zone (the "grass") and the speed of it is bigger than the number -0.3, the speed of the car should only go to 0.3. If the car leaves that zone, it goes normally. We used the image upside of how it works on the blue car. The red car has the same programme, the only exception is that the variable says "Speed (red car)". This was an achievement for us because we didn't even know how to make the car went slower in the green zone. We made it differently many times until we got to this solution. We figured it out alone, testing if several blocks could go in or not.

How the laps work:


This is an example of the red car, but both cars have the same blocks, except one thing: the variable. The blue car has for a variable "Laps (blue car)". This works like this; when (for example) the red car crosses the object "Finish Line" (Like the image below, the finish line is the orange circled object), the programme waits 0.8 seconds and then changes the variable for "Laps (red car)" to 1. We decided to put the "wait" block because, without it, the programme added a lot of points to the variable, and we didn't want that. We used this for the blue car too, changing the variable for "Laps (red car)" to "Laps (blue car)".


How we changed the background:


We did it like this:
We used the operator to indicate when the backdrop should change. If any car gets it third lap, the background changes to another map, which is like a "second level" and its more difficult than the first map.

How we made the everything for the Gas:


First, we made the "GAS" station as an object, because it was easier for us to make it like that, instead of placing the block of "touching color...". If your car was touching the "GAS" station, the Gas variable were automatically 3 liters added to your counter of Gas. If you weren't touching the "GAS" station, each 6 seconds a liter of Gas was removed from your counter. What happened if you had 0 liters on your Gas counter? The car stopped moving. We put them in two different events because if don't, the car didn't stop at all. This was an achievement for us because we were testing many blocks and other combination to create this for the Gas.

Here some images showing the game "in action":



Lucia Kulzer and Pia Palacios 2ºA

No comments:

Post a Comment