Results 1 to 5 of 5

Thread: Inclined Obstacles in Platform

  1. #1

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553

    Inclined Obstacles in Platform

    Hello,
    how to make platform games and use inclined obstacles???
    ICQ: 128716725

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Well, easy. Just use y = mx+b, giving your inclined tile a slope (height of incline / width of incline). Then you can solve for it:
    VB Code:
    1. Private Function BaseY(mWidth As Long, mHeight As Long, X As Long)
    2.  
    3. BaseY = (mHeight / mWidth) * X
    4.  
    5. End Function
    6.  
    7. ...
    8. ...
    9.  
    10. Chara.Y = BaseY(CurrentBase.Width, CurrentBase.Height, Chara.X)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Thanx!

    But, that formula, how to set the slope to slope to the right/left?
    Last edited by petrus; Oct 10th, 2002 at 10:01 AM.
    ICQ: 128716725

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Put in -Width for Left down to Right, and Width for Left up to Right (I think). It may be the other way around.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Aha, thanx, i thought about something like that, but wasn't sure.
    ICQ: 128716725

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width