Greatest project in Löves whole history!!!
I only hope there's much room left for optimisations, since it wouldn't be very usable with this speed..
But nevertheless:: You rock !! This may make Löve work on Facebook, Iphone, Android, Windows Phone, in the future.
Love2D WebPlayer (WebGL)
Re: Love2D WebPlayer (WebGL)
This is true. Speed is a current problem, but not a future one . All hardware is getting faster and faster and i think there is much room for coe optimization.chris wrote:Greatest project in Löves whole history!!!
I only hope there's much room left for optimisations, since it wouldn't be very usable with this speed..
But nevertheless:: You rock !! This may make Löve work on Facebook, Iphone, Android, Windows Phone, in the future.
I hope more poeple get involved in the löve-webplayer development.
Re: Love2D WebPlayer (WebGL)
Is the lua-parser written by you, or an external library? And is it able to parse native lua functions?
- ghoulsblade
- Party member
- Posts: 111
- Joined: Sun Oct 31, 2010 6:11 pm
Re: Love2D WebPlayer (WebGL)
i used an existing library : https://github.com/mherkender/lua.js
it converts the lua code to javascript at runtime and then executes it,
so you can use the webplayer for games written for normal love2d.
I'm not sure what you mean by "native lua", but you don't have to program in javascript, the webplayer runs lua code.
there are still a bunch of issues like fonts, audio in firefox, a few parser problems in some cases, some missing/not-yet-implemented api stuff (spritebatch), network and box2d... (see readme)
but as you can see it can already be used for more complex games successfully =)
it converts the lua code to javascript at runtime and then executes it,
so you can use the webplayer for games written for normal love2d.
I'm not sure what you mean by "native lua", but you don't have to program in javascript, the webplayer runs lua code.
there are still a bunch of issues like fonts, audio in firefox, a few parser problems in some cases, some missing/not-yet-implemented api stuff (spritebatch), network and box2d... (see readme)
but as you can see it can already be used for more complex games successfully =)
love-android - gamejams
Re: Love2D WebPlayer (WebGL)
alright, so i'm trying to use this:
with the web player. when I do, it gets this error on chrome:
and this error on firefox:
and I'm pretty sure i did everything right, this is my filesystem arrangement:
i had the impression that the other files were optional, is it my fault or am I using something unsupported in the player?
with the web player. when I do, it gets this error on chrome:
Code: Select all
error during love.load() : TypeError: Cannot read property 'metatable' of null : TypeError: Cannot read property 'metatable' of null
at lua_call (http://localhost/love/js/lua-parser.js:1286:17)
at eval at lua_load (http://localhost/love/js/lua-parser.js:35:21)
at lua_rawcall (http://localhost/love/js/lua-parser.js:1272:17)
at lua_call (http://localhost/love/js/lua-parser.js:1284:12)
at call_love_callback_guarded (http://localhost/love/js/main.js:282:10)
at call_love_load (http://localhost/love/js/main.js:339:53)
at MainRunAfterPreloadFinished (http://localhost/love/js/main.js:521:2)
at PreLoadImageFinishOne (http://localhost/love/js/main.js:462:2)
at HTMLImageElement.<anonymous> (http://localhost/love/js/main.js:445:30)
Code: Select all
profile:102 msec: RunLuaFromPath:parse:main.lua
main.js (line 49)
error during love.load() : TypeError: func is null : lua_call(null,[object Array])<br/> @http://localhost/love/js/lua-parser.js:1286 ((void 0))<br/> @http://localhost/love/js/lua-parser.js:58 lua_rawcall((function () {var tmp;lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "setDefaultImageFilter"), ["linear", "nearest"]);lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "setPoint"), [3, "smooth"]);lua_call(G.str.require, ["extra"]);G.str.blockimg = lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "newImage"), ["img/block.png"])[0];G.str.screen = lua_newtable([], "width", lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "getWidth"), [])[0], "height", lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "getHeight"), [])[0]);G.str.field = lua_newtable([], "width", 3200);G.str.gWorld = lua_newtable();G.str.gTime = 0;G.str.gTick = lua_call(G.str.newTick, [])[0];G.str.Gravity = 700;G.str.Controls = lua_newtable([], "right", "right", "left", "left", "jump", "up", "grab", "z");G.str.JoyControls = lua_newtable([], "jump", 3, "grab", 4);lua_call(G.str.require, ["camera"]);lua_call(G.str.require, ["camerashake"]);lua_call(G.str.require, ["block"]);lua_call(G.str.require, ["player"]);G.str.startTimer = 1;return [];}),[object Array])<br/> @http://localhost/love/js/lua-parser.js:1272 lua_call((function () {var tmp;lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "setDefaultImageFilter"), ["linear", "nearest"]);lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "setPoint"), [3, "smooth"]);lua_call(G.str.require, ["extra"]);G.str.blockimg = lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "newImage"), ["img/block.png"])[0];G.str.screen = lua_newtable([], "width", lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "getWidth"), [])[0], "height", lua_call(lua_tableget(lua_tableget(G.str.love, "graphics"), "getHeight"), [])[0]);G.str.field = lua_newtable([], "width", 3200);G.str.gWorld = lua_newtable();G.str.gTime = 0;G.str.gTick = lua_call(G.str.newTick, [])[0];G.str.Gravity = 700;G.str.Controls = lua_newtable([], "right", "right", "left", "left", "jump", "up", "grab", "z");G.str.JoyControls = lua_newtable([], "jump", 3, "grab", 4);lua_call(G.str.require, ["camera"]);lua_call(G.str.require, ["camerashake"]);lua_call(G.str.require, ["block"]);lua_call(G.str.require, ["player"]);G.str.startTimer = 1;return [];}),[object Array])<br/> @http://localhost/love/js/lua-parser.js:1284 call_love_callback_guarded("load",[object Array])<br/> @http://localhost/love/js/main.js:282 call_love_load()<br/> @http://localhost/love/js/main.js:339 MainRunAfterPreloadFinished()<br/> @http://localhost/love/js/main.js:521 PreLoadImageFinishOne("img/player.png")<br/> @http://localhost/love/js/main.js:462 ([object Event])<br/> @http://localhost/love/js/main.js:445
Code: Select all
server
|-love (the webplayer's folder)
|-box (my game's folder)
|-main.lua and other lua files
|-img (where my images are)
|-index.html (with my images defined in the preloader)
|-js
|-style.css
|-imgfont.png
- ghoulsblade
- Party member
- Posts: 111
- Joined: Sun Oct 31, 2010 6:11 pm
Re: Love2D WebPlayer (WebGL)
if it runs in normal love you probably hit something unsupported / not-yet-implemented.
sadly the error-messages produced by the webplayer don't give a position,
so i'd recommend littering the code (in your case love.load) with statements like print("load01") ... print("load02") ... to narrow it down
Most browser have a "javascript console" window that can be opened to view the output.
edit : webplayer was started for 0.7.2 and doesn't support all 0.8 stuff, so "love.graphics.setDefaultImageFilter" isn't available yet.
sadly the error-messages produced by the webplayer don't give a position,
so i'd recommend littering the code (in your case love.load) with statements like print("load01") ... print("load02") ... to narrow it down
Most browser have a "javascript console" window that can be opened to view the output.
edit : webplayer was started for 0.7.2 and doesn't support all 0.8 stuff, so "love.graphics.setDefaultImageFilter" isn't available yet.
love-android - gamejams
Re: Love2D WebPlayer (WebGL)
So, I want to try this on my own but I'm not sure what I might be doing wrong. I cloned the git repo, but if I try to open any of the index.html files within (belonging to the examples, nothing modified by me), they seem to crash all with the same error:
Is this due to some regression introduced in a recent commit? I can see and play the examples on the OP just fine, so I'm guessing maybe a recently-implemented something broke it? Thanks in advance!
Code: Select all
error during shader init:ReferenceError: gShaderCode_Fragment is not defined
Re: Love2D WebPlayer (WebGL)
... you need a webserver. here is a very small webserver you should try. put the jar into the webplayer folder and start via commandline:fireblend wrote:So, I want to try this on my own but I'm not sure what I might be doing wrong. I cloned the git repo, but if I try to open any of the index.html files within (belonging to the examples, nothing modified by me), they seem to crash all with the same error:
Is this due to some regression introduced in a recent commit? I can see and play the examples on the OP just fine, so I'm guessing maybe a recently-implemented something broke it? Thanks in advance!Code: Select all
error during shader init:ReferenceError: gShaderCode_Fragment is not defined
Code: Select all
java -jar SimpleWebServer.jar
et voila.
Re: Love2D WebPlayer (WebGL)
Thanks! My game doesn't make the player crash, but it doesn't run correctly either I suspect the love.draw( ) function is drawing some stuff at seemingly hyper-accelerated speeds I'll do a bit of debuggingSiENcE wrote: ... you need a webserver. here is a very small webserver you should try. put the jar into the webplayer folder and start via commandline:
then go into your browser and type "localhost".Code: Select all
java -jar SimpleWebServer.jar
et voila.
Thanks anyway
Edit:
Haha, after looking at lua.js code, I discovered I was right; apparently lua.js's implementation of math.rad was wrong. I already submitted a pull request to the lua.js project: https://github.com/mherkender/lua.js/pull/11
In order to fix it for Love2D-webplayer, just generate the lua-parser.js file again once my commit has been cleared, or take a look at the change in code (minimal) and fix it yourself on lua-parser.js, that fixed my problem
You can see the web version of my game here: http://fireblend.github.com/love-web/DaH/
Cheers!
Re: Love2D WebPlayer (WebGL)
Haha so cool game! Well done. It makes really fun! The monster could be more evil .fireblend wrote:You can see the web version of my game here: http://fireblend.github.com/love-web/DaH/
Cheers!
The music is superb.
Who is online
Users browsing this forum: No registered users and 0 guests