npm install -g git+ssh:git@github.com:horizons-school-of-technology/runp5.gitrunp5 main.jswhere main.js is the root file of your p5 program
runp5 uses p5.js's instance mode, with the instance named game. You should
call p5 functions using game.fill() etc:
game.fill(0, 0, 255);
game.ellipse(50, 50, 100, 100);
runp5 allows you to create a game loop in one of two ways:
-
By setting the
game.drawfunction:game.draw = function() { }; -
By creating a
while(true)loop and callingawait frame();in each iteration of the loop to advance the frame counter