Here is the video of the animation:
Here is the link to the zipfile:
https://www.dropbox.com/s/0kskaa0kn8l2wa2/zipweek4.zip?dl=0
And for the last here is the coding of the work:
//project week 5
int rectX = 0;
PImage star;
PImage shining;
PImage sceneri;
PImage girls;
PImage minion;
PImage bluelight;
float movex=112;
float movey=202;
float xpos=1;
float ypos=1;
PFont font1;
float angle = 0;
float a=2;
float c=random( 109, 143);
float lightX = 0;
float speedX = 0.5;
float clickCount=0;
void setup() {
size (600, 600);
background(0, 0, 0);
sceneri = loadImage("scenari.png");
star = loadImage("star.png");
girls = loadImage("girls.png");
minion = loadImage("minion.png");
shining = loadImage("shining.png");
font1 = loadFont("Yikatu-48.vlw");
bluelight = loadImage("bluelight.png");
}
void draw() {
background(random(101),random(220),random(250));
rotate(angle);
pushMatrix();
//sceneri where the girls acts in
pushMatrix();{
sceneri.resize(700, 1000);
image(sceneri, 285, 300);
image(sceneri, 0, 0, width/400, height/400);
popMatrix();
}
//backround bluelight
pushMatrix();{
bluelight.resize(1200, 1200);
image(bluelight, CENTER, CENTER);
image(bluelight, 0, 0, width/500, height/700);
popMatrix();
}
// Click the mouse to appear the girls in the scenario
if (mousePressed) {
imageMode(CENTER);
girls.resize(435, 435);
image (girls, xpos, ypos);
}
else {
star.resize(185, 185);
image (star,xpos, ypos);
image(star, 0, 0, width/200, height/200);
}
//controls of the movement of the star
{
if (keyPressed)
{
if (keyCode==UP) {
ypos -=1;
} else if (keyCode==DOWN) {
ypos +=1;
{
}
} else if (keyCode == LEFT) {
xpos -=1;
{
}
} else if (keyCode== RIGHT) {
xpos +=1;
}
{
}
}
//limitatons so the star do not go outside of the canvas
if (xpos <= 100){
xpos = 100;
}
if (xpos>=500){
xpos = 500;
}
if (ypos <= 220){
ypos = 220;
}
if (ypos >= 600){
ypos = 600;
}
popMatrix();}
//the public of the show, minions go up by click the mouse
pushMatrix();{
minion.resize(600, 420);
if (mousePressed) {
image(minion, 300, 470);
}else{
image(minion, 300, 490);
}
popMatrix();
//shining lights in the backround
pushMatrix();{
translate ( c,random(1));
shining.resize(500, 500);
image(shining, 300, 300);
image(shining, 0, 0, width/300, height/300);
delay(10);
popMatrix();
}
//welcome text
pushMatrix();{
{
textFont(font1);// use font1
delay(2);
fill(161, 220, 250);
textSize(100);
text("welcome", 105, 95);
popMatrix();
}}
}
}