Snake: Difference between revisions
Content deleted Content added
Basicgames (talk | contribs) |
Basicgames (talk | contribs) |
||
Line 1,685: | Line 1,685: | ||
dim sy[maxsize] |
dim sy[maxsize] |
||
define fn (bounds) as sx[0] <= |
define fn (bounds) as sx[0] <= -10 or sx[0] >= gfxx or sy[0] <= -10 or sy[0] >= gfxy |
||
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 (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] |
define fn (eatself) as sx[0] = sx[i] and sy[0] = sy[i] |
||
Line 1,694: | Line 1,694: | ||
title "Snake!" |
title "Snake!" |
||
resize 0, 0, gfxx + |
resize 0, 0, gfxx + 10, gfxy + 56 |
||
center |
center |
||
fill on |
fill on |
||
bgcolor |
bgcolor 128, 64, 0 |
||
cls |
cls |
||
Line 1,706: | Line 1,706: | ||
input "Enter game speed between 0 to 100+", speed |
input "Enter game speed between 0 to 100+", speed |
||
fgcolor 0, 80, 0 |
|||
rect 0, 0, gfxx, gfxy |
|||
do |
do |
||
Line 1,801: | Line 1,804: | ||
if (collision) = 1 then |
if (collision) = 1 then |
||
fgcolor 0, 80, 0 |
|||
cls |
|||
rect 0, 0, gfxx, gfxy |
|||
let rx = ( int: (rnd) * ( gfxx - 24 ) ) + 12 |
let rx = ( int: (rnd) * ( gfxx - 24 ) ) + 12 |
||
Line 1,814: | Line 1,818: | ||
oval rx, ry, 15, 15 |
oval rx, ry, 15, 15 |
||
fgcolor |
fgcolor 255, 0, 0 |
||
oval rx + 5, ry + 5, 3, 3 |
|||
oval rx + 9, ry + 5, 3, 3 |
|||
fgcolor 255,255,0 |
fgcolor 255,255,0 |