
-----------------------------------
stinger4life
Wed Jan 11, 2006 6:14 pm

Help with snake game project
-----------------------------------
Hey guys...like many others before me :) lol i have decided to make a snake game.  I have the basic stuff down for it like controls and whatnot but whenever i go over a piece of food it doesnt recognize it.  Can someone help me out?

setscreen ("graphics:v16")
var foodx,foody,score,winID : int := 0
var x , y : int := 30
var font1 : int := Font.New ("serif:45")
var font2 : int := Font.New ("serif:12:bold")
var chars: array char of boolean
var tailX, tailY : flexible array 0 .. 1 of int
    tailX (1) := 0
    tailY (1) := 0
    winID := Window.Open ("graphics")
    drawfillbox(0,0,maxx,maxy,black)%Background
    drawfillbox(10,10,629,345,brown)%Border Color
    drawfillbox(15,15,624,340,green)%Playing Field color
    Font.Draw("Snake v4.0.4c" , 150 , 353 , font1 , red)
    Font.Draw("Score: " , 10 , 353 , font2 , red)
    for i : 0 .. 6400
        randint (foodx, 5 + 5, 618 - 5 - 5)
        randint (foody, 5 + 5, 334 - 5 - 5)    
        loop
            Input.KeyDown (chars)
                if chars (KEY_UP_ARROW) then
                    if y = 21 then
                        y := y - 1
                    end if
                end if                 
            drawfilloval(x, y, 5, 5,white)
            delay(5)
            drawfilloval(x, y, 5, 5,green)
            Draw.FillOval (foodx div 10 * 10, foody div 10 * 10, 5, 5, brightred)
            if x >= maxx - 20 or x = 355 - 20 or y = maxx - 25 or x = 355 - 25 or y 