home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 October / VPR9810A.ISO / FFILLY / SPON705 / FACE2.TFY < prev    next >
Text File  |  1998-05-19  |  4KB  |  209 lines

  1. // Created By sPon 97.4
  2. //
  3. // 新しいシナリオ
  4. //
  5. //
  6.  
  7. #info INAM "新しいシナリオ"
  8.  
  9.  
  10. int mDown;          // Mouse Down Flag
  11. int xoff, yoff;     // Background Offset
  12. int pw, ph;         // Background Size
  13. int pic[];          // Picture Array
  14. int jump[];         // Jump Counter
  15.  
  16.  
  17. // マウスの位置が矩形の範囲内かどうか調べる関数
  18. isInRect(int x1, int y1, int x2, int y2)
  19. {
  20.   x1 = x1 + xoff;  y1 = y1 + yoff;
  21.   x2 = x2 + xoff;  y2 = y2 + yoff;
  22.   if(x1 <= MesP2 && MesP2 < x2 && y1 <= MesP3 && MesP3 < y2){
  23.     return (1);
  24.   }
  25.   return (0);
  26. }
  27.  
  28.  
  29. LoadResource()
  30. {
  31.   LoadPic("p00.bmp");  // Default Background
  32.   pic[0] = LoadPic("p00.bmp");
  33.   pic[1] = LoadPic("p01.bmp");
  34.   pic[2] = LoadPic("p02.bmp");
  35.   pic[3] = LoadPic("p04.bmp");
  36.   pic[4] = LoadPic("p05.bmp");
  37.   pic[5] = LoadPic("p06.bmp");
  38.   pic[6] = LoadPic("p07.bmp");
  39.   pic[7] = LoadPic("p12.bmp");
  40.   pic[8] = LoadPic("p11.bmp");
  41.   pic[9] = LoadPic("p08.bmp");
  42.   pic[10] = LoadPic("p09.bmp");
  43.   pic[11] = LoadPic("p13.bmp");
  44.   pic[12] = LoadPic("p14.bmp");
  45. }
  46.  
  47.  
  48. // オープニング
  49. main()
  50. {
  51.   int sw, sh;
  52.  
  53.   LoadResource();
  54.   pw = PicWidth(0); ph = PicHeight(0);
  55.   sw = WinInfo(0);  sh = WinInfo(1);
  56.   xoff = (sw - pw) / 2;  yoff = (sh - ph) / 2;
  57.   OpenWin(0, 0, 0, sw, sh, -xoff, -yoff, 0x000000);
  58.   mDown = 0;
  59.   scene0();
  60. }
  61.  
  62.  
  63. // タイトル
  64. scene0()
  65. {
  66.   MovePic(pic[0], 0, 0, PicWidth(pic[0]), PicHeight(pic[0]), 0); 
  67.  
  68.   mes(TIME) { step(2) {
  69.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,MovePic(pic[1], 0, 0, pw, ph, 0, 0, 0, 1, 20); 
  70.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,MovePic(pic[0], 0, 0, pw, ph, 0, 0, 0, 1, 40); 
  71.     ,,,,,,,,,,,,,,,,,,,,PlayMIDI("FACE.MID"); 
  72.     ,,,,,,,,,,,,,,,,,,,,MovePic(pic[2], 0, 0, pw, ph, 0, 0, 0); 
  73.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,MovePic(pic[3], 0, 0, pw, ph, 0, 0, 0); 
  74.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  scene1();  del_me;
  75.     end_step;
  76.   }}
  77. }
  78.  
  79.  
  80. // 顔
  81. scene1()
  82. {
  83.   MovePic(pic[4], 0, 0, PicWidth(pic[4]), PicHeight(pic[4]), 0); 
  84.  
  85.   mes(TIME) { step(2) {
  86.     ,,MovePic(pic[5], 0, 0, pw, ph, 0, 0, 0); 
  87.     ,,del_us;  scene1();  del_me;
  88.     end_step;
  89.   }}
  90.  
  91.   mDown = 0;
  92.   mes(LBDOWN){
  93.     mDown = 1;
  94.   }
  95.  
  96.   mes(LBUP) {  if(mDown == 1){
  97.     if(isInRect(110, 86, 151, 107)){
  98.       del_us;  scene2();  del_me;
  99.     } else if(isInRect(165, 84, 201, 108)){
  100.       del_us;  scene2();  del_me;
  101.     } else if(isInRect(145, 95, 173, 130)){
  102.       del_us;  scene3();  del_me;
  103.     } else if(isInRect(128, 129, 193, 154)){
  104.       del_us;  scene4();  del_me;
  105.     } else if(isInRect(72, 90, 106, 139)){
  106.       del_us;  scene5();  del_me;
  107.     } else if(isInRect(210, 82, 243, 133)){
  108.       del_us;  scene6();  del_me;
  109.     } else if(isInRect(86, 31, 224, 75)){
  110.       del_us;  scene7();  del_me;
  111.     } else {
  112.       ;
  113.     }
  114.   }}
  115. }
  116.  
  117.  
  118. // 目
  119. scene2()
  120. {
  121.   MovePic(pic[6], 0, 0, PicWidth(pic[6]), PicHeight(pic[6]), 0, 0, 0, 2, 20); 
  122.  
  123.   mes(TIME) { step(2) {
  124.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  scene1();  del_me;
  125.     end_step;
  126.   }}
  127. }
  128.  
  129.  
  130. // 鼻
  131. scene3()
  132. {
  133.   MovePic(pic[7], 0, 0, PicWidth(pic[7]), PicHeight(pic[7]), 0, 0, 0, 3, 20); 
  134.  
  135.   mes(TIME) { step(2) {
  136.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  scene1();  del_me;
  137.     end_step;
  138.   }}
  139. }
  140.  
  141.  
  142. // 口
  143. scene4()
  144. {
  145.   MovePic(pic[8], 0, 0, PicWidth(pic[8]), PicHeight(pic[8]), 0, 0, 0, 5, 20); 
  146.  
  147.   mes(TIME) { step(2) {
  148.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  scene1();  del_me;
  149.     end_step;
  150.   }}
  151. }
  152.  
  153.  
  154. // 右耳
  155. scene5()
  156. {
  157.   MovePic(pic[9], 0, 0, PicWidth(pic[9]), PicHeight(pic[9]), 0, 0, 0, 6, 20); 
  158.  
  159.   mes(TIME) { step(2) {
  160.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  scene1();  del_me;
  161.     end_step;
  162.   }}
  163. }
  164.  
  165.  
  166. // 左耳
  167. scene6()
  168. {
  169.   MovePic(pic[10], 0, 0, PicWidth(pic[10]), PicHeight(pic[10]), 0, 0, 0, 7, 20); 
  170.  
  171.   mes(TIME) { step(2) {
  172.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  scene1();  del_me;
  173.     end_step;
  174.   }}
  175. }
  176.  
  177.  
  178. // 頭
  179. scene7()
  180. {
  181.   MovePic(pic[11], 0, 0, PicWidth(pic[11]), PicHeight(pic[11]), 0); 
  182.  
  183.   mes(TIME) { step(2) {
  184.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  scene8();  del_me;
  185.     end_step;
  186.   }}
  187. }
  188.  
  189.  
  190. // Fin
  191. scene8()
  192. {
  193.   MovePic(pic[12], 0, 0, PicWidth(pic[12]), PicHeight(pic[12]), 0); 
  194.  
  195.   mes(TIME) { step(2) {
  196.     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,del_us;  ending();  del_me;
  197.     end_step;
  198.   }}
  199. }
  200.  
  201.  
  202. // エンディング
  203. ending()
  204. {
  205.   mes(TIME){}
  206. }
  207.  
  208.  
  209.