Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / 20 Line Snake!!!

Author
Message
AnalSauceMonkey
20
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 9th Dec 2002 03:54
This is my first snake game!

AnalSauceMonkey
20
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 9th Dec 2002 03:57
it took out the <>s. here it goes again:

set display mode 400,300,32:hide mouse:sync on:sync rate 0
begin:
x=4:y=4:xx=1:yy=0:l=10:z=0:c=0
dim a(500):dim b(500):ink rgb(0,0,200),0:for x=0 to 2:for y=0 to 2
line x,y,x+396,y:line x,y,x,y+297:line x,y+297,x+396,y+297:line x+396,y,x+396,y+297:next x
next y:gosub make_dot:do:if rightkey():xx=1:yy=0:endif:if leftkey():xx=-1:yy=0:endif
if upkey():yy=-1:xx=0:endif:if downkey():yy=1:xx=0:endif:z=z+1:if z>l then z=1
a(z)=x:b(z)=y:x=x+xx*3:y=y+yy*3
if point(x,y):if rgbb(point(x,y))=200 or rgbg(point(x,y))=200:goto die:endif:if rgbg(point(x,y))=100 then gosub make_dot
endif:ink rgb(0,200,0),0:box x,y,x+2,y+2:ink 0,0:if a(z+1)<>0 and b(z+1)<>0 then box a(z+1),b(z+1),a(z+1)+2,b(z+1)+2
if z=l:box a(1),b(1),a(1)+2,b(1)+2:endif:sync:loop
make_dot:
l=l+10:ink rgb(200,100,0),0
redo:
ex=rnd(128)*3+3:ey=rnd(95)*3+3:if point(ex,ey) or ex=x and ey=y:goto redo:endif
ink rgb(200,100,0),0:box ex,ey,ex+2,ey+2:return
die:
cls:ink rgb(200,0,0),0:set text font "Space Toaster":set text size 50:center text 200,100,"Score:"+str$((l-20)/10)
ink rgb(100,0,0),0:center text 200,180,"Try Again?"
do:if inkey$()="y":cls:goto begin:endif:if inkey$()="n":end:endif:sync:loop
Benny
19
Years of Service
User Offline
Joined: 7th Dec 2002
Location: United Kingdom
Posted: 17th Dec 2002 16:05
very nice but:

if i were you i'd change this to:
Benny
19
Years of Service
User Offline
Joined: 7th Dec 2002
Location: United Kingdom
Posted: 17th Dec 2002 16:06
this makes it easier to control cause otherwise it's too fast to control

Login to post a reply

Server time is: 2022-12-06 10:13:04
Your offset time is: 2022-12-06 10:13:04