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/19 18:31:33

MixJuice GET URL : kidspod.club/mj/430

無題

  • No registered tag exist.

SOURCE CODE

function attack(cs, ps){
  var x, y, xx, yy, sy;

  if(cs == 1){
    xx = 8;
    yy = 4;
    sy = 20;
  }

  if(cs == 2){
    xx = 5;
    yy = 3;
    sy = 14;
  }

  if(cs == 3){
    xx = 3;
    yy = 2;
    sy = 8;
  }

  if(cs == 4){
    xx = 1;
    yy = 1;
    sy = 4;
  }

  x = 16 - xx;
  y = sy;
  while(y < sy + yy){
    while(x < 16+xx){
      lc(x, y);
      log("@");
      x = x + 1;
    }
    x = 16 - xx;
    y = y + 1;
  }

}
var cs = 0;
var ink;
while(true){
  cls();
  ink = inkey();
  while(inkey() != 0){
  }
  if((cs == 0) * (ink == 32)){
    cs = cs + 1;
  }
  if (cs > 0){
    attack(cs, 1);
    cs = cs + 1;
  }
  if (cs > 4){
    cs = 0;
  }
  sleep(100);
}

COMMENT