Hey , i have a problem , ive wanted to create a program that runs 3 circles on a racetrack and when one of them reaches the end the program step out of the main loop and write the name of the ball that won ,. so ive added to the main loop those line
IF Ball1X = 570 THEN
winner$ = "RED"
EXIT
IF Ball2X = 570 THEN
winner$ = "GREEN"
EXIT
IF Ball3X = 570 THEN
winner$ = "YELLOW"
EXIT
But the balls stoped runing on the screen they just not moving
any1 knows why ??
Here is the full code
REMSTART
Title : Circle Casino Version 0.1
Author : Shlomi Nahari
Date : 3.2006
REMEND
RANDOMIZE TIMER()
Ball1X = 70
Ball1Y = 150
Ball2X = 70
Ball2Y = 250
Ball3X = 70
Ball3Y = 350
BallSize = 40
BallSpeed = RND(3)
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
INK RGB(255,255,255),0
CENTER TEXT 320,420,"PRESS ANY KEY TO START THE RACE"
WAIT KEY
REM MAIN LOOP
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 THEN
winner$ = "RED"
EXIT
IF Ball2X = 570 THEN
winner$ = "GREEN"
EXIT
IF Ball3X = 570 THEN
winner$ = "YELLOW"
EXIT
LOOP
WAIT KEY
REM FUNCTIONS
FUNCTION mainscreen_graphics()
CLS
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 RGB(0,0,255),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