Author Topic: BASIC Tenliners 2016  (Read 10670 times)

B+

  • Guest
re: Ten Liners Winners
« Reply #15 on: April 09, 2016, 03:32:05 PM »
Hi Richey,

Which was your favorite 10 liner?

For me, they won't show code, I suppose I'd have to join but first I'd have to learn to speak the language...

Anyway, for 10 lines, you'd think they'd have room to show the code unless not(?) public code.

IF NOT public code, THEN NOT really in spirit of BASIC.
« Last Edit: April 09, 2016, 03:36:48 PM by B+ »

Mr SQL

  • Guest
Re: BASIC Tenliners 2016
« Reply #16 on: April 09, 2016, 08:04:21 PM »
The promoters show screenshots with code links you can run in the respective emulators:
http://gkanold.wix.com/homeputerium#!games-list-2016/c1jdt

My entry was 9LineBlitz for the Atari 2600 written in Virtual World Tiny BASIC, here's the 9 lines of code to discuss; placed pretty well, maybe could have placed higher if I used that extra line :) Was fun to compete like bitd!

0 data city 1,4,2,5,3,2,3,1,4,1,1,1,5,2,2,3,1,4,1,4,3,1,4,4,1,1,2,2,3,1,3,4,5,4,4,3,4,5,1,2,4,1,5,2,2,3,1,3,1,1,4,1
1 if g=0 then for j=0 to 7:player1(j)=189:player0(j)=pl(j):next j:BYTErowoffset=120:COLUPF=$84:COLUP0=$b4 else goto 3
2 for j=20 to 71:k=j-20:k=city(k)+14:for i=k to 19:vwpixel(j,i,on):next i,j:player0y=88:player0x=94:COLUP1=$74:y=20
3 COLUBK=0:AUDV0=0:g=1:scrollvirtualworldtoggle=1:BITIndex=BITIndex+1:data pl 0,224,127,231,252,192,128,0:rem bitmap
4 if joy0fire=1 and y>=20 then AUDF0=6:AUDC0=8:AUDV0=15:x=BITIndex+11:y=11:i=88-player0y:i=i/10:y=y+i
5 if y<21 then vwpixel(x,y,bindplayer1):j=y-10:y=y+1:COLUP1=M(j):data M $64,$54,$b4,$a4,$32,$44,$24,$c4,$94,$f4,$54
6 if y<=19 and vwpixel(x,y,poll)>0 then vwpixel(x,y,flip):player1x=0:player1y=0:AUDC0=y:y=20:AUDF0=4:AUDV0=15
7 if BITIndex>71 then BITIndex=0:player0y=player0y-2:rem player flies lower each pass over the smoothly scrolling city
8 if CXP0FB>126 then CXCLR=0:g=0:for i=0 to 255:AUDF0=i:AUDV0=i:COLUBK=$34:next i:rem check collision, restart game


Here's what's going on in the BASIC:

Lines 1 and 2 are setup routines and use a couple of for next loops to draw a city on the large virtual world and to load a player sprite with a bitmap, reading the data from named arrays.

The rest of the program uses the blitter commands and objects surfaced to the BASIC to smoothly scroll the virtual world at 30 frames per second of full screen animation while floating the player sprite and tile mapping it's flashing disco missiles by binding them to the scrolling background at 30 FPS while they are falling at a slower speed with the Y axis unbound (but also 30 FPS) for a neat visual effect; these are all features of the soft blitter chip in the runtime (tile mapping, flipping and sliding the entire display around while all of the sprites and playfield graphics are also moving relative to themselves).
 

Richly

  • Guest
Re: re: Ten Liners Winners
« Reply #17 on: April 10, 2016, 01:00:39 PM »
Hi Richey,

Which was your favorite 10 liner?

For me, they won't show code, I suppose I'd have to join but first I'd have to learn to speak the language...

Anyway, for 10 lines, you'd think they'd have room to show the code unless not(?) public code.

IF NOT public code, THEN NOT really in spirit of BASIC.

Ah well, I'm biased towards the Spectrum entries  :) but I was pretty taken with the ZX81 entry too.

You can download the listings via Dropbox, although you will have to create an account if you don't have one.

B+

  • Guest
Re: BASIC Tenliners 2016
« Reply #18 on: April 11, 2016, 06:52:59 PM »
Thanks Mr SQL and Richey!

Mr SQL, your code example is eye opener for me. Many questions but one mainly $number is... ???

I hope not one person tells those guys that their code and screen shots would be most welcome here, by me at least, because I know those guys don't like to show off or anything like that!  ;)

Mr SQL

  • Guest
Re: BASIC Tenliners 2016
« Reply #19 on: April 12, 2016, 08:07:36 AM »
Thanks Mr SQL and Richey!

Mr SQL, your code example is eye opener for me. Many questions but one mainly $number is... ???

I hope not one person tells those guys that their code and screen shots would be most welcome here, by me at least, because I know those guys don't like to show off or anything like that!  ;)
;D Mostly the C64 programmers are talking about it on Lemon and the Atari programmers on AtariAge, not sure where the ZX81 and speccy programmers forums are, doubtless some pretty cool programming discussions there too! 

I will tell them about the Retrogamecoding and Basicprogramming forum, great place for us all to discuss! :)

The $ is a hexadecimal prefix, $FF like &HFF. I used it for color assignments because the NTSC color chart I referenced didn't show decimal, I prefer decimal.

I had initially used a binary prefix %10111101 instead of 189 to draw the disco missile (you can see the pattern in the pic) and for the bitmap for the ship, but converted them to decimal to meet the contests line length limits.

Mr SQL

  • Guest
Re: BASIC Tenliners 2016
« Reply #20 on: April 18, 2016, 12:22:42 PM »
There's an awesome video of the Atari BASIC game entries here with great commentary, hope to see vids for the TRS-80 and other systems:

https://www.youtube.com/watch?v=Ke7WZXwg6_M

These 10 line homebrews are amazing to see in action and perform like machine language games thanks to the advanced graphics and sound accelerator chips in the Atari 8-bit computers.