Project 11

//stars and sea

var stars =[]
var fish =[]

//object,flying fish 
var flyfish
var x=350
var y=200
var dx;
var c;





function setup() {
createCanvas(450, 250); 

//stars in the sky created 
    for (var i = 0; i < 7; i++){
        var rx = random(width);
        stars[i] = makeStars(rx);
    }

//fish in the ocean created
    for (var i = 0; i < 10; i++){
        var rx = random(width);
        fish[i] = makeFish(rx);
   }
//framerate
    frameRate(10);
}




function draw() {
    background(40,50,105)

//moon in the sky spinning 
push()
translate(325,50)
stroke(255,228,181)
fill(255,228,181)
ellipse(0,0,80,80)
pop()

push()
strokeWeight(0)
translate(325,50)
rotate(frameCount / -100.0);
fill(40,50,105)
ellipse(0,15,70,70)
pop()

//the ocean 
    push();
    strokeWeight(0)
    fill(116,180,230);
    rect(0,180,width, height);
    pop();

//moving star and cloud
loadStar()
addStars()
clearStars()
//moving fish 

loadFish()
clearFish()
addFish();
}

Leave a Reply