Negastar
Member
I'm working on a line based collision system for a racing game, and I need the player object to be able to detect curved lines, as they will be part of the boundaries. So far, I've tried using collision_line along with some custom scripts, but to no avail, as it only recognizes the start of the arc in question. Any ideas? Here's the code in the finish line object:
And here's the script code that draws the arc:
Code:
draw_line_colour(x-1000,y,x+1000,y,c_red,c_red)
draw_line_colour(x-1000,y+offset,x+1000,y+offset,c_red,c_red)
draw_line_colour(x-1000,y-offset,x+1000,y-offset,c_red,c_red)
mDrawRsect(x+1000,y,offset,270,180,1,c_red)
Code:
if thi>0
{
if deg>0
{
do
{
draw_line_width_colour(xx+(lengthdir_x(rad,aa+iter)-lengthdir_y(0,aa+iter)),yy+(lengthdir_y(rad,aa+iter)+lengthdir_x(0,aa+iter)),xx+(lengthdir_x(rad+thi,aa+iter)-lengthdir_y(0,aa+iter)),yy+(lengthdir_y(rad+thi,aa+iter)+lengthdir_x(0,aa+iter)),thi,color,color)
iter+=1
}
until iter=deg
}
else exit;
}
else show_error('Thickness must be greater than zero',true)