Love2D WebPlayer (WebGL)

Discuss any ports of LÖVE to different platforms.
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer (WebGL)

Post by ghoulsblade »

Kongregate API for Love2D ? viewtopic.php?f=4&t=10641
love-android - gamejams
zapaman
Prole
Posts: 13
Joined: Sat Aug 25, 2012 5:54 pm
Location: Romania | Bucharest
Contact:

Re: Love2D WebPlayer (WebGL)

Post by zapaman »

Guys, did you check out MarketJS? I've been playing around with my Ludumdare Game and the WebPlayer and so far, besides a font issue, everything works just as it should! Was thinking of "pimpin" up my LD game once finished and submitting it there!

Ghoulsblade: will you continue to work on the WebPlayer? It's one piece of awesomeness!
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Love2D WebPlayer (WebGL)

Post by SiENcE »

I think for better platform support we need also Canvas 2D fallback. WebGl is nice but limited to desktops.

Ghoulsblade mentioned he will not implement Canvas 2D, but i just like to mention it here that we don't forget this :).
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Love2D WebPlayer (WebGL)

Post by Nixola »

lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer (WebGL)

Post by ghoulsblade »

continue work : occasionally, but it's not a priority for me, more of a "if i need something for myself, i'll implement it" situation.
I was hoping to get the community involved in working on the code, i'll extend and help with contributions, but i've done my part and i won't polish it beyond what i need for my own projects.

What's most likely to be improved in the near future is the default font, love 0.8 api adjustments, and physics.
I already started a binding for a web version of box2d, but it's still a lot to do and something doesn't work right with the few bits that are there.

Canvas2D : please make a separate thread to discuss this, we've had it flare up in here a few times and it's annoying since i really have 0 interest in it, sorry. (see also note in first post)
Last edited by ghoulsblade on Mon Aug 27, 2012 12:00 pm, edited 1 time in total.
love-android - gamejams
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer (WebGL)

Post by ghoulsblade »

nixola :
according to the error message something in note.lua, probably

Code: Select all

local args = {...}

otherwise you'll need to litter the code with print("spot01") and similar instructions to pin it down since the original .lua line numbers aren't available after conversion to javascript.

also the way you use modules might not work in webplayer, since it tries to convert lua to javascript, and that doesn't work with all language constructs.

Code: Select all

square = love.filesystem.load 'notes.lua' 'square'
i'd recommend using

Code: Select all

love.filesystem.load("mylib.lua")()
and doing something like

Code: Select all

mylib = {}
function mylib.bla () print("bla") end 
in there.

no time : according to ludumdare rules, porting is allowed even after the 48/72 hours, so you can just finish the game for native love first, and then later port it to web if you like.
love-android - gamejams
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Love2D WebPlayer (WebGL)

Post by Nixola »

Thanks Ghoulsblade, that was one of the problems... Another one lies in this line:

Code: Select all

notes.soundDatas[i]:setSample(s, sin)
error during main.lua : Error: attempt to index field 'setSample' in a nil value : Error: attempt to index field 'setSample' in a nil value at lua_tableget

It runs fine on the PC, so I think the problem is Love Web player's audio module, should I pre-render the sounds (how? I can't save them with LOVE >.<) and upload them?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer (WebGL)

Post by ghoulsblade »

sounds don't need preload. but formats other than .wav .ogg and .mp3 will cause problems.
the error message says that somehow "notes.soundDatas" is nil.
this could be being different than in pc-love, or the entry having failed to load.
i'd suggest doing a print("setSample for i=",i) before the line and enabling the console in your browser to see the last output.
also when loading the sounds and setting notes.soundDatas to a value, check the value for being nil and print if not.
love-android - gamejams
zapaman
Prole
Posts: 13
Joined: Sat Aug 25, 2012 5:54 pm
Location: Romania | Bucharest
Contact:

Re: Love2D WebPlayer (WebGL)

Post by zapaman »

@ ghoulsblade: I'm interested in doing some work on the WebPlayer, since I really see the potential in using Love for web games! Made a github account, going to fork the project and see what I can add/fix!
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Love2D WebPlayer (WebGL)

Post by Nixola »

The code

Code: Select all

notes.soundDatas[i] = love.sound.newSoundData( 22050, 44100, 16, 1)
for s = 0, 22049 do
   print(type(notes.soundDatas), type(notes.soundDatas[i]), i)
--etc.
generates this output:

Code: Select all

NotImplemented:love.sound.newSoundData main.js:61
table nil 1 
EDIT: I asked to Flashgames.it's admins (it's a famous italian site for flash games) if they'll accept using LÖVE Webplayer, obviously telling them that I've got no rights and that I was only asking some informations, is it ok or I should tell them that you don't want?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests