Homebrew [Release] - LövePotion - LÖVE API for 3DS Homebrew - BETA

joshjosh100

Member
Newcomer
Joined
Oct 11, 2015
Messages
24
Trophies
0
Age
26
XP
77
Country
United States
so i fixed the problem( my portlibs were inside a folder in the libctru when i installed them through the command line), but then another problem popped up

C:\Users\joshjosh100\Desktop\rit_lua_player_fighting_game\lpp-3ds-master\LovePot
ion-master\LovePotion-master>make
linking LovePotion-master.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-e
abi/bin/ld.exe: cannot find -lpng
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/c/Users/joshjosh100/Desktop/rit_lua_player_fighting_game/lpp-3ds-
master/LovePotion-master/LovePotion-master/LovePotion-master.elf] Error 1
make: *** [build] Error 2

its not letting me build the .elf,.3dsx, or the smdh any idea what "-lpng" is?
 
Last edited by joshjosh100,

VideahGams

Well-Known Member
OP
Newcomer
Joined
Aug 29, 2015
Messages
91
Trophies
0
Age
25
Location
Glasgow, Scotland
Website
videah.xyz
XP
146
Country
so i fixed the problem( my portlibs were inside a folder in the libctru when i installed them through the command line), but then another problem popped up

C:\Users\joshjosh100\Desktop\rit_lua_player_fighting_game\lpp-3ds-master\LovePot
ion-master\LovePotion-master>make
linking LovePotion-master.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-e
abi/bin/ld.exe: cannot find -lpng
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/c/Users/joshjosh100/Desktop/rit_lua_player_fighting_game/lpp-3ds-
master/LovePotion-master/LovePotion-master/LovePotion-master.elf] Error 1
make: *** [build] Error 2

its not letting me build the .elf,.3dsx, or the smdh any idea what "-lpng" is?

libpng
 

VideahGams

Well-Known Member
OP
Newcomer
Joined
Aug 29, 2015
Messages
91
Trophies
0
Age
25
Location
Glasgow, Scotland
Website
videah.xyz
XP
146
Country
Is it possible or will it be possible to make a game spanning across both the top and bottom screens?

You can already do that.
Setting the screen applies to the draw calls following it, until you change it again.

for example:
Code:
function love.draw()

	love.graphics.setScreen("top")
	love.graphics.print("This will draw on the top screen!", 0, 0)

	love.graphics.setScreen("bottom")
	love.graphics.print("This will draw on the bot screen!", 0, 0)
	love.graphics.print("This is still on the bot screen!", 0, 20)

	love.graphics.setScreen("top")
	love.graphics.print("Now back to top!", 0, 20)
	
end


Gives us this:
ULFQiUI.png
 

CKlidify

Well-Known Member
Newcomer
Joined
May 31, 2015
Messages
70
Trophies
0
XP
208
Country
Canada
Ah, well you can just handle the drawing of that yourself for now using tricks, but I'll think about adding it as an option somehow.
I'm not super experienced with lua so I think I'll wait for you to add that feature before I work on that project :P
 

Jwiz33

Banned
Joined
Jun 5, 2014
Messages
2,654
Trophies
0
Location
in the illuminati headquar—I have said too much!
Website
iwillcleanyourbasement.webstarts.com
XP
1,492
Country
United States
I am a noob in Love, but I want to start learning it(I know bits of LUA)
First of all, I found this sample code on an online tutorial, what would I do to make it run on a 3DS? I get a black screen when running it currently.
Code:
function love.load()
hero = {} -- new table for the hero
hero.x = 300    -- x,y coordinates of the hero
hero.y = 450
hero.speed = 100
end

function love.update(dt)
if love.keyboard.isDown("left") then
   hero.x = hero.x - hero.speed*dt
elseif love.keyboard.isDown("right") then
   hero.x = hero.x + hero.speed*dt
end
end

function love.draw()
-- let's draw some ground
love.graphics.setColor(0,255,0,255)
love.graphics.rectangle("fill", 0,465,800,150)

-- let's draw our hero
love.graphics.setColor(255,255,0,255)
love.graphics.rectangle("fill", hero.x,hero.y, 30,15)
end
Thanks for your help!
 

VideahGams

