I really need help. I'm trying to make a game for a game jam that ends tomorrow and I need to have a counter for how much money you have. However, I have followed tons of tutorials, and nothing is working! I'm not getting any error messages, I just can't see any text. I'll give you my code here:
import "CoreLibs/graphics"
import "CoreLibs/object"
import "CoreLibs/sprites"
import "CoreLibs/nineslice"
import "CoreLibs/timer"
import "CoreLibs/graphics"
import "CoreLibs/ui"
import "CoreLibs/animation"
import "CoreLibs/animator"
import "CoreLibs/crank"
import "config"
import "core/definitions"
import "core/cotton/all"
import "scripts/index"
import "core/lieb/all"
import "core/CoreGame"
money = 20
billValue = 20
managers = 0
printers = 1
local gfx <const> = playdate.graphics
playdate.display.setRefreshRate(30)
playdate.ui.crankIndicator:start()
playdate.display.setScale(config.renderScale)
LDtk.load("levels/world.ldtk", shouldUseFastLoader())
if playdate.isSimulator then
LDtk.export_to_lua_files()
end
local myInputHandlers = {
cranked = function(change, acceleratedChange)
-- use the printer
if acceleratedChange >= 50 then
print("test")
end
end,
}
scene.set(game, LDtk.playerStartLocation)
function playdate.update()
input.update()
scene.update()
if config.showFPS then
playdate.drawFPS()
end
if playdate.isCrankDocked() == true then
playdate.ui.crankIndicator:update()
end
playdate.timer.updateTimers()
playdate.inputHandlers.push(myInputHandlers)
gfx.sprite.update()
end
local menu = playdate.getSystemMenu()
local menuItem, error = menu:addMenuItem("Upgrades", function()
-- nothing for now
end
gfx.drawText("Money: " .. money, 200, 240)