Peace, Love and Happiness!

Hello folks!

I was inspired by something I read reflecting on the 60’s.

Code
// Author: GLV
// Date: 2026-04-07

// Description: 
// Peace,love and happiness

// Some rough and unrefined code as intended.
// Focus is on the visual. Enjoy!

// Images from here:
// https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Heart_coraz%C3%B3n.svg/500px-Heart_coraz%C3%B3n.svg.png
// https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Emojione_BW_262E.svg/500px-Emojione_BW_262E.svg.png
// Smiley face from ChatGPT.

PImage peace;
PImage love;
PImage happiness;

public void settings() 
  { 
  size(1200, 400, P3D); 
  }

public void setup()
  {
  peace = loadImage("Emojione_BW_262E.svg.png");
  peace.resize(320, 320);

  love = loadImage("Heart_corazón.svg.png");
  love.resize(350, 350);
  
  happiness = loadImage("Smiley.png");
  happiness.resize(450, 450);
  
  background(0);
  ortho();
  }
  
public void draw()
  {
  lights();  
  noStroke();  
  
  if(frameCount < 4000)
    {
    //Peace
    int x = (int) random(400); 
    int y = (int) random(400);  
    int c = peace.get(x, y);  
    if( c == color(0))
      {
      fill(255, 255, 0);
  
     pushMatrix();
      translate(x+40, y+40);
      sphere(5);
     popMatrix();
      } 
  
    //Love
    x = (int) random(400); 
    y = (int) random(400);  
    c = love.get(x, y);  
    if( !(brightness(c) < 128))
      {
      fill(255, 0, 0);
  
     pushMatrix();
      translate(x+400+25, y+25);
      sphere(5);
     popMatrix();
      }     
  
    //Happiness
    x = (int) random(400); 
    y = (int) random(400);  
    c = happiness.get(x, y);  
    if( (brightness(c) < 128))
      {
      fill(#8FFF7A);
  
     pushMatrix();
      translate(x+800-25, y-25);
      sphere(5);
     popMatrix();
      }
    }  
  else
    noLoop();
  
  // Markers
  //strokeWeight(10);
  //stroke(255);
  //point(200, height/2);
  //point(200+400, height/2);
  //point(200+400+400, height/2);
    
  //println(frameCount);    
  }

void keyPressed()
  {
  background(0);
  frameCount = 0;
  }

The happy face looks sad!

Reminded me of this:

“You can’t wait until life isn’t hard anymore before you decide to be happy.”

Quote by Jane “Nightbirde” Marczewski, from her America’s Got Talent appearance, 2021.

Make the best of every day!

:)

2 Likes