home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 March / VPR9803A.ISO / Ffilly / FILLY18F / SKIP.TFY < prev    next >
Text File  |  1996-12-05  |  4KB  |  150 lines

  1. //TOFFYシナリオのひな型
  2.  
  3. //作品情報(""内を書き換えて下さい)
  4. #info INAM "Cast Sample"
  5. #info ICMT "左クリックしてね。右クリックで終了"
  6. #info ISBJ "スキップ冬里ちゃん"
  7. #info IART "ともゆん"
  8. #info ICOP "ともゆん"
  9. #info ICOP "(c)Tomoyuki.Uchida"
  10. #info VIDO "640x400; 256"
  11. #info GRPC "Tomoyuki,SDI00687@niftyserve.or.jp"
  12.  
  13.  
  14. int musi_pic, tatumaki_pic, skip_pic, base_pic,base_pic_x, base_pic_y; //このようにグローバルに取らないと各関数から見えなくなります
  15.  
  16. //シナリオ本体
  17. main(){
  18. //ここからシナリオを書き始めて下さい
  19.  
  20.   int BackPic, PicLeft, PicRight, PicTop, PicBottom;
  21.  
  22.   BackPic=LoadPic("yun_245.bmp");//背景を読み込みまーす
  23.   base_pic=CreatePic(0);    //背景と同じサイズのピクチャーを生成(中は汚いけどね(^^;)
  24.  
  25.   PutCast(0,base_pic,0,0);//背景を設定(透明色は無しモード)
  26.   base_pic_x=PicWidth(BackPic);
  27.   base_pic_y=PicHeight(BackPic);
  28.   PicLeft=(WinInfo(0)-base_pic_x)/2-1;
  29.   PicRight=(WinInfo(0)+base_pic_x)/2-1;
  30.   PicTop=(WinInfo(1)-base_pic_y)/2-1;
  31.   PicBottom=(WinInfo(1)+base_pic_y)/2-1;
  32.  
  33.   CapTitle("");    //ウィンドウの上のキャプションバーを消します。
  34.  
  35.   OpenWin( base_pic,
  36.      -1,    //スクリーンの左上隅からちょっとだけ左
  37.     -1,    //スクリーンの左上隅からちょっとだけ上 (ウィンドウの枠を消したいので)
  38.     WinInfo(0),    //スクリーンの横幅と同じ大きさのサイズ
  39.     WinInfo(1),    //縦の高さのサイズ
  40.     -PicLeft+1,    //ピクチャーの表示を画面の中央に、、、
  41.     -PicTop+1,    //同じく
  42.     0);        //バックグラウンドを黒に
  43.  
  44.   musi_pic=LoadPic("tb.bmp");//虫さんキャスト元データ
  45.   tatumaki_pic=LoadPic("tb2.bmp");//竜巻
  46.   skip_pic=LoadPic("skip.bmp");//スキップ
  47.  
  48.   mes(LBDOWN){
  49.     if(MesP2>=PicLeft&&MesP2<PicRight&&MesP3>=PicTop&&MesP3<PicBottom){
  50.     PlayWAVE("pom.wav");
  51.     i=Random(3);
  52.     if(i==0){
  53.         Skip(MesP2-PicLeft, MesP3-PicTop);//マウスクリックでスキップ始め
  54.     }else{
  55.         if(i==1){
  56.             Musi(MesP2-PicLeft, MesP3-PicTop);//マウスクリックで虫始め
  57.         }else{
  58.             Tatumaki(MesP2-PicLeft, MesP3-PicTop);//マウスクリックで竜巻始め
  59.         }
  60.     }
  61.     }else{
  62.     PlayWAVE("shuu.wav");
  63.     }
  64.   }
  65.  
  66. //ここまでに書いてください
  67. }
  68.  
  69. Skip(int xpos, int ypos)
  70. {
  71.  int skip_cast;
  72.  xpos=xpos-50;
  73.  ypos=ypos-100;
  74.  skip_cast = PutCast( skip_pic, base_pic, xpos, ypos, 0xffffff, 0, 0, 1, 104,195, 0, 0 );//0xffffは背景色の白色
  75.  mes(TIME){
  76.     step( 4 ) {
  77.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 0,0 ); ,
  78.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 104,0 ); ,
  79.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 208,0 ); ,
  80.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 312,0 ); ,
  81.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 416,0 ); ,
  82.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 0,200 ); ,
  83.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 104,200 ); ,
  84.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 208,200 ); ,
  85.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 312,200 ); ,
  86.     MoveCast( skip_cast, skip_pic, xpos, ypos, 0, 104, 195, 416,200 ); 
  87.     }
  88.     step(100){,
  89.     DelCast(skip_cast);
  90.     del_me; 
  91.     }
  92.     step(4){
  93.     xpos=xpos+Random(5)-25;
  94.     ypos=ypos+Random(5)-5;
  95.     if(xpos<-50||ypos<-100){
  96.         DelCast(skip_cast);
  97.         del_me; 
  98.     }
  99.  
  100.     }
  101.  }
  102. }
  103.  
  104. Musi(int xpos, int ypos)
  105. {
  106.  int musi_cast, diffx, diffy, basex, basey;
  107.  xpos=xpos-PicWidth(musi_pic)/2;
  108.  ypos=ypos-PicHeight(musi_pic)/2;
  109.  
  110.  musi_cast = PutCast( musi_pic, base_pic, xpos, ypos, 0xffffff );//0xffffffは背景色の白色
  111.  mes(TIME){
  112.     step( 4 ) {
  113.     if(xpos<-50||xpos>=base_pic_x||ypos<-50||ypos>=base_pic_y){
  114.         DelCast(musi_cast);
  115.         del_me;//画面から外れたら終了
  116.     }
  117.     MoveCast( musi_cast, musi_pic, xpos, ypos );
  118.     xpos=xpos+Random(50)-25;
  119.     ypos=ypos+Random(50)-25;
  120.     }
  121.     step(100){,
  122.     DelCast(musi_cast);
  123.     del_me;
  124.     }
  125.  }
  126. }
  127.  
  128. Tatumaki(int xpos, int ypos)
  129. {
  130.  int tatumaki_cast;
  131.  xpos=xpos-PicWidth(tatumaki_pic)/2;
  132.  ypos=ypos-PicHeight(tatumaki_pic)/2;
  133.  tatumaki_cast = PutCast( tatumaki_pic, base_pic, xpos, ypos, 0xffffff );//0xffffffは背景色の白色
  134.  mes(TIME){
  135.     step( 6 ) {
  136.     if(xpos<-50||xpos>=base_pic_x||ypos<-50||ypos>=base_pic_y){
  137.         DelCast(tatumaki_cast);
  138.         del_me;//画面から外れたら終了
  139.     }
  140.     MoveCast( tatumaki_cast, tatumaki_pic, xpos, ypos );
  141.     xpos=xpos+Random(30)-15;
  142.     ypos=ypos+Random(30)-15;
  143.     }
  144.     step(100){,
  145.     DelCast(tatumaki_cast);
  146.     del_me;
  147.     }
  148.  }
  149. }
  150.