Heres a simple snippet on how to do something similar to a nokia snake game, but have the snake fade out. Check the screenshot for more info.
I know the code is unoptimized(like using alot of if's when a select statement would be much easier), but thats really just for easier readability for me.
Here is the code.
(Arrowkeys move the snake)
sync on
sync rate 30
type pos
x
y
endtype
dim grid(64,48)
dim bodypos(255) as pos
length=255
position as string
position="r"
do
cls
if scancode()<>0
if upkey()=1
position="u"
endif
if downkey()=1
position="d"
endif
if rightkey()=1
position="r"
endif
if leftkey()=1
position="l"
endif
for i=1 to 254
p=256-i
bodypos(p).x=bodypos(p-1).x
bodypos(p).y=bodypos(p-1).y
next i
if position="r"
inc bodypos(1).x
endif
if position="l"
dec bodypos(1).x
endif
if position="u"
dec bodypos(1).y
endif
if position="d"
inc bodypos(1).y
endif
endif
for i=1 to length
box bodypos(i).x*10,bodypos(i).y*10,bodypos(i).x*10+10,bodypos(i).y*10+10,rgb(256-i,256-i,0),rgb(256-i,256-i,0),rgb(256-i,256-i,0),rgb(256-i,256-i,0)
if i=1
if position="u"
box bodypos(i).x*10,bodypos(i).y*10,bodypos(i).x*10+10,bodypos(i).y*10+10,rgb(256-i,256-i,0),rgb(256-i,0,0),rgb(256-i,256-i,0),rgb(256-i,0,0)
endif
if position="d"
box bodypos(i).x*10,bodypos(i).y*10,bodypos(i).x*10+10,bodypos(i).y*10+10,rgb(256-i,0,0),rgb(256-i,256-i,0),rgb(256-i,0,0),rgb(256-i,256-i,0)
endif
if position="l"
box bodypos(i).x*10,bodypos(i).y*10,bodypos(i).x*10+10,bodypos(i).y*10+10,rgb(256-i,0,0),rgb(256-i,0,0),rgb(256-i,256-i,0),rgb(256-i,256-i,0)
endif
if position="r"
box bodypos(i).x*10,bodypos(i).y*10,bodypos(i).x*10+10,bodypos(i).y*10+10,rgb(256-i,256-i,0),rgb(256-i,256-i,0),rgb(256-i,0,0),rgb(256-i,0,0)
endif
endif
next i
sync
loop