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

2017/11/05 11:05:57

MixJuice GET URL : kidspod.club/mj/394

082

  • No registered tag exist.

SOURCE CODE

var a;
var key;
var nx;
var flag;
var sco;
var time;
a = 22;
flag = 0;
sco = 0;
time = 1000;
nx = 0;

while(1){
 key = inkey();
 if(key == 32){
  a = a - 5;
 }
 if(a < 22){
  a = a + 1;
 }
 
 if(flag == 0){
  if(nx < 30){
   nx = nx + 1;
  }
  else{
   nx = nx - 1;
   flag = 1;
  }
 }
 if(flag == 1){
  if(nx > 0){
   nx = nx - 1;
  }
  else{
   nx = nx + 1;
   flag = 0;
  }
 }
 
 
 if((a == 22) * (nx == 15)){
  break;
 }
 
 if(time == 0){
  break;
 }
 sco = sco + 1;
 time = time - 1;
 
 cls();
 lc(15, a);
 log(chr(0xEE));
 lc(nx, 22);
 log("_");
 lc(0, 0);
 log("SCORE:");
 log(sco);
 lc(22, 0);
 log("TIME");
 log(time);
 sleep(20);
}

if(time == 0){
 lc(13, 11);
 log("CLEAR");
}

if((a == 22) * (nx == 15)){
 lc(11, 11);
 log("GAME OVER");
}

COMMENT