home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 February / VPR9602A.ISO / ffilly / filly130 / stamp.tfy < prev    next >
Text File  |  1995-10-29  |  2KB  |  89 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.     CloseWin(0);
  36.     del_all; del_me;
  37.  }
  38.  
  39. //ここまでに書いてください
  40. }
  41.  
  42. MoveFilly(x,y){
  43.     int count, color, Height, x_grad, y_grad;
  44.     color=Random(8);
  45.     SetColor(color);
  46.     Height=Random(150)+10; 
  47.     x_grad=(x-Last2X)*5; //一回ごとのx座標の移動距離
  48.     y_grad=(y-Last2Y)*5; 
  49.     PlayWAVE("Pom.wav");
  50.     WriteFilly(x,y,Height,color);
  51.     count=0;
  52.     mes(TIME){   //  1/20秒毎にここに来ます
  53.     step(10){    // 10回に1回実行
  54.         Clear(x,y,Height); x=x+x_grad; y=y+y_grad; WriteFilly(x,y,Height,color);
  55.     }
  56.       count=count+1;
  57.     if(count>=100){
  58.         del_me;
  59.     }
  60.    }
  61. }
  62.  
  63. WriteFilly(x,y,H,color){
  64.     SetColor(color);    
  65.     SetFont(H,"Book Antiqua Italic",0);
  66.     TextWrite("Filly",0,x-H,y-H/2);
  67. }
  68.  
  69. Clear(x,y,H){
  70.     SetColor(8);
  71.     SetFont(H,"Book Antiqua Italic",0);
  72.     TextWrite("Filly",0,x-H,y-H/2);
  73. }
  74.  
  75.  
  76. //色指定値の配列の初期化
  77. ColorInit()
  78. {
  79.  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;  
  80.  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; 
  81.  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; 
  82. }
  83.  
  84. //文字色を指定します
  85. SetColor(col)
  86. {
  87.  TextColor(Red[col], Green[col], Blue[col]);
  88. }
  89.