AI-Assisted-C64-asteroid-attack-version 0 --------------------------------------------------------------------------------------------------- TOOL: CHATGPT - ONLINE Language: Words, English Extra: none Author: Misel Zivanovic Note: (C) 17th of NOVEMBER 2026 - www.lived.ch, mzretro.ch Doc Revision: 1.0 Last update: 10:19 18.11.2026 --------------------------------------------------------------------------------------------------- TEXT for the ChatGPT: Use small characters for the source code. Commodore C64 native PAL mode. Text screen. All sprite are multicolor, except the sprite 2, bullet=mono color Sprite 1 = player = space ship Sprite 1 is at y=200. start x=rnd(1)*225+25 sprite 1 can be moved left and right with the cursor keys. Sprite 2 = bullet. bullet is just 1 bit small. Bullet speed = rnd(1)*3+1 Set bullet to off if y<0 to be ready for the next shot. When fire, bullet is turned on. bullet is starting slightly above the player. Sprite 3 until 8 are asteroids. Typical asteroid shapes. Asteroids are having different colors from 10 to 15. Asteroids are having different random initial speed. Example #1 or #3 Make asteroid sprites and put the definition in DATA statements. --------------------------------------------------------------------------------------------------- NOTE: It delivered just one error message, out of data. After I've added the line 1760 with 10 zero's, all was good! --------------------------------------------------------------------------------------------------- AI-GENERATED BASIC 2.0 SOURCE CODE: 10 rem *** asteroid shooter *** 20 poke 53280,0:poke 53281,0:poke 646,1 30 print chr$(147);" asteroid shooter" 40 print:print " cursor left/right to move" 50 print " space to fire" 60 rem sprite data at $2000 70 for i=0 to 7:poke 2040+i,128+i:next 80 for i=0 to 503:read a:poke 8192+i,a:next 90 dim x(8),y(8),s(8) 100 rem random seed 110 a=rnd(-ti) 120 rem player initialization 130 px=int(rnd(1)*225)+25 140 py=200 150 rem bullet initialization 160 bx=0:by=-1:bv=1 170 rem asteroid initialization 180 for i=3 to 8 190 x(i)=int(rnd(1)*232) 200 y(i)=int(rnd(1)*200) 210 s(i)=int(rnd(1)*3)+1 220 next i 230 rem multicolor configuration 240 poke 53276,253 250 poke 53282,2:poke 53283,5 260 rem sprite colors 270 poke 53287,7 280 poke 53288,1 290 for i=3 to 8 300 poke 53286+i, i+7 310 next i 320 rem enable player and asteroids 330 poke 53269,253 340 rem player position 350 poke 53248,px:poke 53249,py 360 rem main loop 370 get k$ 380 if k$=chr$(157) then px=px-3 390 if k$=chr$(29) then px=px+3 400 if px<20 then px=20 410 if px>250 then px=250 420 poke 53248,px 430 rem fire bullet 440 if k$=" " and by<0 then gosub 600 450 rem bullet movement 460 if by>=0 then gosub 650 470 rem asteroid movement 480 for i=3 to 8 490 y(i)=y(i)+s(i) 500 if y(i)>240 then y(i)=0 510 if y(i)=0 then x(i)=int(rnd(1)*232) 520 poke 53248+(i-1)*2,x(i) 530 poke 53249+(i-1)*2,y(i) 540 next i 550 goto 370 600 rem *** fire bullet *** 610 bx=px+10:by=188 620 bv=int(rnd(1)*3)+1 630 poke 53269,255 640 return 650 rem *** bullet movement *** 660 by=by-bv 670 if by<0 then by=-1:poke 53269,253:return 680 poke 53250,bx:poke 53251,by 690 return 1000 rem *** player spaceship *** 1010 data 0,48,0,0,252,0,3,255,0,15,255,192 1020 data 63,255,240,255,255,252,255,255,255 1030 data 10,170,160,2,170,128,0,170,0,0,40,0 1040 data 0,40,0,0,130,0,2,0,128,2,0,128 1050 data 8,0,32,8,0,32,32,0,8,0,0,0 1060 data 0,0,0,0,0,0,0,0,0 1100 rem *** monochrome bullet *** 1110 data 0,0,0,0,0,0,0,0,0,0,48,0 1120 data 0,48,0,0,48,0,0,48,0,0,48,0 1130 data 0,48,0,0,48,0,0,0,0,0,0,0 1140 data 0,0,0,0,0,0,0,0,0,0,0,0 1150 data 0,0,0,0,0,0,0,0,0,0,0,0 1160 data 0,0,0 1200 rem *** asteroid 1 *** 1210 data 0,84,0,5,125,64,23,255,80,95,255,212 1220 data 127,255,245,127,255,253,95,255,245,31,255,212 1230 data 7,255,212,1,255,80,0,85,64,1,85,80 1240 data 5,69,84,21,1,84,85,0,84,84,0,20 1250 data 20,0,16,4,0,0,0,0,0,0,0,0,0 1300 rem *** asteroid 2 *** 1310 data 1,84,0,5,253,64,23,255,80,95,255,245 1320 data 127,255,253,127,255,255,95,255,253,23,255,245 1330 data 23,255,212,5,255,80,1,85,64,5,85,80 1340 data 21,69,84,85,1,84,84,0,84,80,0,20 1350 data 80,0,4,16,0,0,0,0,0,0,0,0,0 1400 rem *** asteroid 3 *** 1410 data 0,21,0,1,95,80,5,255,212,23,255,245 1420 data 95,255,253,127,255,255,127,255,255,95,255,253 1430 data 95,255,212,23,255,80,5,85,64,21,85,80 1440 data 85,5,84,84,1,84,80,0,84,80,0,20 1450 data 16,0,16,0,0,0,0,0,0,0,0,0,0 1500 rem *** asteroid 4 *** 1510 data 21,84,0,95,245,0,127,255,80,255,255,244 1520 data 255,255,253,127,255,253,127,255,255,31,255,253 1530 data 5,255,253,1,127,245,0,85,84,1,85,85 1540 data 5,80,85,21,64,21,85,0,5,80,0,5 1550 data 64,0,1,0,0,0,0,0,0,0,0,0,0 1600 rem *** asteroid 5 *** 1610 data 1,84,0,21,245,64,95,255,208,127,255,244 1620 data 255,255,253,255,255,253,127,255,255,95,255,255 1630 data 23,255,255,23,255,245,5,85,84,21,85,85 1640 data 85,65,85,85,0,85,84,0,21,80,0,5 1650 data 64,0,1,0,0,0,0,0,0,0,0,0,0 1700 rem *** asteroid 6 *** 1710 data 5,85,0,23,253,64,95,255,208,127,255,244 1720 data 255,255,253,255,255,255,255,255,255,127,255,253 1730 data 95,255,253,95,255,212,21,85,80,85,85,84 1740 data 84,21,85,80,5,85,64,1,85,64,0,84 1750 data 64,0,20,0,0,0,0,0,0,0,0,0,0 1760 data 0,0,0,0,0,0,0,0,0,0 --------------------------------------------------------------------------------------------------- No doubt, C64 ChatGPT support for the C64 is given... It sure needs some additional corrections to make asteroids look like asteroids etc. But except the missing DATA line, this code just rolled... NICE!