practice/love/mike/main.lua

39 lines
994 B
Lua
Raw Permalink Normal View History

require "lib/keys"
require "lib/functions"
require "levels/gamestates"
2017-07-05 07:11:51 -07:00
function love.load()
-- 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 = {}
2017-07-05 07:11:51 -07:00
-- 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
2017-07-25 22:19:56 -07:00
actors.ball = create_object(screen.width /2, screen.height /2, 5, 5, 600)
actors.ball.x_speed = (-actors.ball.speed /2)
actors.ball.y_speed = (-actors.ball.speed /2)
actors.ball.score = 0
2017-08-10 10:59:40 -07:00
-- Timer vars (see keys.lua for loaded timer vars)
2017-07-25 22:19:56 -07:00
actors.start = love.timer.getTime()
2017-08-10 10:16:18 -07:00
actors.end_timer = 0
-- Set the starting screen
gamestate = {}
gamestate.draw = Gamestates.title_draw
gamestate.update = Gamestates.title_update
2017-07-05 07:11:51 -07:00
end
function love.update(dt)
gamestate.update(dt)
2017-07-05 07:11:51 -07:00
end
2017-07-16 13:15:47 -07:00
2017-07-05 07:11:51 -07:00
function love.draw()
gamestate.draw()
2017-07-05 07:11:51 -07:00
end