Beispiel #1
0
void initbags(void)
{
  Sint4 bag,x,y;
  pushcount=0;
  goldtime=150-levof10()*10;
  for (bag=0;bag<BAGS;bag++)
    bagdat[bag].exist=FALSE;
  bag=0;
  for (x=0;x<MWIDTH;x++)
    for (y=0;y<MHEIGHT;y++)
      if (getlevch(x,y,levplan())=='B')
        if (bag<BAGS) {
          bagdat[bag].exist=TRUE;
          bagdat[bag].gt=0;
          bagdat[bag].fallh=0;
          bagdat[bag].dir=DIR_NONE;
          bagdat[bag].wobbling=FALSE;
          bagdat[bag].wt=15;
          bagdat[bag].unfallen=TRUE;
          bagdat[bag].x=x*20+12;
          bagdat[bag].y=y*18+18;
          bagdat[bag].h=x;
          bagdat[bag].v=y;
          bagdat[bag].xr=0;
          bagdat[bag++].yr=0;
        }
  if (curplayer==0)
    memcpy(bagdat1,bagdat,BAGS*sizeof(struct bag));
  else
    memcpy(bagdat2,bagdat,BAGS*sizeof(struct bag));
}
Beispiel #2
0
void makeemfield(void)
{
  int16_t x,y;
  emmask=1<<curplayer;
  for (x=0;x<MWIDTH;x++)
    for (y=0;y<MHEIGHT;y++)
      if (getlevch(x,y,levplan())=='C')
        emfield[y*MWIDTH+x]|=emmask;
      else
        emfield[y*MWIDTH+x]&=~emmask;
}
Beispiel #3
0
void makefield(void)
{
  int16_t c,x,y;
  for (x=0;x<MWIDTH;x++)
    for (y=0;y<MHEIGHT;y++) {
      field[y*MWIDTH+x]=-1;
      c=getlevch(x,y,levplan());
      if (c=='S' || c=='V')
        field[y*MWIDTH+x]&=0xd03f;
      if (c=='S' || c=='H')
        field[y*MWIDTH+x]&=0xdfe0;
      if (curplayer==0)
        field1[y*MWIDTH+x]=field[y*MWIDTH+x];
      else
        field2[y*MWIDTH+x]=field[y*MWIDTH+x];
    }
}