Well-Known Member
OP
Newcomer
Joined
Aug 29, 2015
Messages
91
Trophies
0
Age
25
Location
Glasgow, Scotland
Website
videah.xyz
XP
146
Country
I am a noob in Love, but I want to start learning it(I know bits of LUA)
First of all, I found this sample code on an online tutorial, what would I do to make it run on a 3DS? I get a black screen when running it currently.
Code:
function love.load()
hero = {} -- new table for the hero
hero.x = 300    -- x,y coordinates of the hero
hero.y = 450
hero.speed = 100
end

function love.update(dt)
if love.keyboard.isDown("left") then
   hero.x = hero.x - hero.speed*dt
elseif love.keyboard.isDown("right") then
   hero.x = hero.x + hero.speed*dt
end
end

function love.draw()
-- let's draw some ground
love.graphics.setColor(0,255,0,255)
love.graphics.rectangle("fill", 0,465,800,150)

-- let's draw our hero
love.graphics.setColor(255,255,0,255)
love.graphics.rectangle("fill", hero.x,hero.y, 30,15)
end
Thanks for your help!

Your problem is that the ground and hero is being drawn off screen (The hero is being drawn at 300 pixels right, 450 pixels down. This is way higher than 3DS's resolution)

Here I've changed positions/sizes to fit 3DS's screen. I've also added indentation (which helps with readability)
Code:
function love.load()
   hero = {} -- new table for the hero
   hero.x = 20 -- x,y coordinates of the hero
   hero.y = 185
   hero.speed = 100
end

function love.update(dt)
   if love.keyboard.isDown("left") then
     hero.x = hero.x - hero.speed*dt
   elseif love.keyboard.isDown("right") then
     hero.x = hero.x + hero.speed*dt
   end
end

function love.draw()
   -- draw some ground
   love.graphics.setColor(0,255,0,255)
   love.graphics.rectangle("fill", 0, 200, love.graphics.getWidth(), 150)

   -- draw our hero
   love.graphics.setColor(255,255,0,255)
   love.graphics.rectangle("fill", hero.x,hero.y, 30,15)
end
 

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,129
Country
United States

Jwiz33

Banned
Joined
Jun 5, 2014
Messages
2,654
Trophies
0
Location
in the illuminati headquar—I have said too much!
Website
iwillcleanyourbasement.webstarts.com
XP
1,492
Country
United States
Your problem is that the ground and hero is being drawn off screen (The hero is being drawn at 300 pixels right, 450 pixels down. This is way higher than 3DS's resolution)

Here I've changed positions/sizes to fit 3DS's screen. I've also added indentation (which helps with readability)
Code:
function love.load()
   hero = {} -- new table for the hero
   hero.x = 20 -- x,y coordinates of the hero
   hero.y = 185
   hero.speed = 100
end

function love.update(dt)
   if love.keyboard.isDown("left") then
     hero.x = hero.x - hero.speed*dt
   elseif love.keyboard.isDown("right") then
     hero.x = hero.x + hero.speed*dt
   end
end

function love.draw()
   -- let's draw some ground
   love.graphics.setColor(0,255,0,255)
   love.graphics.rectangle("fill", 0, 200, love.graphics.getWidth(), 150)

   -- let's draw our hero
   love.graphics.setColor(255,255,0,255)
   love.graphics.rectangle("fill", hero.x,hero.y, 30,15)
end
Oh, that makes sense. Thanks!
 

VideahGams

Well-Known Member
OP
Newcomer
Joined
Aug 29, 2015
Messages
91
Trophies
0
Age
25
Location
Glasgow, Scotland
Website
videah.xyz
XP
146
Country

VideahGams

Well-Known Member
OP
Newcomer
Joined
Aug 29, 2015
Messages
91
Trophies
0
Age
25
Location
Glasgow, Scotland
Website
videah.xyz
XP
146
Country
One more question, how do I make the game exit on start?
Code:
-- some other code is right here
end
if love.keyboard.isDown("start") then
        love.event.quit()
    end
end
This doesn't work, it doesn't do anything when I press start :unsure:

Why is there 2 end's? And is this being ran in love.update(dt)?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    ShdwTakashi @ ShdwTakashi: pineapple belong on pizza? The answer is yes until proven otherwise