require "lib/keys" require "lib/functions" function love.load() saveFile = "test.lua" -- Create a table and grab the screen width/height screen = {} screen.width = love.graphics.getWidth() screen.height = love.graphics.getHeight() -- Create a table to hold all actors actors = {} -- Create a table to hold all the player data actors.player = create_object(screen.width /2, screen.height - 50, 30, 5, 500) -- Create a table to hold ball data actors.ball = create_object(screen.width /2, screen.height /2, 1, 1, 600) actors.ball.x_speed = (actors.ball.speed /2) actors.ball.y_speed = (actors.ball.speed /2) end function love.update(dt) actors.player = check_keys(actors.player, screen, dt) actors.ball = ball_bounce(actors.player, actors.ball, dt) end function love.draw() --Draw paddle love.graphics.rectangle("line", actors.player.x, actors.player.y, actors.player.width, actors.player.height) --Draw ball love.graphics.rectangle("line", actors.ball.x, actors.ball.y, actors.ball.width, actors.ball.height) --FPS counter love.graphics.print("FPS: "..tostring(love.timer.getFPS( )), 10, 10) end