Home Docs Examples Download
Examples
cat samplepac3D


Code
// 3d sample
sprite(1,"cat",2);
sprite(2,"mat1",1);

function init(){
 //-- floor
 c=setmPlane(0,0,-40,2,-1,0,100,100);
 mrx[c]=270;
 maprepeat(c,50,50);
 //-- cats
 for(i=0;i<40;i++){
  for(j=0;j<2;j++){
   c=setm(rnd()*40-20,1,-1-i,1,1);
   ms[c]=2;
  }
 }
 //-- poles
 for(i=0;i<50;i++){
 c=setmCylinder(rnd()*40-20,2.5,-1.5-i,2,-1,0,.5,.5,5);
 }
 //--
 bgcolor("#0000ee");
 setcam(0,2,3,0,0,0);
 sndload(1,"catbgm",2);
}

function move(i){
switch(m[i]){
 //cat
 case 1:
  sx-=.2;
  sy+=syy/2;syy-=.1;
  if(sy<msy[i]){sy=msy[i];srz=0;}
  else{srz=(srz+20)%360;}
  if(sy==msy[i]&&rand(8)==0){syy=1;}
  sn=(sn+1)&1;
  w=8-sz;
  if(sx<-w)sx=w;
  break;
 }
}

function update(){
}

function mousedown(x,y){
}

function mouseup(x,y){
}
2018 N.I