OLD SCHOOL CODING

 Paddle game for Commodore 128
Remember to replace "print "S"" with "print "(SHIFT+HOME)"" on 128 or emulator

10 gosub 1000
20 px=8*10:py=230
30 m=0
40 bx=100
50 by=70
60 color 0,1
70 color 4,12
80 print "S":print "miss:"
90 sy=5:sx=0
100 j=joy(1)
102 if j>8 then 900
103 px=px+jx(j)*ox(px+jx(j))
110 movspr 1,bx,by
120 movspr 2,px,py
200 by=by+sy:bx=bx+sx
210 if by<50 then sy=-sy*2
240 if bx>px-2 and bx<px+50 and by+15>py then sy=-sy:sx=5-(10*rnd(1)):goto 290
250 if by>230 then by=50:m=m+1:sx=0:bx=30+(200*rnd(1)):char 1,5,1,str$(m):sy=5
290 bx=bx+sx
300 if bx<30 then sx=-sx
310 if bx>320 then sx=-sx
320 goto 100
900 sprite 1,0
910 sprite 2,0
920 color 0,12
930 color 4,6
940 j=joy(1)
950 if j<>0 then 940
960 end
1000 rem create sprite
1010 graphic 1,1
1020 for i=0 to 5
1030 draw 1,0,i to 5,i
1040 next i
1050 sshape a$,0,0,23,21
1060 sprsav a$,1
1070 sprite 1,1,3,0,1,1,0
1080 movspr 1,100,100
1090 for i=0 to 5
1100 draw 1,0,i to 24,i
1110 next i
1120 sshape a$,0,0,23,21
1130 sprsav a$,2
1140 sprite 2,1,7,0,1,1,0
1150 movspr 2,100,100
1160 graphic 0
1170 print "S"
1180 print "initializing..."
1200 dim ox(400)
1210 dim jx(10)
1220 for a=0 to 400:ox(a)=-1:next a
1230 for a=32 to 295:ox(a)=1:next a
1240 jx(3)=8
1250 jx(7)=-8
1260 return

Comments