Breakout
This time a minimalist version of the well-known game Breakout. I set myself the goal to see whether it is possible to make this in a maximum of ten lines Commodore Basic. Of course, it will not be a full version just a nice try. I wanted to have several minimal game elements in it such as:
Coloured bars
A bouncing ball
A paddle to bounce the ball
Something for keeping score
It is precisely with these components that I have built up the program step by step.
Here in this comment the shortened version with to 10 (oops still 11) lines.
Although I do get to 10 lines if I were to use the PetscII characters,
but I haven't used them here to keep typing and readability simple.
To move the paddle the key "1" (left) and "2) right can be used.
Long version of the basic program with the comments can be found here on my blog page
http://justforthefunofit.nl/uncategor...
note: You need to replace the "[" and "]" characters in the code below by
the greater than and smaller than key as YouTube won't allow these characters in the
comment.
1 ?chr$(147):pO53280,0:pO53281,0:pp=17:pO650,128:sa=1024+(22*40):sm=1024:dx=1
2 x=int(rnd(1)*24):y=12:dy=1:c$=chr$(28)+chr$(149)+chr$(158)+chr$(30)+chr$(31)
3?:forp=1to5:forn=1to8:?chr$(18)+mid$(c$,p,1)+chr$(229)+" "+chr$(234);:nE:nE
4 sp=sa+pp:pOsp,32:pOsp+1,98:pOsp+2,98:pOsp+3,98:pOsp+4,98:pOsp+5,32
5 getk:pp=pp+(k=1)-(k=2):ifpp[-1thenpp=-1
6 ifpp]35thenpp=35
7 pokesm+x+(y*40),32:ify]=24ory[1thendy=-dy:ify]=24then ms=ms+1
8 ifx]=39orx[1thendx=-dx
9 mc=-1:ifk=1tHmc=-mc
10 x=x+dx:y=y+dy:ifpE(sm+x+(y*40))=98tHdx=-dx*mc:dy=-dy:l=l+1:x=pp
11 poke sm+x+(y*40),81:print chr$(19)"hit:";l;" missed:";ms:goto4
On this page of the site you can watch the video online Commodore 64 Basic - Breakout with a duration of hours minute second in good quality, which was uploaded by the user Just for the Fun of It – Commodore Retro & BASIC 15 April 2022, share the link with friends and acquaintances, this video has already been watched 1,546 times on youtube and it was liked by 39 viewers. Enjoy your viewing!