Love2D WebPlayer (WebGL)

Discuss any ports of LÖVE to different platforms.

Love2D WebPlayer (WebGL)

Postby ghoulsblade on Sun Mar 18, 2012 5:32 pm

cloudsdemo : http://ghoulsblade.schattenkind.net/love-webplayer/
github: https://github.com/ghoulsblade/love-webplayer

WARNING: still incomplete, some of the love api won't work yet
notYetImplemented:ttf-fonts,spritebatch,framebuf,physics,threads,0.8stuff...
shouldBeWorking:newImage+draw,keyboard,quads,pixelFonts,printf,mouse,joystick,audio

goal : play games made for love2d inside the browser without plugins (webgl+javascript capable browser required)

usage: unpack .love file (rename to .zip), add the .js files and the index.html from love-webplayer, upload the whole folder to webserver, open in browser, play

tech : webgl for display, github.com/mherkender/lua.js to run lua code in javascript




EDIT: i guess we'll need love.web api next to love.phone/love.android soon ;)

EDIT: if you want to discuss pure html5/canvas (without webgl), NaCl, flash or similar alternative tech or browser plugin, please make a new thread instead. I'm only interested in a webgl implementation and the others have already been suggested.
Last edited by ghoulsblade on Fri May 18, 2012 8:56 am, edited 10 times in total.
love-android - gamejams
User avatar
ghoulsblade
Party member
 
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer

Postby coffee on Sun Mar 18, 2012 6:17 pm

Very nice. I already saw very good code engines export to JS and with enough speed. Would be nice see LOVE do same steps. Congratulations.
coffee
Party member
 
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Love2D WebPlayer

Postby Kingdaro on Sun Mar 18, 2012 7:00 pm

Do you have any idea how long we've needed this?

;~;
Hello, LÖVE!
User avatar
Kingdaro
Party member
 
Posts: 199
Joined: Sun Jul 18, 2010 3:08 am

Re: Love2D WebPlayer

Postby SiENcE on Sun Mar 18, 2012 8:40 pm

First Löve Android.
Now a Löve WebPlayer.

What next :awesome: ?

I think, one of the next Löve versions should official support one of these (or both) ports. Hopefully they are going official one day.

Now testing... ;-)
User avatar
SiENcE
Party member
 
Posts: 402
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany

Re: Love2D WebPlayer

Postby TechnoCat on Sun Mar 18, 2012 8:44 pm

I think I could whip up a love.joystick and love.keyboard really quickly. I'd like to fork this and make a pull request. That sound cool?
User avatar
TechnoCat
Inner party member
 
Posts: 1606
Joined: Thu Jul 30, 2009 12:31 am
Location: Chicago, IL

Re: Love2D WebPlayer

Postby ghoulsblade on Sun Mar 18, 2012 9:21 pm

sure, help appreciated =)
next i'll be working on :
* require/dofile/love.filesystem.load (needs some ajax magic)
* input : mouse + keyboard
* chew my way through love api stuff and test with a few demos/games
* no sound for now, will look into that later
love-android - gamejams
User avatar
ghoulsblade
Party member
 
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer

Postby TechnoCat on Sun Mar 18, 2012 9:28 pm

ghoulsblade wrote:* require/dofile/love.filesystem.load (needs some ajax magic)

I know javascript solutions? http://requirejs.org/ https://github.com/wycats/minispade

ghoulsblade wrote:* input : mouse + keyboard

https://github.com/tzuryby/jquery.hotkeys
love.mouse.setGrab: http://dvcs.w3.org/hg/pointerlock/raw-f ... index.html

ghoulsblade wrote:* no sound for now, will look into that later

http://www.html5rocks.com/en/tutorials/webaudio/intro/ http://www.html5rocks.com/en/tutorials/webaudio/games/
User avatar
TechnoCat
Inner party member
 
Posts: 1606
Joined: Thu Jul 30, 2009 12:31 am
Location: Chicago, IL

Re: Love2D WebPlayer

Postby coffee on Sun Mar 18, 2012 11:08 pm

TechnoCat wrote:
ghoulsblade wrote:* require/dofile/love.filesystem.load (needs some ajax magic)

I know javascript solutions? http://requirejs.org/ https://github.com/wycats/minispade

ghoulsblade wrote:* input : mouse + keyboard

https://github.com/tzuryby/jquery.hotkeys
love.mouse.setGrab: http://dvcs.w3.org/hg/pointerlock/raw-f ... index.html

ghoulsblade wrote:* no sound for now, will look into that later

http://www.html5rocks.com/en/tutorials/webaudio/intro/ http://www.html5rocks.com/en/tutorials/webaudio/games/


So, why this isn't already done? :D
Good luck to both and for the project. :)
coffee
Party member
 
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Love2D WebPlayer

Postby ghoulsblade on Sun Mar 18, 2012 11:33 pm

I cleaned the code up a bit and made dummys/stubs for all top-level functions.

main.js now has a few helper functions:
e.g. the javascript function call_love_keypressed (key,unicode) can be used to call love.keypressed(key,unicode).
This should help when implementing keyboard & mouse.

love.audio.js now has an example of how to bind objects (like audio source).
This should be a good starting point if someone wants to implement audio.

looking forward to pull requests on github ;)
love-android - gamejams
User avatar
ghoulsblade
Party member
 
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer

Postby coffee on Mon Mar 19, 2012 12:50 am

I'm using OSX. For now only working in Chrome. For my surprise not working in updated Safari. Also not working in Firefox 3.6 and Opera. In Chrome seems good.
coffee
Party member
 
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Next

Return to Ports

Who is online

Users browsing this forum: No registered users and 0 guests