Untitled

 avatar
unknown
plain_text
a year ago
2.5 kB
3
Indexable
var xpos = 100;
var ypos = 350;
var listycord = [(getYPosition("image2")), (getYPosition("image3")), (getYPosition("image6"))];
//starts game makes it game escreen
onEvent("start", "click", function( ) {
  //shows win screen once frog pass
  setScreen("screen2");
  timedLoop(1, function() {
    if (ypos<-5) {
      setScreen("screen3");
    } else {
      xpos = getXPosition("image4");
      ypos = getYPosition("image4");
      onEvent("bu", "click", function( ) {
        setPosition("image4", xpos+0, ypos-50);
      });
    }
  });
  //makes frog jump
});
//second aligator moves
var bpos = -4;
var bord = false;
timedLoop(2, function() {
  if (bpos>320) {
    bord = true;
  }
  bpos = getXPosition("image3"); 
  listycord = getYPosition("image3");
  if (bord == false) {
    setPosition("image3", bpos+2, 125);
  } else {
    setPosition("image3", bpos-60, 125);
  }
  if ((bpos<(xpos+40))&&(xpos+40<(bpos+100))) {
   if (listycord<(ypos+40)&&(ypos+40<listycord+100)) {
      setScreen("screen4");
    }
  }
});
function froggycros(bpos,hpos,xchange,image,ycord) {
  var bord = false;var bpos = getXPosition(image);
  var hpos = getYPosition(image);timedLoop(2, function() {
  if (bpos>320) {
    bord = true;
  }
  bpos = getXPosition(image); 
  listycord = getYPosition(image);
  if (bord == false) {
    setPosition("image3", bpos+xchange, ycord);
  } else {
    setPosition("image3", bpos-xchange, ycord);
  }
  if ((bpos<(xpos+40))&&(xpos+40<(bpos+100))) {
   if (listycord<(ypos+40)&&(ypos+40<listycord+100)) {
      setScreen("screen4");
    }
  }
  });
  
}
//third aligator moves
var kpos = -4;
var bod = false;
timedLoop(2, function() {
  if (kpos>320) {
    bod = true;
  }
  kpos = getXPosition("image6");
  listycord = getYPosition("image6");
  if (bod == false) {
    setPosition("image6", kpos+3, 0);
  } else {
    setPosition("image6", kpos-2, 0);
  }
  if ((kpos<(xpos+40))&&(xpos+40<kpos+100)) {
   if (listycord<(ypos+40)&&(ypos+40<listycord+100)) {
      setScreen("screen4");
    }
  }
});
//first aligator moves
var apos = getXPosition("image2");
var border = false;
timedLoop(2, function() {
  if (apos>320) {
    border = true;
  }
  apos = getXPosition("image2");
  listycord = getYPosition("image2");
  if (border == false) {
    setPosition("image2", apos+3, 280);
  } else {
    setPosition("image2", apos-4, 280);
  }
  //hit box
  if (apos<(xpos+40)&&(xpos+40<apos+100)) {
   if (listycord<(ypos+40)&&(ypos+40<listycord+100)) {
      setScreen("screen4");
    }
  }
});
Editor is loading...
Leave a Comment