Hello,
how to make platform games and use inclined obstacles???
Printable View
Hello,
how to make platform games and use inclined obstacles???
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:
Private Function BaseY(mWidth As Long, mHeight As Long, X As Long) BaseY = (mHeight / mWidth) * X End Function ... ... Chara.Y = BaseY(CurrentBase.Width, CurrentBase.Height, Chara.X)
Thanx!
But, that formula, how to set the slope to slope to the right/left?
Put in -Width for Left down to Right, and Width for Left up to Right (I think). It may be the other way around.
Aha, thanx, i thought about something like that, but wasn't sure.:D