You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.
Hello I tried to port my Pico-8 to LÖVE2D. But I discover some issues. Hope this helps someone in the future :). Thanks for this great project 👍
Not loading the p8 file.
The program only loads fine if I use the png format exported with pico.
Ex: game.p8.png. Using the p8 file throws problems if the name is different
from nogame.p8
I have to force the filename in main.lua
line 120.
filename="test.p8.png"
This will solve the issue regarding loading the p8 file in a fused game. Needed for exporting to Android or iOS.
Missing time()
The time() function is missing.
I have to add the function in api.lua
line 32.
functionapi.time()
returnlove.timer.getTime()
end
Only Android
The Löve engine support iOS too. But the code here only checks for Android when drawing the touch buttons.
in main.lua function love.load(argv).
I think the variable should be named something like mobile but for now this will do the trick.
For changing the touch controls you need to change 2 functions. It will be helpful if the buttons and their areas were defined in a single place and not twice.
Button Reference
Left = 0
Right = 1
Up = 2
Down = 3
A = 4
B = 5
-- Compares touch position with button position and area-- returns true if touch position is inside button area.--- (touch position x, touch position y, button position x, -- button position y, button width, button height)functioninside(x, y, x0, y0, w, h)
-- handles the touch position, call "inside" function with -- touch position and button area params-- this function is used in this code block--[[if not btn and android and p==0 then for _, id in pairs(touches) do btn=touchcheck(i, love.touch.getPosition(id)) if btn then break end end]]---- (button pressed, touch position x, touch position y)localfunctiontouchcheck(i, x, y)
The buttons are drawed near line 441.
In this code block
It's useful having a variable with the player touch buttons so these values can be easily modified if the game need it.
Missing Colors
Peach color (15) does not render. I created a test file for trying the colors associated with sprites.
The rough solution was changing this colors for another unused color in pico and then
change the color the unused color position with the peach values {255,204,170,255} in the palette={} table (line 5).
Crash on Mute Sound
If you mute the music on _init() it will crash. Because there is no sound before.
It can be fixed in the api.lua line 454.
Hello I tried to port my Pico-8 to LÖVE2D. But I discover some issues. Hope this helps someone in the future :). Thanks for this great project 👍
Not loading the p8 file.
The program only loads fine if I use the
png
format exported with pico.Ex:
game.p8.png
. Using the p8 file throws problems if the name is differentfrom
nogame.p8
I have to force the filename in
main.lua
line 120.
This will solve the issue regarding loading the p8 file in a fused game. Needed for exporting to Android or iOS.
Missing time()
The
time()
function is missing.I have to add the function in
api.lua
line 32.
Only Android
The Löve engine support iOS too. But the code here only checks for Android when drawing the touch buttons.
in
main.lua
functionlove.load(argv)
.I think the variable should be named something like
mobile
but for now this will do the trick.Enable Full Screen
For Mobile phones you need to hide the status bar or will collide with the game interface. This is done in
conf.lua
addingEasier Touch Controls
For changing the touch controls you need to change 2 functions. It will be helpful if the buttons and their areas were defined in a single place and not twice.
Button Reference
The buttons are drawed near line 441.
In this code block
It's useful having a variable with the player touch buttons so these values can be easily modified if the game need it.
Missing Colors
Peach color (15) does not render. I created a test file for trying the colors associated with sprites.
The rough solution was changing this colors for another unused color in pico and then
change the color the unused color position with the peach values
{255,204,170,255}
in thepalette={}
table (line 5).Crash on Mute Sound
If you mute the music on
_init()
it will crash. Because there is no sound before.It can be fixed in the
api.lua
line 454.change
to
this code adds additional checks and it will not crash when muting the music if no music was playing previously.
Test Game
This is a simple game made for testing the issues that I found.
The text was updated successfully, but these errors were encountered: