Author Topic: Calculating Slopes  (Read 2193 times)

0 Members and 1 Guest are viewing this topic.

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Calculating Slopes
« on: February 12, 2011, 07:07:59 pm »
How would you go about moving an object in a straight line? Axe doesn't support decimals, so how could you calculate slope and use it to move an object?
Or would you have to use trig?
In-progress: Graviter (...)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Calculating Slopes
« Reply #1 on: February 12, 2011, 07:12:45 pm »
Most of the time, we like to have scaled-up values when working internally with the physics and scale them back down when displaying them onscreen. Typically we have 256 represent one pixel (though you can do it any way you want. 256 is probably the fastest number to divide by)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Calculating Slopes
« Reply #2 on: February 12, 2011, 07:15:24 pm »
Yeah so I was thinking take the unscaled value of the slope between two points (store the rise into one var and run into another) then scale the movement down by 256, but still use the unscaled slope values.
« Last Edit: February 12, 2011, 07:15:37 pm by leafiness0 »
In-progress: Graviter (...)