Skip to content

Instantly share code, notes, and snippets.

View bernhardfritz's full-sized avatar

Bernhard Fritz bernhardfritz

View GitHub Profile
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const fisherYatesShuffle = (a) => {
import p8g, {
background,
createCanvas,
ellipse,
stroke,
noFill,
width,
height,
} from 'https://unpkg.com/p8g.js';
import p8g, {
createCanvas,
fill,
height,
noSmooth,
noStroke,
random,
rect,
width,
} from 'https://unpkg.com/p8g.js';
import p8g, {
background,
createCanvas,
rect,
} from 'https://unpkg.com/p8g.js';
p8g.draw = () => {
background(220);
rect(50, 50, 100, 100);
};
import p8g, {
background,
createCanvas,
rect,
loadImage,
image
} from 'https://unpkg.com/p8g.js';
const img = await loadImage('https://dummyimage.com/16x16/ffff00/000000.png&text=+');
let x = 0;
import p8g, {
background,
createCanvas,
rect,
mouseX,
width,
height,
loadImage,
image,
} from 'https://unpkg.com/p8g.js';
import p8g, {
background,
createCanvas,
rect,
translate,
scale,
mouseX,
width
} from 'https://unpkg.com/p8g.js';
import p8g, {
background,
createCanvas,
rect,
} from 'https://unpkg.com/p8g.js';
p8g.draw = () => {
background(220);
rect(50, 50, 100, 100);
};
import p8g, {
background,
createCanvas,
rect,
} from 'https://unpkg.com/p8g.js';
p8g.draw = () => {
background(220);
rect(50, 50, 100, 100);
};
import p8g, {
background,
createCanvas,
rect,
} from 'https://unpkg.com/p8g.js';
p8g.draw = () => {
background(220);
rect(50, 50, 100, 100);
};