i would like to upload this game to itch.io, how do i do this?
Here’s how I’d go about it. But I haven’t done this before, so there may be an easier way than I’m suggesting.
First, set up your sketch to run on your computer/locally –
https://p5js.org/get-started/#settingUp
Then upload the game using the HTML instructions provided by Itch –
https://itch.io/docs/creators/html5
I also like this approach because I can set up my project for version control (Git, etc.)
For what it’s worth, from OpenProcessing.org this is really easy: Just download your sketch as a zip file.
The create a new HTML project on itch.io and upload your zip file:
Excellent tip there, @KumuPaul !
But for sketches not hosted in OpenProcessing.org the “secret” is creating a basic HTML file which loads both the p5.js library and your sketch JS file:
index.html:
<script async src=https://cdn.JsDelivr.net/npm/p5></script>
<script defer src=sketch.js></script>
Just replace “sketch.js” w/ the exact name of your sketch file.
By default in OpenProcessing.org the main sketch file is named as “mySketch.js”.
Here’s an online example which we can see both “index.html” & “sketch.js” files in it:
thank you very much!