xxxxxxxxxx
138
/// Welcome to the 🎓 CUM ACADEMY 🎓
// I'm your professor, the 🧙🏻♂️ CUM SORCERER 🧙🏻♂️
// Follow these instructions below and soon you will be
// a 🍎🍏 CUM SORCERER'S APPRENTICE 🍎🍏
// You can press the ▶️ PLAY button ▶️ in the top left corner to start the code. And you can press the ⏹️ stop button ⏹️ to stop the code.
// Today's Lesson:
// We will building a 🎹 🍆 PIPE ORGAN 🍆 🎹
// PRE-REQS
// the various p5.js functions:
// preload()
// setup()
// draw()
// 👨🏻🏫 TODAY'S SKILLS 🔠 🔢
// (1) how to draw and position a penis 🍆
// (2) how to add sound to a penis 🔊
// (3) how to use the keyboard for input ⌨️
/*
function preload() {
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
}
*/
const CW = 1080;
const CH = 1080;
let ROW_DICKS;
let CHODE;
const IMGPATH = 'assets/img'
// 🔊 🔊 🔊 AUDIO 🔊 🔊 🔊
let SOUND_FILES = [
'toneG1.mp3',
'toneA2.mp3',
'toneB2.mp3',
'toneC2.mp3',
'toneD2.mp3',
'toneE2.mp3',
'toneF2.mp3',
'toneG2.mp3',
];
let SOUNDS;
const SOUNDPATH = 'assets/sound';
function preload() {
//-- ⭐ ⭐ ⭐ IMAGES ⭐ ⭐ ⭐ ⭐ ⭐ ⭐
CHODE = loadImage(`${IMGPATH}/chode.png`);
// 🔊 🔊 🔊 AUDIO 🔊 🔊 🔊
SOUNDS = SOUND_FILES.map(s => {
const file = `${SOUNDPATH}/${s}`;
console.log(file);
return s ? loadSound(file) : null;
})
}
function setup() {
createCanvas(CW, CH);
// 🍆 🍆 DICK 🍆 🍆
ROW_DICKS = [0, 1, 2, 3, 4, 5, 6, 7].map(i => {
const ii = i + 0.5;
const bx = ii * CW/8;
const by = 800;
const d = new Dick(CHODE, bx, by, 0);
d.setGirth(50);
d.setHeight(200);
// COCK_REFACTOR: could be better?
const distance = 200 * 3/4;
d.setCumOrigin(createVector(bx, by - distance));
// COCK_REFACTOR: could be better?
// 🐎 🐎 VELOCITY 🐎 🐎
d.setVelocityFunction(angle => {
const vx = random(-2, 2);
const vy = random(-20, -15);
return createVector(
vx * cos(angle) - vy * sin(angle),
vx * sin(angle) + vy * cos(angle)
);
});
// 🔊 🔊 🔊 AUDIO 🔊 🔊 🔊
d.setCumSound(SOUNDS[i]);
return d;
});
}
function draw() {
background(102, 100, 140);
// 🍆 🍆 DICK 🍆 🍆
for (d of ROW_DICKS) d.update();
}
// 🕶️ 🕶️ KEYBOARD 🕶️ 🕶️
function keyPressed() {
for (let i in ROW_DICKS) {
if (keyCode === KEY_HOMEROW[i]) {
// ⚪ ⚪ PARTICLE ⚪ ⚪
// 🔊 🔊 🔊 AUDIO 🔊 🔊 🔊
ROW_DICKS[i].cum();
}
}
}