Hi,
First to say, I am a BASIC newbie, but I programmed years ago in QBASIC, so I still know some basics ;-)
What I want to program:
A simple playfield with 2 goals on each side. 2 or more robots (small sprites) are set to their start points and then they have to collect
small points, which are gathered over the playfield. When a robot collects a point, he has to bring it to his goal, then collect the next point.
The robot or robot team which has the higher score when no more points are left wins... I know there is no interactivity in this version of the
"game", but I want to program some simple AI-routines first before I implement a player controlled robot...
I didnt have any problems drawing the playfield and a first point to collect and one robot:
10 REM DRAW PLAYFIELD
20 SCREEN 3,0
30 LINE (6,1)-(254,1)
40 LINE (254,1)-(254,190)
50 LINE (254,190)-(6,190)
60 LINE (6,1)-(6,190)
70 PAINT (18,18),12,15
80 REM DRAW GOALS
90 LINE (6,64)-(32,64)
100 LINE (32,64)-(32,128)
110 LINE (6,128)-(32,128)
120 LINE (220,64)-(254,64)
130 LINE (220,64)-(220,128)
140 LINE (220,128)-(254,128)
150 REM ROBOT SPRITE
160 SPRITE ON
170 A1$=CHR$(&B00011000)
180 A1$=CHR$(&B00101100)
190 A1$=CHR$(&B00111100)
200 A1$=CHR$(&B00011000)
210 A$=A1$+A2$+A3$+A4$
220 SPRITE$(0)=A$
230 REM DRAW POINT TO COLLECT
240 PX=67
250 PY=80
260 PSET (PX,PY),11
270 REM DRAW ROBOT
280 X=2
290 Y=2
300 PUT SPRITE 0,(X,Y),8,0
... this is the point I dont know further. I have 1 point and 1 "Robot-Sprite". How can I move the sprite to the point in the shortest way?
I experimented a bit:
310 IF X=
320 IF Y=
330 IF X=>PX THEN X=X-1
340 IF Y=>PY THEN Y=Y-1
350 IF X=PX THEN 360 ELSE 300:IF Y=PY THEN 360 ELSE 300
360 GOTO 360
Now the sprite moves in 45 degree angles only... How can I move it directly to the point?
Thanks in advance!

so that's how I would do it right now if I were to program such a routine.