Log In  


Right, so basically what I'm trying to do is, when a game is running in JS, get some kind of data from them on some kind of event in-game. Example: achievements in-game captured by a website in JavaScript. Anyone found a way to do this? GPIO maybe?

1


yes, the GPIO is accessible via javascript

from the manual:

Cartridges exported as HTML / .js use a global array of integers (pico8_gpio) to 
	represent gpio pins. The shell HTML should define the array:

	var pico8_gpio = Array(128);

I did similar like this just several days ago for my game, "Kelin's Delivery: Rain", but on integrating it with Kongregate API and Newsgrounds API. And yes, I use GPIO to do it. It worked well.

I added extra function in the JS loop after "Browser.mainLoop.runIter((function(){" to check GPIO memory value whether it is 0 (not reached) or 1 (reached). I defined the extra function in other js file to update less hassle when updating the game.


Thanks guys!



[Please log in to post a comment]