Hmm maybe somebody can find my problem with this code. When it rry to run it it says it was expecting ")" but encountered end of the line.
Why doesn't this compiler tell you where the error is?
here is my code:
Graphics 640,480,0
Include "Interface.bmx"
' make some drawing commands
' draw rect unfilled
Function draw_rect_hollow#(x1#,y1#,width#,height#)
DrawLine x1,y1,x1+width-1,y1
DrawLine x1,y1,x1,y1+height-1
DrawLine x1+width-1,y1,x1+width-1,y1+height-1
DrawLine x1,y1+height-1,x1+width-1,y1+height-1
EndFunction
' draw circle unfilled
Function draw_ellipse_hollow#(x1#,y1#,width#,height#,segments:Int)
Local center_x#=x1+(width/2)
Local center_y#=y1+(height/2
Local x_radius#=(width-1/2)
Local y_radius#=(height-1/2)
Local angle#=360/segments
For i=0 To segments Step 1
DrawLine center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius,center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius
Next
EndFunction
' draw lines from center
Function draw_ellipse_lines#(x1#,y1#,width#,height#,segments:Int)
Local center_x#=x1+(width/2)
Local center_y#=y1+(height/2)
Local x_radius#=(width-1/2)
Local y_radius#=(height-1/2)
Local angle#=360/segments
For i=0 To segments Step 1
DrawLine center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius,center_x,center_y
Next
EndFunction
While Not KeyDown(Key_Escape) ' make sure the user hasn't quit
' draw step
' draw background
SetColor 250,250,244
DrawRect 0,0,640,480
' draw the crosshairs
SetLineWidth 3
SetColor 235,200,134
DrawLine MouseX(),0,MouseX(),480
DrawLine 0,MouseY(),640,MouseY()
draw_ellipse_hollow(0,0,640,480,36)
'the font please
SetScale 3,3
DrawText "SCORE: ",0,0
SetScale 1,1
Flip
Cls
Wend
Why doesn't this compiler tell you where the error is?
here is my code:
Graphics 640,480,0
Include "Interface.bmx"
' make some drawing commands
' draw rect unfilled
Function draw_rect_hollow#(x1#,y1#,width#,height#)
DrawLine x1,y1,x1+width-1,y1
DrawLine x1,y1,x1,y1+height-1
DrawLine x1+width-1,y1,x1+width-1,y1+height-1
DrawLine x1,y1+height-1,x1+width-1,y1+height-1
EndFunction
' draw circle unfilled
Function draw_ellipse_hollow#(x1#,y1#,width#,height#,segments:Int)
Local center_x#=x1+(width/2)
Local center_y#=y1+(height/2
Local x_radius#=(width-1/2)
Local y_radius#=(height-1/2)
Local angle#=360/segments
For i=0 To segments Step 1
DrawLine center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius,center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius
Next
EndFunction
' draw lines from center
Function draw_ellipse_lines#(x1#,y1#,width#,height#,segments:Int)
Local center_x#=x1+(width/2)
Local center_y#=y1+(height/2)
Local x_radius#=(width-1/2)
Local y_radius#=(height-1/2)
Local angle#=360/segments
For i=0 To segments Step 1
DrawLine center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius,center_x,center_y
Next
EndFunction
While Not KeyDown(Key_Escape) ' make sure the user hasn't quit
' draw step
' draw background
SetColor 250,250,244
DrawRect 0,0,640,480
' draw the crosshairs
SetLineWidth 3
SetColor 235,200,134
DrawLine MouseX(),0,MouseX(),480
DrawLine 0,MouseY(),640,MouseY()
draw_ellipse_hollow(0,0,640,480,36)
'the font please
SetScale 3,3
DrawText "SCORE: ",0,0
SetScale 1,1
Flip
Cls
Wend