/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://accdf12.sketchpad.cc/sp/pad/view/ro.-IkZsnEDt-6/rev.16
*
* authors:
* Siyun Oh
* Michael Kontopoulos
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
/* @pjs preload="/static/uploaded_resources/p.6583/sun.png"; "/static/uploaded_resources/p.6583/satellite.png"; "/static/uploaded_resources/p.6583/planet.png"; */
PImage sun, sat, planet;
void setup() {
size(640, 480);
sun = loadImage("/static/uploaded_resources/p.6583/sun.png");
sat = loadImage("/static/uploaded_resources/p.6583/satellite.png");
planet=loadImage("/static/uploaded_resources/p.6583/planet.png");
frameRate(1);
smooth();
imageMode(CENTER);
}
void draw() {
background(0);
float scaler;
//Having a little fun with probability. Consider this a "dice roll"
//to determine if the image is displayed. Not necessary; Just for demo purposes.
if (random(100) > 30) {
scaler = random(0.1, 2.0);
image(sun, random(width), random(height), sun.width*scaler, sun.height*scaler);
}
if (random(100) > 10) {
scaler = random(0.1, 5.0);
image(planet, random(width), random(height), sun.width*scaler, sun.height*scaler);
}
if (random(100) > 50) {
scaler = random(0.1, 5.0);
image(sat, random(width), random(height), sun.width*scaler, sun.height*scaler);
}
}