Hi,
Another fun here.
screen(640,590,0,"Snake Ghost")
setframetimer(200)
backcolor(0,0,255)
colorkey(0,0,0)
snk=loadimage("snake/friend.png")
pln=loadimage("snake/plant.png")
function Snake()
sprite(snk,x[1],y[1],64,64,0)
sprite(snk,x[2],y[2],64,64,0)
sprite(snk,x[3],y[3],64,64,0)
sprite(snk,x[4],y[4],64,64,0)
end
repeat
k=getkey()
cls()
for i=1,4 do
if z[i]==0 then
x[i]=x[i]+1
end
if x[i] >=640-64 then
z[i]=1
end
end
for i=1,4 do
if z[i]==1 then
y[i]=y[i]+1
t[i]=t[i]+1
if t[i]==40 then
t[i]=0
z[i]=2
end
end
end
for i=1,4 do
if z[i]==2 then
x[i]=x[i]+1*(-1)
if x[i] <=0 then
z[i]=3
end
end
end
for i=1,4 do
if z[i]==3 then
y[i]=y[i]+1
t[i]=t[i]+1
if t[i]==40 then
t[i]=0
z[i]=0
end
if y[i]>=screenheight()-64 then
z[i]=4
end
end
Snake()
sprite(pln,0,0,640,590,0)
redraw()
until k==27
CloseWindow()