/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.$NjgplbfTFy/rev.327
*
* authors:
* LUZ MARCELA CAROLINA AYALA LIZARAZO
* 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.3681/fondo.jpg";
crisp="true";
*/
/** Marylin
UNIVERSIDAD DE LOS ANDES
ESPECIALIZACION EN CREACION MULTIMEDIA
MEDIOS COMPUTACIONALES
LUZ MARCELA CAROLINA AYALA LIZARAZO*/
Marylin fotosmary;
Marylin2 fotosmary2;
Marylin3 fotosmary3;
Marylin4 fotosmary4;
int i;
int arr=10;
PImage mar;
void setup()
{
fotosmary= new Marylin();
fotosmary2= new Marylin2();
fotosmary3= new Marylin3();
fotosmary4= new Marylin4();
size(719, 600);
mar = loadImage("/static/uploaded_resources/p.3681/fondo.jpg");
background(mar);
}
void draw()
{
background(mar);
fotosmary.pintar();
fotosmary.mover();
fotosmary2.pintar2();
fotosmary2.mover2();
fotosmary3.pintar3();
fotosmary3.mover3();
fotosmary4.pintar4();
fotosmary4.mover4();
}
//clase 1
class Marylin
{
PImage pict1;
float x;
float r;
float velx;
//método constructor
Marylin()
{
pict1 = loadImage("/static/uploaded_resources/p.3681/marylin1.png");
r = -0.2;
//x = 0.1;
velx = 1;
}
//método pintar
void pintar()
{
translate(x, 100);
rotate(r);
imageMode(CENTER);
image(pict1, 0, 0);
}
//método mover
void mover()
{
r = r - 0.1;
x = x + velx;
if(x > width)
{
x = 0.1;
}
}
}
//clase 2
class Marylin2
{
PImage pict2;
float x2;
float y2;
float r2;
float velx2;
float vely2;
//método constructor
Marylin2()
{
pict2 = loadImage("/static/uploaded_resources/p.3681/marylin2.png");
r2 = 0.2;
//x2 = 0.1;
velx2 = 1;
vely2 = 1;
//y2 = height;
}
//método pintar
void pintar2()
{
resetMatrix();
translate(x2, height - y2);
rotate(r2);
imageMode(CENTER);
image(pict2, 0, 0);
}
//método mover
void mover2()
{
r2 = r2 + 0.1;
x2 = x2 + velx2;
y2 = y2 + vely2;
if(x2 > width)
{
x2 = 0.1;
y2 = height - y2;
}
}
}
//clase 3
class Marylin3
{
PImage pict3;
float x3;
float y3;
float r3;
float velx3;
float vely3;
//método constructor
Marylin3()
{
pict3 = loadImage("/static/uploaded_resources/p.3681/marylin3.png");
r3 = -0.2;
//x2 = 0.1;
velx3 = 1;
vely3 = 1;
//y2 = height;
}
//método pintar
void pintar3()
{
resetMatrix();
translate(width - x3, height - y3);
rotate(r3);
imageMode(CENTER);
image(pict3, 0, 0);
}
//método mover
void mover3()
{
r3 = r3 - 0.1;
x3 = x3 + velx3;
y3 = y3 + vely3;
if(x3 > width)
{
x3 = 0.1;
y3 = height - y3;
}
}
}
//clase 4
class Marylin4
{
PImage pict4;
float x4;
float r4;
float velx4;
//método constructor
Marylin4()
{
pict4 = loadImage("/static/uploaded_resources/p.3681/marylin4.png");
r4 = 0.2;
x4 = width;
velx4 = 1;
}
//método pintar
void pintar4()
{
resetMatrix();
translate(x4, 300);
rotate(r4);
imageMode(CENTER);
image(pict4, 0, 0);
}
//método mover
void mover4()
{
r4 = r4 + 0.1;
x4 = x4 - velx4;
if(x4 < 0)
{
x4 = width;
}
}
}