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/27 18:27:21

MixJuice GET URL : kidspod.club/mj/378

076

  • No registered tag exist.

SOURCE CODE

var flag;
var s;
var ms;
ms = 200;
var score;
score = 0;
s=0;
flag = 0;
while (1){
  lc(15, 23 - flag);
  log(" ");
 
  if (inkey() == 32){
    flag = (flag + 1) % 2;
  }
 
  if (s == 0){
    lc(30, 22 + rnd(2));
    log(chr(0xF4));
    s = 5;
    ms = ms - 3;
    score = score + 1;
    if (ms < 1){
      ms = 0;
    }
  }
 
  scroll(3);
 
  lc(0,0);
  log("SCORE:");
  log(score);
 
  if (scr(15, 23 - flag) == 0xF4){
    lc(10, 11);
    log("GAME OVER");
    break;
  }
 
  lc(15, 23 - flag);
  log(chr(0xFB));
 
  s = s - 1;
 
  sleep(ms);
}

COMMENT