practice/love/mike/main.lua

29 lines
589 B
Lua
Raw Normal View History

require "lib/keys"
require "lib/functions"
2017-07-05 07:11:51 -07:00
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 the player data
player = {}
player.x = screen.width /2
player.y = screen.height - 50
2017-07-05 07:11:51 -07:00
player.width = 25
player.height = 5
player.speed = 5
end
function love.update(dt)
player = check_keys(player)
end
function love.draw()
love.graphics.rectangle("line", player.x, player.y, player.width, player.height)
end