Snake: Difference between revisions
→{{header|Craft Basic}}
Basicgames (talk | contribs) |
Basicgames (talk | contribs) |
||
Line 1,685:
dim sy[maxsize]
define fn (bounds) as sx[0] <=
define fn (collision) as sx[0] + 15 >= rx and sx[0] <= rx + 15 and sy[0] + 15 >= ry and sy[0] <= ry + 15
define fn (eatself) as sx[0] = sx[i] and sy[0] = sy[i]
Line 1,694:
title "Snake!"
resize 0, 0, gfxx +
center
fill on
bgcolor
cls
Line 1,706:
input "Enter game speed between 0 to 100+", speed
fgcolor 0, 80, 0
rect 0, 0, gfxx, gfxy
do
Line 1,801 ⟶ 1,804:
if (collision) = 1 then
fgcolor 0, 80, 0
rect 0, 0, gfxx, gfxy
let rx = ( int: (rnd) * ( gfxx - 24 ) ) + 12
Line 1,814 ⟶ 1,818:
oval rx, ry, 15, 15
fgcolor
fgcolor 255,255,0
|