Well ive managed to finish my first program in darkbasic thanks to your help guys , 3 balls runing up on the screen and one of them win . here is the code , tell me what you think
Rem Project: Circle_Casino
Rem Created: 05/03/2006 11:57:04
Rem ***** Main Source File *****
RANDOMIZE TIMER()
REM VARIABLES
Ball1X = 70
Ball1Y = 150
Ball2X = 70
Ball2Y = 250
Ball3X = 70
Ball3Y = 350
BallSize = 40
mainscreen_graphics()
REM CREATING CIRCLES
INK RGB(255,0,0),0
CIRCLE Ball1X,Ball1Y,BallSize
INK RGB(0,255,0),0
CIRCLE Ball2X,Ball2Y,BallSize
INK RGB(255,255,0),0
CIRCLE Ball3X,Ball3Y,BallSize
INK RGB(255,255,255),0
CENTER TEXT 320,420,"PRESS ANY KEY TO START THE RACE"
WAIT KEY
REM MAINLOOP
DO
CLS
mainscreen_graphics()
INK RGB(255,0,0),0
CIRCLE Ball1X,Ball1Y,BallSize
INK RGB(0,255,0),0
CIRCLE Ball2X,Ball2Y,BallSize
INK RGB(255,255,0),0
CIRCLE Ball3X,Ball3Y,BallSize
Ball1X = Ball1X + RND(1) +1
Ball2X = Ball2X + RND(1) +1
Ball3X = Ball3X + RND(1) +1
IF Ball1X = 570
winner$ = "RED"
EXIT
ENDIF
IF Ball2X = 570
winner$ = "GREEN"
EXIT
ENDIF
IF Ball3X = 570
winner$ = "YELLOW"
EXIT
ENDIF
LOOP
INK RGB(255,255,255),0
CENTER TEXT 320,420,"THE WINNER IS : " +winner$
WAIT KEY
REM FUNCTIONS
FUNCTION mainscreen_graphics()
CLS RGB(0,0,255)
INK RGB(255,255,255),0
SET TEXT FONT "MS Dialog"
SET TEXT SIZE 25
CENTER TEXT 320,55,"Circle Casino Version 0.1"
SET TEXT SIZE 15
CENTER TEXT 320,40,"Reality Studio"
INK 0,0
LINE 20,100,620,100
LINE 20,400,620,400
LINE 20,100,20,400
LINE 620,100,620,400
LINE 20,200,620,200
LINE 20,300,620,300
ENDFUNCTION