The table does not show up… please help i am new
--# Main
supportedOrientations(LANDSCAPE_LEFT)
saveProjectInfo("Description", "Just a simple ball to bounce around.")
--use this function to perform your initial setup()
function setup()
xc=WIDTH/2
yc=HEIGHT/2
parameter.number("GravityScale", .25, 10, 3)
-- coding for balls
ball = physics.body(CIRCLE, 40)
ball.x = xc-200
ball.y = yc+300 ball.restitution = .75
ball.sleepingAllowed = false
ball2 = physics.body(CIRCLE, 30)
ball2.x = xc+200
ball2.y = yc+200
ball2.restitution = .75
ball2.sleepingAllowed = false
--draw a table
base=physics.body(POLYGON,vec2(xc-25,0),vec2(xc-25,yc),vec2(xc+25,yc),vec2(xc+25,0))
base.type=STATIC
mesa=physics.body(POLYGON,vec2(xc-300,yc),vec2(xc-300,yc+50),vec2(xc+300,yc+50),
vec2(xc+300,yc))
mesa.type=DYNAMIC
--ball bounces off wall
wall1 = physics.body(EDGE,vec2(0,0),vec2(0,HEIGHT))
wall2 = physics.body(EDGE,vec2(0,0),vec2(WIDTH,0))
wall3 = physics.body(EDGE,vec2 (WIDTH,0) ,vec2(WIDTH,HEIGHT))
wall4 = physics.body(EDGE,vec2(WIDTH,HEIGHT),vec2 (0,HEIGHT))
wall1.type = STATIC
wall2.type = STATIC
wall3.type = STATIC
wall4.type = STATIC
wall1.restitution = .1
wall2.restitution = .1
wall3.restitution = .1
wall4.restitution = .1
end
function drawpoints(body)
pushMatrix()
translate(body.x, body.y)
rotate(body.angle)
local points = body.points
local a, b
for j = 1,#points do
a = points[j]
b = points[(j % #Points)+1]
line(a.x, a.y, b.x, b.y)
end
popMatrix()
end
--this gets called every frame()
function draw()
physics.gravity(Gravity)
background(208, 153, 43, 111)
strokeWidth(5)
fill(113, 255, 0, 255)
stroke(27, 21, 21, 255)
ellipse(ball.x,ball.y,ball.radius*2)
ellipse(ball2.x,ball2.y,ball2.radius*2)
drawpoints (base)
drawpoints (mesa)
end