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

  1. //TOFFYシナリオのひな型
  2.  
  3. //作品情報(""内を書き換えて下さい)
  4. #info INAM "すたんぷ文字表示サンプル"
  5. #info ISBJ "慣れると投げられるようになるよ(^_^)"
  6. #info IART "ともゆん"
  7. #info ICOP "(c)Tomoyuki.Uchida"
  8. #info VIDO "640x400; 256"
  9. #info GRPC "Tomoyuki,SDI00687@niftyserve.or.jp"
  10.  
  11. int Red[],Green[],Blue[];
  12. int LastX, LastY;
  13. int Last2X, Last2Y;
  14. //シナリオ本体
  15. main(){
  16. //ここからシナリオを書き始めて下さい
  17.  ColorInit();
  18.  
  19.  OpenWin(LoadPic("filly.bmp"));
  20.  BackMode(1);
  21.  TextWrite("クリックしてね(^_^) (ダブルクリックで終了)");
  22.  
  23.  mes(LBDOWN){   //マウスクリックがあったらFillyの文字書きスタート
  24.     MoveFilly(MesP2,MesP3);
  25.  }
  26.  
  27.  mes(MOUSEMOVE){     //過去のマウスカーソルの位置を保存
  28.     Last2X=LastX;
  29.     Last2Y=LastY;
  30.     LastX=MesP2;
  31.     LastY=MesP3;
  32.  }
  33.  
  34.  mes(LBDBLCLK){    //ダブルクリックで終了
  35. ExitTitle();
  36. //    CloseWin(0);
  37.     //del_all; del_me;
  38.  }
  39.  
  40. //ここまでに書いてください
  41. }
  42.  
  43. MoveFilly(x,y){
  44.     int count, color, Height, x_grad, y_grad;
  45.     color=Random(8);
  46.     SetColor(color);
  47.     Height=Random(150)+10; 
  48.     x_grad=(x-Last2X)*5; //一回ごとのx座標の移動距離
  49.     y_grad=(y-Last2Y)*5; 
  50.     PlayWAVE("Pom.wav");
  51.     WriteFilly(x,y,Height,color);
  52.     count=0;
  53.     mes(TIME){   //  1/20秒毎にここに来ます
  54.     step(10){    // 10回に1回実行
  55.         Clear(x,y,Height); x=x+x_grad; y=y+y_grad; WriteFilly(x,y,Height,color);
  56.     }
  57.       count=count+1;
  58.     if(count>=100){
  59.         del_me;
  60.     }
  61.    }
  62. }
  63.  
  64. WriteFilly(x,y,H,color){
  65.     SetColor(color);    
  66.     SetFont(H,"Book Antiqua Italic",0);
  67.     TextWrite("Filly",0,x-H,y-H/2);
  68. }
  69.  
  70. Clear(x,y,H){
  71.     SetColor(8);
  72.     SetFont(H,"Book Antiqua Italic",0);
  73.     TextWrite("Filly",0,x-H,y-H/2);
  74. }
  75.  
  76.  
  77. //色指定値の配列の初期化
  78. ColorInit()
  79. {
  80.  Red[0]=0; Red[1]=0; Red[2]=0; Red[3]=0; Red[4]=255; Red[5]=255; Red[6]=255;Red[7]=128;Red[8]=255;  
  81.  Green[0]=0; Green[1]=0; Green[2]=255; Green[3]=255; Green[4]=0; Green[5]=0; Green[6]=255; Green[7]=128;Green[8]=255; 
  82.  Blue[0]=0; Blue[1]=255; Blue[2]=0; Blue[3]=255; Blue[4]=0; Blue[5]=255; Blue[6]=0; Blue[7]=128;Blue[8]=255; 
  83. }
  84.  
  85. //文字色を指定します
  86. SetColor(col)
  87. {
  88.  TextColor(Red[col], Green[col], Blue[col]);
  89. }
  90.