Car racing game - finish line scoring question

Get help using Construct 2

» Fri May 15, 2015 11:17 am

Hello!

My students are creating a car racing game (similar to the Driving Game template in Construct 2) where there is a finish line at the top of the track. We added a global variable which has a point added to it every time the finish line is crossed. However, we can't figure out a way to prevent the system from adding a point when a car goes backwards over the finish line.

So in other words, a car can go around the track and then get a point, and then go backwards and get another point without going around the track.

Is there an event we can add to prevent this from happening? We tried doing some things with instance variables but couldn't get it to work.

Thank you!
B
5
Posts: 11
Reputation: 249

» Fri May 15, 2015 11:24 am

Would checking the angle of movement of the car when colliding with the finishline work?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

» Fri May 15, 2015 11:28 am

That might work...would that just involve adding another condition to the collision event? I am not sure which angle condition to pick. I tried a few of these yesterday and couldn't get them to work.
B
5
Posts: 11
Reputation: 249

» Fri May 15, 2015 11:37 am

yes all you'd have to do is add a condition.

use the expression - Sprite.Car.MovingAngle to get the moving angle of the car

so for example

system is between angles - angle: Sprite.Car.MovingAngle - first angle: 275 - second angle: 355

would mean the car is moving upward on the layout..

you could ofcourse also check the movingangle with the angle of the finishline, or use is inbetween angles,
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775