3 Ways of Worldmaking: Procedural Environments



1. Generative Strategies

Randomness

A simple random starfield background with objects:

 function makeStar(){
    var star = createSprite(random(width), 0, 2, 2);
    star.velocity.x = 0;
    star.velocity.y = random(3,10);
    star.life = 200;
    star.shapeColor = color(255,255,255,150);
    stars.add(star);
  }
      
  

Perlin Noise



2. Sound

Loading MP3 Files

loading MP3 in the preload() function.

    
        
  

Playing back the MP3

    
          
  

Assignment
Find or record a sound and use it for the shots of the space ship.

Generating Sounds