09-06-2004, 10:56 AM
yes it's me again...
anyways, the following is a simple program which two dots randomly move about and area. absolutely pointless.
well i can't figure out how to refresh the dots without having to clear and re-draw the red box around then. when i do, the box flickers. so here's the code
it's obvious that im still a newbie programmer:
any help?
anyways, the following is a simple program which two dots randomly move about and area. absolutely pointless.
well i can't figure out how to refresh the dots without having to clear and re-draw the red box around then. when i do, the box flickers. so here's the code
it's obvious that im still a newbie programmer:
Code:
SCREEN 13
a = 40
B = 40
c = 40
d = 45
DO
LINE (19, 19)-(101, 101), 4, B
frld = 0
DO
frld = frld + 1
LOOP UNTIL frld = 2500
RANDOMIZE TIMER
RN = INT(RND * 4) + 1
CLS
IF RN = 1 THEN a = a - 1
IF RN = 3 THEN a = a + 1
IF RN = 2 THEN B = B + 1
IF RN = 4 THEN B = B - 1
IF a < 20 THEN a = 100
IF a > 100 THEN a = 20
IF B < 20 THEN B = 100
IF B > 100 THEN B = 20
RN2 = INT(RND * 4) + 1
IF RN2 = 1 THEN c = c - 1
IF RN2 = 3 THEN c = c + 1
IF RN2 = 2 THEN d = d + 1
IF RN2 = 4 THEN d = d - 1
IF c < 20 THEN c = 100
IF c > 100 THEN c = 20
IF d < 20 THEN d = 100
IF d > 100 THEN d = 20
PSET (a + 1, B + 1), 9
PSET (a + 1, B), 9
PSET (a, B + 1), 9
PSET (c + 1, d + 1), 7
PSET (c + 1, d), 7
PSET (c, d + 1), 7
PSET (c, d), 7
PSET (a, B), 9
LOOP UNTIL INKEY$ = "q"