-- PICO-8 Cartridge
lua
-- Initialization function
function _init()
player_x = 64
player_y = 64
end
-- Update function
function _update()
if btn(0) then
player_x = player_x - 5
elseif btn(1) then
player_x = player_x + 2
end
end
-- Draw function
function _draw()
cls() -- Clear the screen
-- Draw the player as a filled rectangle
rect(player_x, player_y, player_x + 8, player_y + 8, 7)
end
[Please log in to post a comment]