Enjoy programming more!
Kidspod is a post site which supports young programmers.
First step to join us.
Register as a member
For members

2017/09/19 10:30:11

MixJuice GET URL : kidspod.club/mj/299

011

  • No registered tag exist.

SOURCE CODE

var a;
var x;
var u;
var y;
var j;
var s;

j = 500;
s = 1;

while(1){

  while(inkey() != 0){
    inkey();
  }

  a = rnd(32);
  x = 15;
  y = 22;
  u = 1;
  cls();
  lc(12, 12);
  log("STAGE ", s);
  sleep(1000);

  while(inkey() != 32){
    x = x + u;
    if( x >= 31){
      u = -u;
    }
    if( x <= 0){
      u = -u;
    }

    cls();
    lc (a, 3);
    log("X");
    lc(x, 22);
    log("_");
    sleep(j);
  }

  while(1){
    y = y - 1;
    if( y <= 0){
      cls();
      lc(10, 12);
      log("GAME OVER!!");
      j = 500;
      s = 1;
      sleep(1000);
      break;
    }

    if((a == x) * ( y == 3)){
      cls();
      lc(10, 12);
      log("STAGE CLEAR!!");
      j = j - 50;
      s = s + 1;
      sleep(1000);
     break;
    }
    
    cls();
    lc (a, 3);
    log("X");
    lc(x, y);
    log("_");
    sleep(100);
  }
}

COMMENT