/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.gXGfu4u7RY7/rev.982
*
* authors:
* Honza
* mkin
*
* Kryštof Pešek
* mkin
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
color c = color(#111111);
PFont font;
void setup(){
size(320,240);
noSmooth();
font = createFont("Arial",48);
textFont(font);
}
void draw(){
background(c);
mapuj();
caradruha();
neco();
pushStyle();
fill(255,255,85,30);
for( int i = 0 ; i < 10 ; i += 1){
//println(i);
text("ahoj!",mouseX+noise((i+frameCount)/10.0)*60,100);
}
stroke(#ff0000);
for(int i = 0 ;i<width;i++){
line(i,noise((i+frameCount)/30.0)*height,i,noise((i+frameCount)/30.0)*height+1);
}
popStyle();
}
void mapuj(){
pushStyle();
float x,y;
x = (int)map(mouseX,0,width,0,200);
y = 40;
rect(x,y,30,30);
popStyle();
}
void caradruha() {
line (mouseX,mouseY,mouseX+40,mouseY+40);
}
void neco() {
pushStyle();
fill (128,128,128);
stroke (128);
rect (160+mouseY-mouseX,120+mouseX-mouseY,10+(mouseX/3),10+(mouseX/3));
popStyle();
}