Skip to content

Instantly share code, notes, and snippets.

@geecu
Created March 22, 2020 05:16
Show Gist options
  • Save geecu/730f7ecd67b376c92a84d4752eff4864 to your computer and use it in GitHub Desktop.
Save geecu/730f7ecd67b376c92a84d4752eff4864 to your computer and use it in GitHub Desktop.
const sketch = function(p) {
p.setup = function() {
p.colorMode(p.HSB, 1);
p.createCanvas(p.windowWidth, 100);
};
p.draw = function() {
p.background(1, 1, 1);
p.fill(1);
p.rect(p.mouseX, p.mouseY, 50, 50);
};
};
require([
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.0.0/p5.min.js',
], function(p5) {
define('p5', [], function() {
return p5;
});
require([
'p5',
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.dom.js',
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.sound.js',
], function(p5) {
const p5instance = new p5(sketch);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment