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/21 20:29:25

MixJuice GET URL : kidspod.club/mj/357

ミサイルゲームv3

  • No registered tag exist.

SOURCE CODE

var my;
var ex;
var ey;
var ef;
var key;
var score;
my = 23;
ex = -1;
score = 0;
while(1){
  cls();
  key = inkey();
  if (key == 32){
    my = my - 1;
  }
  else{
    my = my + 1;
  }
  if(my > 23){
    my = 23;
  }
  if (my < 0){
    my = 0;
  }
  lc(15, my);
  log("|");

  if((ex == -1) + (ex == 24)){
    ey = rnd(24);
    ef = rnd(2);
    if(ef == 0){
      ex = 0;
    }
    else{
      ex = 23;
    }
  }

  if(ef == 0){
    ex = ex + 1;
  }
  else{
    ex = ex - 1;
  }

  lc(ex, ey);
  log("-");

  if((ex == 15) * (my == ey)){
    lc(15, my);
    log("@");
   score = score + 1;
  }

  lc(0, 0);
  log("score:");
  log(score);

  if (score == 3){
    lc(12, 11);
    log("CLEAR!!");
    sleep(3000);
    break;
  }

  sleep(200);
}

COMMENT

Kidspod運営チーム
Kidspod運営チーム2017/09/22 16:18:25

バージョンが上がるにつれて、どんどんゲームらしくなっていって凄い! "|"の動きが独特で、うまく"-"に当てるのが難しいです……!