Skip to content

Instantly share code, notes, and snippets.

@tomaes
Created May 11, 2014 18:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaes/90f64f8878c07fb7933a to your computer and use it in GitHub Desktop.
Save tomaes/90f64f8878c07fb7933a to your computer and use it in GitHub Desktop.
1/2 a frogger (c64); 165 bytes for some stylish, minimal gaming action.
0 s=53248:x=8:pokes+21,1:pokes,x:pokes+1,120:pokes+39,2
5 printspc(int(rnd(1)*5)*6+4)"{yellow}{110}{green}{109}":r=r+1
8 geta$:x=x+(a$="{left}")*8-(a$="{right}")*8:pokes,x:ifx<248and(peek(s+31)andr>20)=.goto5
9 print"score:"x*8-r*2
@tomaes
Copy link
Author

tomaes commented Jun 24, 2020

improved/faster & copy-paste friendly (no control codes):

0 s=53248:x=8:q=248:z$=chr$(158)+chr$(110)+chr$(30)+chr$(109)
2 pokes+21,1:pokes,x:pokes+1,120:pokes+39,2:l$=chr$(157):r$=chr$(29)
5 printspc(int(rnd(1)*5)*6+4)z$:r=r+1:geta$:x=x+(a$=l$)*8-(a$=r$)*8
8 pokes,x:ifx<qandx>.and(peek(s+31)andr>20)=.then5
9 print"score:"x*8-r*2"frames:"r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment