Love2D WebPlayer (WebGL)

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

Love2D WebPlayer (WebGL)

Post by ghoulsblade »

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
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Love2D WebPlayer

Post by coffee »

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.
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: Love2D WebPlayer

Post by Kingdaro »

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

;~;
User avatar
SiENcE
Party member
Posts: 805
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Love2D WebPlayer

Post by SiENcE »

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
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Love2D WebPlayer

Post by TechnoCat »

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
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer

Post by ghoulsblade »

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
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Love2D WebPlayer

Post by TechnoCat »

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/
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Love2D WebPlayer

Post by coffee »

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. :)
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: Love2D WebPlayer

Post by ghoulsblade »

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
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Love2D WebPlayer

Post by coffee »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest