Midterm Progress: Draft 2

So far so good. Currently, I’m done with 90% of the project. What I have left to do is to change the benchmarks for each level and also replace the circle with characters. I’m still contemplating changing the drop objects to sprites.

Highlights so far:

Places in the code I found challenging are the preloading of the images to use as Backgrounds. Apparently, you can not have two preload functions in two classes. I learned this the hard way.

let B1;
let B2;
let B3;
let B4;
let B5;
let B6;
let B7;
let B8;
let IB;
let GB;
let F1;
let F2;


function preload(){
  B1=loadImage("Background/B1.jpg");
  B2=loadImage("Background/B2.jpg");
  B3=loadImage("Background/B3.jpg");
  B4=loadImage("Background/B4.jpg");
  B5=loadImage("Background/B5.jpg");
  B6=loadImage("Background/B6.jpg");
  B7=loadImage("Background/B7.jpg");
  B8=loadImage("Background/B8.jpg");
  IB=loadImage("Background/IB.jpg");
  GB=loadImage("Background/GB.jpg");
  F1=loadFont("Fonts/Font1.ttf");
  F2=loadFont("Fonts/Font2.ttf");
  
}

 

Another challenging part was the collision of the play with the drop objects. getting the collision to be accurate and finding the right place in my code to place the collision function(method) was the main challenge.

One more challenging part of the code was creating the hover effects for the circle shape. This took me some time to figure out a quite simple method to do so.

createhelp(){
    fill(100);
    if(dist(mouseX,mouseY,370,30)<=20){
      fill(60);
    }
    if(dist(mouseX,mouseY,370,30)<=20&&mouseIsPressed){
      this.helpbool=true;
    }
    circle(370,30,40);
    fill(255,255,0);
    textSize(30);
    textFont(NORMAL);
    text("?",370,40);

 

The Background movement was also an Issue for me as unlike the example given in class, my project was moving the background from top to down.

Also defining the outer boundaries was a challenge in this project but with the use of min(mouseX, width-radius) and min(mouseY, height-radius) I was able to address this.

y.showBG(x.getlvl());
   circle(min(mouseX, 390),min(mouseY,490),20);
   gameoverbool=x.collision();

 

I also faced some challenges with the changing of the levels as the code uses more than 3 classes dependent on each other. All in all I really enjoy programming this project. I am working on adding the sound at the moment and then hopefully I would work on the characters and more. Feel free to give me your suggestions.

Current work:

Leave a Reply