Score based on Drifting

  • Hello, Everyone.

    Once again I need to borrow your knowledge to solve a peculiar problem...

    I'm creating a top down racing game with a "Tokyo drift" theme going on

    So far, I'm just using a car behavior for the "player" and some global values for the damage on the car when it hits something. Right now i'm working around the idea of getting points when you drift, very similar of what happens in the drifting challenges on the Need For Speed: Underground series.

    I've tried using the angle of the car but, on a top down racer you can just get points by pointing the car to the right angle without drifting - erase this idea.

    I've also tried creating little sprites on the front and back of the car and use the angle between them as a comparable value to use but it just results on the same issue of before.

    What's the best way for me to achieve this drift score mechanic on C2?

    Thank you all in advance

  • Fisrt you need to know what you consider drifting..

    Then you need to set up conditions for when this is happening..

    So I guess it would be something like:

    Car is moving

    Car speed is > 10

    sytem compare two values car.angle is not the same as car.car.movingangle

    add 1 to drift

    But I'm not sure if these conditions are the ones you are aiming for..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is a very rough code that adds to a score variable while the car object is moving but not facing forward.. aka drifting.

    You would need to tweak it to get your exact feel though. I used globals for simplicity.

    Pic:

    https://drive.google.com/open?id=0Bx-ufu2WID53ODhMcWRrbWo3SGc

  • Why would you need the extra global variables for that?

  • My wife was yelling at me to come downstairs and take the trash out.. I didn't have time to think it through logically.

  • First of all, thank you all so much for the help. Both solution seem to work brilliantly when it comes to adding score when it drifts.

    My issue right now is that i need to increase the value of the angle so that the drift score doesn't go up as soon as you steer the car. In another words, the drift score only goes up if the drift angle is above a certain value.

    I'm gonna do some testing with some calculations but, in the meantime, if you guys any valuable info, it's always more than welcome.

    Thank you

  • That would consist of adding another condition

    car.angle is not within 10 degrees of car.car.movingangle

    or something similar.

  • QUOTE: That would consist of adding another condition

    car.angle is not within 10 degrees of car.car.movingangle

    or something similar.

    That's exactly what I've been trying to do but most likely I'm not applying the right formula, since I'm still a bit of a noob...

    --

  • Right click the event

    choose - Add another condition

    System is within angle : angle1 = car.angle, within = 10, angle2 = car.car.movingangle

    right click condition

    choose - invert

  • I works perfectly, LittleStain!

    Thank you all, again.

    --

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)