So you can put your pico-8 games on your own site/dropbox/whatever. Ability to make standalone export (pico-8 with embedded game that launches after you click exe) would also be great.
It still would depend on Lexaloffe's servers to be up, but it'd be a good start, sure.
+1, I love pico-8 but not being able to upload my games to my own server is a bit disappointing :(
@matt TBH I'd like to be able to distribute a playable version of my games without relying on 3rd party servers.
+1 for this and 100% agreeing with @ladybenko: no 3rd party servers please.
How about this: Zep could make simplified version of current webplayer that autoplays, don't have that close button at the top, basically just canvas and it would always read file named webgame.p8.png as a cart. Aside of small changes I've mentioned, it'll just behave like regular Pico webplayer and would be bundled with the software in self-contained html file that can then be put on your server and into iframe
I think I see. You're saying that an iframe on our html would have its src attribute set to the path of your self-contained html file?
I don't think we need an iframe. We just need a JS file that can play a game if provided a canvas element and the cart.
It would also be nice if we could configure parameters such as key mapping for this webplayer.
Yeah I think it's iframe if lexaloffle want to host everything, or just access to a hosted the JS file if we want to self host the canvas.
@lexaloffle might be the first person to regret such -- hosting everything -- a requirement. The current setup detracts from the appeal of pico-8, IMO. And if despite that it still becomes popular, server costs will increase sooner or later. Compensating for that by charging the users would not be popular, I suspect.
Also, what if someone wants to create a standalone, raspberry-pi+linux based, game console using the pico-8 as its core engine? Solving this issue (locally hosted engine) would bring this idea one step closer to reality. Not solving it voids the idea outright.
It is certainly possible currently to put a pico-8 game on your own site/server.
I made something similar to this, at https://pico8.herokuapp.com/
And you can even embed it with this code on a website (replace the 5 zeros with the number of your cartridge)
<iframe src="https://pico8.herokuapp.com/?00000" style="width:580px;height:540px;border:none"></iframe> |
The code behind this could also be repurposed to run anywhere and load cartridges without depending on lexaloffle or any other server (other than your own site/server).
With something like this there is also a lot of room for customization. I was playing around recently with CSS + SVG effects with the canvas and it produced very interesting results. I also added mobile support (which is currently up and running at the link I provided), if you load the link on a phone it should add some buttons which let you interact with the game (for best experience you might need to add the link to your home screen, this way it can remove the browser chrome/GUI).
@azlen where did you get pico.js from? Are we legally allowed to include it in our own servers? If so, it would be nice of zep to do a formal statement about that file, so we can use it without fear of copyright infringement.
Oh man azlen that is awesome!
I just tired it on my phone and it runs great!
It would be cool if you could package that into an app with a cartridge downloader/selecter.
@ladybenko I found pico.js here, most of the code there looks like it's for emscripten, the actual code for pico seems to be hidden behind a wall of numbers (which seem to almost correlate with keyCodes). It definitely would be nice for zep to say something about the file.
@UrbanMonk, packaging this into an app could be really cool and not very hard (there's tools like PhoneGap). I wonder what zep's thoughts are about a mobile pico app.
I'm sure @zep will respond to these questions in due time
If you look into html&js code of player on bbs you can quite easily figure out how web player is loaded, then you can extract it and add to your own server.
pico8.js contain a method called "gd" which handles input, so you can call it like this to simulate key presses:
/* kc = 90; // z kc = 88; // x kc = 37; // left kc = 39; // right kc = 38; // up kc = 40; // down */ gd( { type: 'keydown', keyCode: kc } ); gd( { type: 'keyup', keyCode: kc } ); |
Sure it will be better if we would be given official way to embed js player, but I assume it's not done because it's still in pretty early state of development a lot of things will change over time.
Ok, for all you guys wanting easy and customisable way to embed your games on your websites, I have created simple wrapper that you can use on your own server in the meantime the pico is still being developed and don't have official embedding api. There is tutorial and two examples in the repo on github:
https://github.com/AfBu/PicoLoader
With this wrapper playing your games on your site is as easy as calling "LoadPico('container','cart.p8.png');"
This is looking good but I have an issue: I am trying to get a local server to run AfBu's PicoLoader on my Android phone to play others'/my p8s during my commute and offline... almost there, the current advanced.html example uses mouseup/mousedown events which are ignored on touchscreens, so I've replaced with touchstart/touchend but this is a bit hit and miss (sometimes works, sometimes doesn't for a given key). I don't know if this is due to response time or just my bad js, but any help would be appreciated. I will try a few more times before hoping that Zep will just give us something awesome (as usual).
I agree that an official release of the web player would be really fun to play with.
This is a real hack but here's the current web player integrated with three.js. You can rotate the camera around by dragging the mouse, scroll-wheel to zoom.
Really cool. Could you release it as sources and a way to change cabinet graphics (textures)?
Also similar thing, but in "home" environment (couch, crt tv, and top loading Pico-8 with cartridge of a game sticking out) would be swell too!
Yes! That is exactly what I was thinking.
My idea is that there could be a small bit of javascript that would expose the game screen as a three.js material which could be applied to any object in the scene, and expose a way to associate light sources with the actual screen content (as is the case in that demo).
Similarly you could have objects with specific morph targets or position/orientation values for objects like buttons and joysticks which would also be automatically updated to match the pico8 button states.
With something like this, the scenes could just be swapped out for whatever environment you'd like (arcade, living room, etc). Also three.js is pretty easy to use with VR headsets... :)
I'll just leave this here: https://twitter.com/lexaloffle/status/646075234584363008
[Please log in to post a comment]