dosember-jam-2025/game/main.lua

51 lines
1.3 KiB
Lua

if love.system.getOS() ~= 'DOS' then
local lick = require "3rd.lick"
lick.updateAllFiles = true
end
local platform = require "platform.platform"
local ttf
local bf
local hamsterMouse
local function drawText(str, x, y)
local font = love.graphics.getFont()
love.graphics.print(str, x - font:getWidth(str) / 2, y - font:getHeight() / 2)
end
function love.load()
platform.init()
ttf = love.graphics.newFont()
bf = love.graphics.newImageFont("font.png",
" abcdefghijklmnopqrstuvwxyz" ..
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0" ..
"123456789.,!?-+/():;%&`'*#=[]\"")
if love.system.getOS() == 'DOS' then
hamsterMouse = love.graphics.newImage("hammouse.gif")
else
hamsterMouse = love.graphics.newImage("hammouse.png")
end
end
function love.draw()
platform.drawStart()
love.graphics.clear()
love.graphics.setFont(ttf)
drawText('Hellorld!', 160, 100)
love.graphics.setFont(bf)
love.graphics.print(" abcdefghijklmnopqrstuvwxyz", 0, 110)
love.graphics.print("ABCDEFGHIJKLMNOPQRSTUVWXYZ0", 0, 130)
love.graphics.print("123456789.,!?-+/():;%&`'*#=[]\"", 0, 150)
love.graphics.draw(hamsterMouse, love.mouse.getX(), love.mouse.getY())
platform.drawEnd()
end
function love.keypressed(key)
if key == "escape" then
os.exit()
end
end