I found a problem in the Line2d I posted above to the function createParallel and I fixed it.(I Edited the post)
This may help for the circle Line collision case
(I found it in the codearchives)
I still trying to find out a way to handle poly poly collision but sadly with no luck. I will still searching.
No luck to the convertion of methods in polycolly.(I just losted the game in the first tutorial shame on me)
I found an nPoly lib maded for blitz in the showcase it even have it's entry to the number 9 of the Blitznews.
Here is the post : http://www.blitzmax.com/Community/posts.php?topic=36003&hl=npoly
but you will find out that we cannot take it and look throu it. The code of nPoly may solve some of the problems right now.
After all this concept it's a really good learning curve for me and I am glad thinking that I am part of it.
Edit: And another think to have the poly poly collision we must find a way to imliment this method : http://gpwiki.org/index.php/Polygon_Collision
This is the fastest and the mostly used.
This may help for the circle Line collision case
(I found it in the codearchives)
Function MinDistPointLine#(px#,py#,x1#,y1#,x2#,y2#) If x1 = x2 And y1 = y2 Then Return PointToPointDist(px,py,x1,y1) Local sx# = x2-x1 Local sy# = y2-y1 Local q# = ((px-x1) * (x2-x1) + (py - y1) * (y2-y1)) / (sx*sx + sy*sy) If q < 0.0 Then q = 0.0 If q > 1.0 Then q = 1.0 Return PointToPointDist(px,py,(1-q)*x1+q*x2,(1-q)*y1 + q*y2) End Function
I still trying to find out a way to handle poly poly collision but sadly with no luck. I will still searching.
No luck to the convertion of methods in polycolly.(I just losted the game in the first tutorial shame on me)
I found an nPoly lib maded for blitz in the showcase it even have it's entry to the number 9 of the Blitznews.
Here is the post : http://www.blitzmax.com/Community/posts.php?topic=36003&hl=npoly
but you will find out that we cannot take it and look throu it. The code of nPoly may solve some of the problems right now.
After all this concept it's a really good learning curve for me and I am glad thinking that I am part of it.
Edit: And another think to have the poly poly collision we must find a way to imliment this method : http://gpwiki.org/index.php/Polygon_Collision
This is the fastest and the mostly used.