link: https://editor.p5js.org/am15643/full/W4lY8cfjO
Concept
For this project, I was really sure I wanted to make a generative art, but also a kind of generative art that is more personal. I am always told, that my room and my table really reflect my personality and that it looks like how people imagine it to look like, which is why I decided to make this about my table in the end! I just really wanted to challenge myself with what we have learned, like about the CSV files or OOP, and somehow include them all in a project that is fun but still doesn’t feel too much, and is not too confusing. I hope I managed to achieve that!
I had this concept since beginning actually, I think I have wanted to make this since we first started thinking about ideas, so I feel really proud that it managed to stay with me until the end. I wanted the code to have a start, a main, and tree subpages, although at the beginning I didn’t know exactly what I wanted these subpages to do, or what I would want to have in them, they just happened during the development of the whole project.
The Code
Overall, I had a lot of problems with the code, that it worked differently than I wanted it to, but in the end it got together. The way my project works, is that the user starts with an instructions page, where I tried to create a flower from my culture, which is Hungarian, to put a little bit of myself even here. This wasn’T necessarily hard, it just took a very long time for me to do the measurements right.

//Hungarian-style flower
//Red base
fill('#FF2400');
noStroke();
circle(width / 2, 90, 130);
circle(width / 2 - 70, 120, 70);
circle(width / 2 + 70, 120, 70);
circle(width / 2 - 50, 170, 50);
circle(width / 2 + 50, 170, 50);
circle(width / 2 - 20, 195, 40);
circle(width / 2 + 20, 195, 40);
rect(width / 2 - 50, 140, 95, 54);
//Middle 'design'
fill('#FFBF00');
circle(width / 2, 70, 90);
fill('#008000');
ellipse(width / 2, 45, 20, 40);
//Leaves outside, the green lines and blue dots
stroke('#008000');
strokeWeight(4);
line(width / 2 - 70, 80, width / 2 - 150, 20);
line(width / 2 + 70, 80, width / 2 + 150, 20);
line(width / 2 - 70, 80, width / 2 - 130, 60);
line(width / 2 + 70, 80, width / 2 + 130, 60);
line(width / 2 - 70, 80, width / 2 - 100, 30);
line(width / 2 + 70, 80, width / 2 + 100, 30);
noStroke();
fill('#0047AB');
circle(width / 2 - 150, 20, 20);
circle(width / 2 + 150, 20, 20);
circle(width / 2 - 130, 60, 20);
circle(width / 2 + 130, 60, 20);
circle( width / 2 - 100, 30, 20);
circle( width / 2 + 100, 30, 20);
Then the user gets to my main page where they can interact with my books, my headphones, my pictures and my lamp. I finally managed to change the AI background photo and I am really proud of it, as I made the end result in Canva (I took a ScreenShot of the process but Canva makes them blurry).
Then once the user is “at my desk” they have 4 interactable objects to choose from, where they are able to learn something about me through different things like what books I like, what music I listen to or photos.
The headphones and books pages I “designed” myself in p5, so they don’t look as aesthetic as the main desk page, but I had fun playing with the different shapes and colours. They are very minimalistic I think, but I really like it, especially the little game where you can guess what my favourite book is. I think this books part was the most fun to make out of all. The program just checks which book your mouse is on, and gives you back your result if you press on it. This is something I am really proud of.
//Guessing my favourite book game
if(mouseIsPressed){
if (mouseX > whiteBookX && mouseX < whiteBookX + whiteBookW &&
mouseY > whiteBookY && mouseY < whiteBookY + whiteBookH) {
push();
textFont('Caveat');
textStyle(NORMAL);
textSize(30);
text('❌ So close!', 120, 350);
pop();
} else if (mouseX > yellowBookX && mouseX < yellowBookX + yellowBookW &&
mouseY > yellowBookY && mouseY < yellowBookY + yellowBookH) {
push();
textFont('Caveat');
textStyle(NORMAL);
textSize(30);
text('❌ Almost!', 120, 350);
pop();
} else if (mouseX > redBookX && mouseX < redBookX + redBookW &&
mouseY > redBookY && mouseY < redBookY + redBookH){
push();
textFont('Caveat');
textStyle(NORMAL);
textSize(50);
text('🎉 👑', 120, 350);
pop();
} else if (mouseX > greenBookX && mouseX < greenBookX + greenBookW &&
mouseY > greenBookY && mouseY < greenBookY + greenBookH) {
push();
textFont('Caveat');
textStyle(NORMAL);
textSize(30);
text('❌ Close!', 120, 350);
pop();
} else if (mouseX > blueBookX && mouseX < blueBookX + blueBookW &&
mouseY > blueBookY && mouseY < blueBookY + blueBookH) {
push();
textFont('Caveat');
textStyle(NORMAL);
textSize(30);
text('❌ Try another!', 120, 350);
pop();
}
}
Another part of my project that I am really proud of is weirdly the postcard, or the photos part of it. For the photos page I also used my actual photos: I laid out my polaroids on my floor and took a picture of them. Originally I really wanted the photos to be on a carousel, but my program was already full of images, and was hard for it to load, so in the end I decided upon one: of my brothers and I. I feel like having two brothers is a really defining and important part of my life, I really love them so so much, and that is why I feel so proud of this part, not only the code itself but also the idea.
The code was also something I had struggle with, but that’s what makes me feel so proud now. I tried the translate an rotate thing, and also for the image to “flip”. In reality it just disappears and a text appears when clicked on it, but I still am really proud of it:
//Design of subpage, what is on it
postcardsPage(){
background(postBG);
//White card behind photo
push();
drawingContext.shadowOffsetX = 4;
drawingContext.shadowOffsetY = 4;
drawingContext.shadowBlur = 4;
drawingContext.shadowColor = color('black');
noStroke();
rectMode(CENTER);
translate(width / 2, height /2 );
rotate(-1.7);
fill('white');
rect(0, 0, 250, 360, 10);
pop();
//put both photo and text in the white box
push();
translate(width / 2, height / 2);
rotate(-0.13);
//"flip" image, make it disappear and show a text instead
if (this.isFlipped) {
textSize(24);
textStyle(NORMAL);
textAlign(CENTER);
fill(50);
textFont('Edu QLD Hand')
noStroke();
text('These are my brothers...', 0, -30);
text('They are awesome', 0, 0);
text('But do not tell them I said this', 0, 30);
} else {
//photo of me and my brothers
imageMode(CENTER);
image(siblingImg, 0, 0, 320, 220);
}
pop();
//Click sign
image(click, 350, 330);
}
Speaking of which, a good design that I think I implemented was to call all the images, the background music and the csv file in a Promise rather than calling them all separately. The code still needs some time to start, but it definitely works a lot faster than it did when I just called them separately and not as a block:
async function setup() {
createCanvas(500, 600);
//loading all the images, music, strings
[
backgroundImg,
lampImgOff,
lampImgOn,
headphonesImg,
booksImg,
postcardImg,
backTrackButtonImg,
postBG,
playlistSongs,
siblingImg,
click,
bgMusic,
] = await Promise.all([
loadImage('desk.png'),
loadImage('lampOff.png'),
loadImage('lampOn.png'),
loadImage('headphones.png'),
loadImage('books.png'),
loadImage('postcard.png'),
loadImage('backtrack.png'),
loadImage('postBg.jpeg'),
loadStrings('playlist.csv'),
loadImage('siblingImg.jpeg'),
loadImage('click.png'),
loadSound('bgMusic.mp3'),
]);
Future Improvements
One thing I could not fix, was the shuffle button in full screen mode. For some reason, no matter what I did the button just wouldn’t stay in the same place, and eventually I gave up on it. I really want to improve on that in the future.
Originally, I wanted the sound to only start when the user is in the MAIN page, and for it to stop at the START page. I tried multiple options on how to make that work but none of it did. One just completely viped away the music, the other did only start it once the user was in the main page, but then it didn’t stop when I went back., so I just decided to keep it throughout in a loop. I thing that could be something to work on.
I feel like I could definitely work on working faster. This is not something specific in my code, its just that this little interactive thing took me almost 2 weeks of heavy coding and a lot of hours of work. I think I need to work on not overcomplicating things, but also learning how to work faster, because I feel like I spent too much time on parts of my code that didn’t necessarily require that much attention. This might get better as I get more and more familiar and confident with Javascript, but for now I had to google a lot of things, I took a long time to understand and then to implement them.
References
Basic design of multiple pages (inspiration, help)
https://editor.p5js.org/ltorrent/sketches/3Y31raQKU
https://www.youtube.com/watch?v=Yk18ZKvXBj4 (for dividing the scripts)
https://www.youtube.com/watch?v=Pn1g1wjxl_0&list=PLRqwX-V7Uu6aFcVjlDAkkGIixw70s7jpW (sound)
Resources for colour codes, emojies, fonts
https://htmlcolorcodes.com/
https://emojipedia.org
https://fonts.google.com/
Help with the backtrack button/understand the priciple
https://editor.p5js.org/Ramikd/sketches/8Czoi6JqB
Music from freesound, author doesn’t require credit, but I still want to give them:
VS Button Click 05.mp3 by Vilkas_Sound — https://freesound.org/s/707042/ — License: Attribution 4.0
Clicking sounf from Freesound
VS Button Click 04.mp3 by Vilkas_Sound — https://freesound.org/s/707041/ — License: Attribution 4.0





I just wanted to create something fun as well. I have been having some pretty bad days, and making this not super serious helped a lot with my mood, and I really enjoyed coming up with all the responses for the Magic Ball. I also made some of my friends try it out once it was ready and they also really enjoyed it.



