UP, RIGHT, DOWN, LEFT = 1, 2, 3, 4
UpdateTime=0.200
Timer = 0
GridSize = 30
GridWidth, GridHeight = 20, 10

local directions = {
	[UP] = 	  {x= 0, y=-1},
	[RIGHT] = {x= 1, y= 0},
	[DOWN] =  {x= 0, y= 1},
	[LEFT] =  {x=-1, y= 0},
}

local function isPositionInBody(x, y)
	for i = 1, #Body-3, 2 do