none
Could use some help on racetrack physics RRS feed

  • Question

  • Drive This is a game I'm working on. Import SRK262

    I tried a formula to get the turns to be curved and not sharp turns but it won't work if the last turn was bigger. This is happening on line 130 in the AdvanceCones routine.

    Monday, April 30, 2012 3:37 AM

Answers

  • Nice program.

    Rather than just giving a fix, here is a hint:

    Notice that it happens when Turn and TurnMax have a different sign (i.e Turn*TurnMax<0).

    • Marked as answer by JKrueg Tuesday, May 1, 2012 4:03 AM
    Monday, April 30, 2012 6:23 PM
    Moderator

All replies

  • Nice program.

    Rather than just giving a fix, here is a hint:

    Notice that it happens when Turn and TurnMax have a different sign (i.e Turn*TurnMax<0).

    • Marked as answer by JKrueg Tuesday, May 1, 2012 4:03 AM
    Monday, April 30, 2012 6:23 PM
    Moderator
  • Hey there litdev,

    I think you are referring to using Math.Abs(Turn)?? I did in the If Then statement.

    It seems to me that Turn still holds its last value when I update TurnStep and TurnMax, if the old Turn was larger than my new TurnMax then, hard corner, positive or negative with the same signs or different signs.

    Thanks for the assist.

    Monday, April 30, 2012 11:50 PM
  • (i.e Turn*TurnMax<0).

    I just figured out what your doing here, cool trick. I think I need more.


    • Edited by JKrueg Tuesday, May 1, 2012 12:02 AM
    Tuesday, May 1, 2012 12:01 AM
  • OK that did help litdev. Took me a while to get it figured out. Had to make adjustments elsewhere so the track wouldn't head off the side of the screen so far, still does every once in a while, but it works much better.

    Thank you, litdev

    Drive This one -- GMR939

    Tuesday, May 1, 2012 4:03 AM