Concept
For my midterm project, I decided to create an interactive slime-making game called Slime Lab. I wanted to make something cute, colorful, and fun that people could interact using their own choices. The idea is that the user gets to create their own slime by choosing its color, face, and charm, and then play with it using different actions.
I also wanted the game to feel like an experience rather than just having a slime in the middle of the screen and poking it (like other slime games). So I included an instructions page, a customization section, and a play area where the user can poke, stretch, and shake their slime, and finally a page where you could either save the slime to your device or go back to create another. I used different PNG images and a sound effect to make the interactions feel more satisfying and realistic. I wanted everything to have a consistent relaxing and cute style including the buttons and the slime itself.
How My Project Works and What I’m Proud Of
The game starts with an instructions page that explains how to play. Once the user clicks the start button, they can customize their slime by selecting a color, face, and charm. I used arrays and “for” loops to organize the options rather than writing separate code for every single button. When the user clicks an option, the program saves their choice using variables like slimeColor, slimeFace, and slimeItem. These choices are then used to display the customized slime. I am proud of this part because there are multiple combinations the user can create, and I wanted the customization process to be simple and easy to understand.
let rows = [252, 357, 462];
for (let row = 0; row < 3; row++) {
for (let i = 0; i < OPTIONS_X.length; i++) {
if (
dist(
gameMouseX(),
gameMouseY(),
OPTIONS_X[i],
rows[row]
) < 22
) {
if (row === 0) slimeColor = i;
if (row === 1) slimeFace = i;
if (row === 2) slimeItem = i;
return;
}
}
}
This part of my code uses nested for loops and the dist() function to check which color, face, or charm the user clicks on. I used this instead of writing separate code for every button, which made everything a lot more organized.
One of my favorite parts is the actual slime interactions. After creating their slime, the user can poke, stretch, or shake it. Instead of just changing the size of the slime like I originally planned in my sketch (process pic below), I decided to use different PNG images to show what the slime looks like during each action. I think this made the interactions look a lot better because I had more control over the appearance of the slime. I also added a sound effect for the poking to make the actions more satisfying and the shake button moving the slime in a quick motion.

(^When slime is stretched originally)

(Process pictures)
Another thing I’m proud of is making the game work in fullscreen mode. Originally, I designed everything around a fixed canvas size, so when I tried making the canvas fullscreen, the buttons and images were not positioned correctly. I eventually used scaling and offset calculations to keep the game’s proportions consistent across different screen sizes. I also had to adjust the mouse coordinates so that the buttons would still work after scaling, and then I used Professor Mang’s example sketch for clicking “F” to enter and exit full screen. This was probably one of the more confusing parts of the project, but I learned a lot from fixing it. I also included a way for users to restart the experience from within the game by including a button instead of having to press the p5.js Play button again.
function gameMouseX() {
return (mouseX - gameOffsetX) / gameScale;
}
function gameMouseY() {
return (mouseY - gameOffsetY) / gameScale;
}
Problems and Areas for Improvement
One of the biggest problems I ran into was organizing all the different PNG images for the slime. Since the user can choose different colors, faces, and charms, I had to make sure the correct images appeared depending on what they selected. It got a little confusing because I had so many images to keep track of, and sometimes the wrong image would show up or something wouldn’t work the way I wanted it to. I also struggled with making the interactions look realistic. At first, I thought simply changing the slime’s size would be enough, but after testing it, I realized it didn’t really look like slime being stretched or poked. This is why I decided to use different PNGs for the actions instead, and then I also ran into issues with the new version of p5.j and the load images would not work.
Another thing I struggled with was drawing the different slime images and making sure everything matched properly. Sometimes the faces wouldn’t line up with the slime, or the sizes would be completely off when I tried displaying them in the game. This was especially frustrating because the drawings looked fine on their own, but once I put them into p5.js, they didn’t always fit together the way I wanted. I had to keep going back and adjusting the sizes and positions of the images until everything looked mostly right. I didn’t expect this part to be so difficult because I thought drawing the slime would be one of the easier parts of the project!
If I had more time, I would definitely want to make the slime more interactive. Right now, the user has to click buttons to poke, stretch, or shake it, but I think it would be so much cooler if they could actually interact with the slime directly. For example, dragging the slime with the mouse to stretch it or clicking anywhere on it to poke it. I would also love to add more slime textures, colors, and charms, and maybe even different sound effects for each action. Originally, I had planned to draw the charms but there were too many issues with that, so i ended up just using emojis for the charms, but that’s definitely something I wish I could have changed.
References
p5.js Reference: https://p5js.org/reference/
I used p5.js functions throughout my project, especially mousePressed() for the buttons, dist() for detecting which customization option the user clicked, and loadImage() to display the different slime PNGs. I also worked with windowResized() and resizeCanvas() when trying to make the game fullscreen.
Slime Games and Videos – A lot of my inspiration came from my childhood because I used to be obsessed with slime. I loved watching slime videos and experimenting with different colors and textures. I wanted to recreate that same experience digitally, especially the customization and satisfying interactions.
Professor Mangs Lecture Notes –
I referred to Professor Mang’s lecture notes to help me understand some of the coding concepts we covered in class and how I could apply them to my Slime Lab project. The notes were useful when working with functions, loops, and organizing different parts of my code as well as how to upload sound into my sketch.
https://github.com/mangtronix/IntroductionToInteractiveMedia/blob/master/lectureNotes.md#week-5
https://editor.p5js.org/mangtronix/sketches/t4G0erH1B
Coding Train videos –
For creating Mouse Interactions- https://youtu.be/TaN5At5RWH8?si=_xHhlhbPZx7t5YrJ
Arrays of Objects –https://youtu.be/fBqaA7zRO58?si=NP9jlVjqXL85jS7C
Fonts Used:
https://fonts.google.com/specimen/Fredoka
https://fonts.google.com/specimen/Nunito
Background Music: https://freesound.org/people/Seth_Makes_Sounds/sounds/701610/
Poke sound: https://freesound.org/people/kuchenanderung1/sounds/340794/
AI Statement
I used ChatGPT for this project when I got stuck on something and couldn’t figure out what was going wrong. Most of the time, I knew exactly what I wanted my game to do, but I didn’t always know how to actually code it. I would try things myself first, and if they weren’t working, I would ask ChatGPT to help me figure out what I was doing wrong. I also asked it to explain certain functions because sometimes I would get the code working but still not fully understand why it worked.
I also used it when I was struggling with the customization options, especially organizing everything using arrays and nested for loops. Another issue I kept running into was with my PNG images. For some reason, whenever I tried uploading multiple images at once, they would sometimes get corrupted or wouldn’t load properly, and I couldn’t figure out why. I used ChatGPT to help troubleshoot this and figure out how to organize and display the correct images. (I did not use Ai for any image generating)


