Week 5: Midterm Progress

Concept:

I decided on a calming spa game where the user (or viewer) sees a person lying in a clinic setting, complete with subtle animations like steam or aroma particles. Even though I haven’t fully finalized all interactivity elements, my plan is to allow some simple interactions, such as choosing different spa treatments or changing certain visual elements. For now, the main focus is creating the environment and making it look professional and aesthetically pleasing.

Code and Design:

I started laying out the main structure in p5.js. I separated the code into different functions to keep things organized:

  • drawClinicBackground(): Sets the scene with the walls, floor, decorations, and additional details like a window or posters.
  • drawTreatmentBed(): Draws the bed and pillow for the patient.
  • drawPatient(): Renders the patient’s upper body and face, including minimal facial features.
  • drawSteam(): Handles the animation of steam or aroma particles rising around the face.

I’m also planning to introduce classes if the animation or interactivity becomes more complex, especially if I need multiple interactive objects or more sophisticated animations. This modular approach helps keep things clean. If I need to expand later—maybe adding sound effects, more interactive objects, or advanced animations—I can easily integrate new code.

This is what the design is supposed to look like:

Version 1.0.0

Frightening/Challenging aspects:

One of the most uncertain parts of my project is making the environment feel truly interactive and alive. I’m worried about how performance might be affected if I add a lot of animations or interactive elements at once. Another concern is making sure the art style and animations blend nicely so that the scene doesn’t look disjointed.

To reduce this risk, I wrote some test code to experiment with particle systems and layering. Specifically, I tested out how many steam particles I can animate in real-time without causing a slowdown. I also experimented with gradient backgrounds, images, and more detailed drawings to see how far I could push the visuals before I start seeing performance drops.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function drawSteam() {
// Draw and update each steam particle
noStroke();
for (let i = 0; i < steamParticles.length; i++) {
let p = steamParticles[i];
fill(255, 255, 255, p.alpha);
ellipse(p.x, p.y, p.size, p.size);
// Move the particle upwards
p.y -= p.speed;
// Small horizontal "drift"
p.x += map(noise(p.y * 0.01, p.x * 0.01), 0, 1, -0.2, 0.2);
// Gradually fade out
p.alpha -= 0.2;
// Reset the particle when it goes out of range
if (p.y < height / 2 - 80 || p.alpha < 0) {
steamParticles[i] = createSteamParticle();
steamParticles[i].y = height / 2 + random(0, 30);
steamParticles[i].alpha = random(100, 150);
}
}
}
function drawSteam() { // Draw and update each steam particle noStroke(); for (let i = 0; i < steamParticles.length; i++) { let p = steamParticles[i]; fill(255, 255, 255, p.alpha); ellipse(p.x, p.y, p.size, p.size); // Move the particle upwards p.y -= p.speed; // Small horizontal "drift" p.x += map(noise(p.y * 0.01, p.x * 0.01), 0, 1, -0.2, 0.2); // Gradually fade out p.alpha -= 0.2; // Reset the particle when it goes out of range if (p.y < height / 2 - 80 || p.alpha < 0) { steamParticles[i] = createSteamParticle(); steamParticles[i].y = height / 2 + random(0, 30); steamParticles[i].alpha = random(100, 150); } } }
function drawSteam() {
  // Draw and update each steam particle
  noStroke();
  for (let i = 0; i < steamParticles.length; i++) {
    let p = steamParticles[i];
    
    fill(255, 255, 255, p.alpha);
    ellipse(p.x, p.y, p.size, p.size);
    
    // Move the particle upwards
    p.y -= p.speed;
    // Small horizontal "drift"
    p.x += map(noise(p.y * 0.01, p.x * 0.01), 0, 1, -0.2, 0.2);
    // Gradually fade out
    p.alpha -= 0.2;
    
    // Reset the particle when it goes out of range
    if (p.y < height / 2 - 80 || p.alpha < 0) {
      steamParticles[i] = createSteamParticle();
      steamParticles[i].y = height / 2 + random(0, 30);
      steamParticles[i].alpha = random(100, 150);
    }
  }
}

 

Things to prevent:

  • Overcomplicating the Code: I’m trying not to throw everything in one giant file without structure. By using separate functions (and potentially classes), I’ll keep my code organized and easier to debug.
  • Performance Bottlenecks: Adding too many particles or large images could slow down the sketch. I’m keeping an eye on frame rates and testing on different devices so I can catch performance issues early.
  • Poor User Experience: If I add too many clickable elements or extra features, it might overwhelm the user and make the scene less relaxing. I want a balanced level of interaction that doesn’t feel cluttered.
  • Lack of Testing: I plan to test small sections of the code often, rather than waiting until the end. This way, I can catch bugs and performance issues as soon as they pop up.

One thought on “Week 5: Midterm Progress”

Leave a Reply