rem smartbranching on dim planepos=a dim turndelay=b dim planeframe=c dim movedelay=d planepos = 4 turndelay = 0 : movedelay = 0; player0x = 40 : player0y = 40 startLoop turndelay = turndelay + 1 if turndelay < 10 goto notChangingFrame turndelay = 0 if joy0left then planepos = planepos - 1 if joy0right then planepos = planepos + 1 if planepos = 255 then planepos = 15 if planepos = 16 then planepos = 0 score = planepos gosub pickPlaneFrame notChangingFrame movedelay = movedelay + 1 if movedelay < 5 goto notMovingNow movedelay = 0 player0x = player0x + speedvalX[planepos] player0y = player0y + speedvalY[planepos] notMovingNow COLUP0 = $04 drawscreen goto startLoop pickPlaneFrame planeframe = 0 if planepos < 9 then planeframe = planepos : REFP0 = 0 if planepos > 9 then planeframe = 16 - planepos : REFP0 = 8 on planeframe goto 5 10 20 30 40 50 60 70 80 5 player0: %01010100 %00111000 %00010000 %00010000 %00010000 %00010000 %00010000 %00010000 end goto doneSetFrame 10 player0: %00100000 %00101000 %01011000 %00110000 %00001000 %00001000 %00000100 %00000100 end goto doneSetFrame 20 player0: %00010000 %01010000 %00100000 %11010000 %00001000 %00000100 %00000010 %00000000 end goto doneSetFrame 30 player0: %00000000 %00100000 %01010000 %00110000 %01101100 %00000010 %00000000 %00000000 end goto doneSetFrame 40 player0: %00000000 %00000000 %01000000 %00100000 %01111110 %00100000 %01000000 %00000000 end goto doneSetFrame 50 player0: %00000000 %00000000 %00000010 %01101100 %00110000 %01010000 %00100000 %00000000 end goto doneSetFrame 60 player0: %00000000 %00000010 %00000100 %00001000 %11010000 %00100000 %01010000 %00010000 end goto doneSetFrame 70 player0: %00000100 %00000100 %00001000 %00001000 %00110000 %01011000 %00101000 %00100000 end goto doneSetFrame 80 player0: %00010000 %00010000 %00010000 %00010000 %00010000 %00010000 %00111000 %01010100 end doneSetFrame return data speedvalX 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1 end data speedvalY -2, -2, -2, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2 end rem -2, -2, -1, -1, 0, 1, 1, 2, 2, 2, 1, 1, 0, -1, -1, -2 rem 0, 1, 1, 2, 2, 2, 1, 1, 0, -1, -1, -2, -2, -2, -1, -1