home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / FFILLY / simten / SIMTEN03.LZH / SIMTEN03.TFY < prev    next >
Text File  |  1996-10-18  |  5KB  |  176 lines

  1. //SIMてんびんVer0.3
  2.  
  3. //作品情報(""内を書き換えて下さい)
  4. #info INAM "Title"
  5. #info IART "Your Name"
  6. #info ICOP "CopyRight"
  7.  
  8.  
  9. int backpic,basepic,p[],cn[],hcn[],ux,hx,hy,omori1,omori2,omori3,omori4,omori5;
  10.  
  11. int migi,hidari;
  12. int h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13;
  13. int _h1,_h2,_h3,_h4,_h5,_h6,_h7,_h8,_h9,_h10,_h11,_h12,_h13,_omori1,_omori2,_omori3,_omori4,_omori5;
  14.  
  15.  
  16. //シナリオ本体
  17. main(){
  18. //ここからシナリオを書き始めて下さい
  19. int i,s,x,y,px,py;
  20.  
  21. x=0; y=300; px=1; py=1; ux=0;
  22. omori1=0; omori2=0; omori3=0; omori4=0; omori5=0;
  23.  
  24. backpic=LoadPic("背景白.bmp");
  25. basepic=CreatePic(backpic);
  26. p[0]=LoadPic("bar11.bmp");
  27. p[1]=LoadPic("bar12.bmp");
  28. p[2]=LoadPic("bar121.bmp");
  29. p[3]=LoadPic("bar13.bmp");
  30. p[4]=LoadPic("bar131.bmp");
  31. p[5]=LoadPic("hundo.bmp"); //分銅とおもりの絵を読み込む
  32. cn[0]=PutCast(backpic,basepic);
  33.  
  34. CapTitle("SIMてんびん  Ver0.3");
  35. OpenWin(basepic);
  36.  
  37. cn[1]=PutCast(p[0],basepic,150,100,0xffffff);
  38.  
  39. for(i=1;i<19;i=i+1){
  40.     hcn[i]=PutCast(p[5],basepic,x,y,0xffffff,0,0,0,50,50,px,py);
  41.     px=px+51;
  42.     if(px==409){px=1; py=py+51;}
  43.     x=x+50; if(x==550){x=0; y=y+50;}
  44. }
  45.  
  46. mes(LBDOWN){
  47. //    if(500<=MesP2&&MesP2<=600&&420<=MesP3&&MesP3<=460){Shell("hikizan.exe");}
  48.     PostMes(USER,HitCast(GetPicNo(MesP1),MesP2,MesP3));
  49.     ugoki();
  50. }
  51.  
  52. mes(RBDOWN){}
  53.  
  54. mes(RBDBLCLK){CloseWin(basepic); del_all; del_me;}
  55.  
  56. //ここまでに書いてください
  57. }
  58.  
  59. leftdown(){
  60.     MoveCast(cn[1],p[1],150,100,0);
  61.     MoveCast(cn[1],p[2],150,100,0);
  62. }
  63.  
  64. leftup(){
  65.     MoveCast(cn[1],p[1],150,100,0);
  66.     MoveCast(cn[1],p[0],150,100,0);
  67. }
  68.  
  69. rightdown(){
  70.     MoveCast(cn[1],p[3],150,100,0);
  71.     MoveCast(cn[1],p[4],150,100,0);
  72. }
  73.  
  74. rightup(){
  75.     MoveCast(cn[1],p[3],150,100,0);
  76.     MoveCast(cn[1],p[0],150,100,0);
  77. }
  78.  
  79. ugoki(){
  80. mes(USER){
  81.     ux=MesP1;
  82.     if(MesP1==cn[0]||MesP1==cn[1]){del_me;}
  83.     mes(MOUSEMOVE){
  84.             hx=MesP2-25; hy=MesP3-25;
  85.             MoveCast(ux,p[5],hx,hy);
  86.             }
  87.     mes(LBUP){handan(); del_us; del_me;}
  88.     }
  89. }
  90.  
  91. handan(){
  92.     if(375<=hx && hx<545 && 0<=hy && hy<115){
  93.         if(ux==hcn[1]){h1=1000; _h1=0;}
  94.         if(ux==hcn[2]){h2=500; _h2=0;}
  95.         if(ux==hcn[3]){h3=200; _h3=0;}
  96.         if(ux==hcn[4]){h4=100; _h4=0;}
  97.         if(ux==hcn[5]){h5=100; _h5=0;}
  98.         if(ux==hcn[6]){h6=50; _h6=0;}
  99.         if(ux==hcn[7]){h7=20; _h7=0;}
  100.         if(ux==hcn[8]){h8=20; _h8=0;}
  101.         if(ux==hcn[9]){h9=10; _h9=0;}
  102.         if(ux==hcn[10]){h10=5; _h10=0;}
  103.         if(ux==hcn[11]){h11=2; _h11=0;}
  104.         if(ux==hcn[12]){h12=2; _h12=0;}
  105.         if(ux==hcn[13]){h13=1; _h13=0;}
  106.         if(ux==hcn[14]){omori1=357; _omori1=0;}
  107.         if(ux==hcn[15]){omori2=809; _omori2=0;}
  108.         if(ux==hcn[16]){omori3=570; _omori3=0;}
  109.         if(ux==hcn[17]){omori4=83; _omori4=0;}
  110.         if(ux==hcn[18]){omori5=7; _omori5=0;}
  111.     }else{
  112.         if(ux==hcn[1]){h1=0;}
  113.         if(ux==hcn[2]){h2=0;}
  114.         if(ux==hcn[3]){h3=0;}
  115.         if(ux==hcn[4]){h4=0;}
  116.         if(ux==hcn[5]){h5=0;}
  117.         if(ux==hcn[6]){h6=0;}
  118.         if(ux==hcn[7]){h7=0;}
  119.         if(ux==hcn[8]){h8=0;}
  120.         if(ux==hcn[9]){h9=0;}
  121.         if(ux==hcn[10]){h10=0;}
  122.         if(ux==hcn[11]){h11=0;}
  123.         if(ux==hcn[12]){h12=0;}
  124.         if(ux==hcn[13]){h13=0;}    
  125.         if(ux==hcn[14]){omori1=0;}
  126.         if(ux==hcn[15]){omori2=0;}
  127.         if(ux==hcn[16]){omori3=0;}
  128.         if(ux==hcn[17]){omori4=0;}
  129.         if(ux==hcn[18]){omori5=0;}
  130.     }
  131.     if(90<=hx && hx<285 && 0<=hy && hy<115){
  132.         if(ux==hcn[1]){_h1=1000; h1=0;}
  133.         if(ux==hcn[2]){_h2=500; h2=0;}
  134.         if(ux==hcn[3]){_h3=200; h3=0;}
  135.         if(ux==hcn[4]){_h4=100; h4=0;}
  136.         if(ux==hcn[5]){_h5=100; h5=0;}
  137.         if(ux==hcn[6]){_h6=50; h6=0;}
  138.         if(ux==hcn[7]){_h7=20; h7=0;}
  139.         if(ux==hcn[8]){_h8=20; h8=0;}
  140.         if(ux==hcn[9]){_h9=10; h9=0;}
  141.         if(ux==hcn[10]){_h10=5; h10=0;}
  142.         if(ux==hcn[11]){_h11=2; h11=0;}
  143.         if(ux==hcn[12]){_h12=2; h12=0;}
  144.         if(ux==hcn[13]){_h13=1; h13=0;}
  145.         if(ux==hcn[14]){_omori1=357; omori1=0;}
  146.         if(ux==hcn[15]){_omori2=809; omori2=0;}
  147.         if(ux==hcn[16]){_omori3=570; omori3=0;}
  148.         if(ux==hcn[17]){_omori4=83; omori4=0;}
  149.         if(ux==hcn[18]){_omori5=7; omori5=0;}
  150.     }else{
  151.         if(ux==hcn[1]){_h1=0;}
  152.         if(ux==hcn[2]){_h2=0;}
  153.         if(ux==hcn[3]){_h3=0;}
  154.         if(ux==hcn[4]){_h4=0;}
  155.         if(ux==hcn[5]){_h5=0;}
  156.         if(ux==hcn[6]){_h6=0;}
  157.         if(ux==hcn[7]){_h7=0;}
  158.         if(ux==hcn[8]){_h8=0;}
  159.         if(ux==hcn[9]){_h9=0;}
  160.         if(ux==hcn[10]){_h10=0;}
  161.         if(ux==hcn[11]){_h11=0;}
  162.         if(ux==hcn[12]){_h12=0;}
  163.         if(ux==hcn[13]){_h13=0;}    
  164.         if(ux==hcn[14]){_omori1=0;}
  165.         if(ux==hcn[15]){_omori2=0;}
  166.         if(ux==hcn[16]){_omori3=0;}
  167.         if(ux==hcn[17]){_omori4=0;}
  168.         if(ux==hcn[18]){_omori5=0;}
  169.     }
  170.     migi=(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+omori1+omori2+omori3+omori4+omori5);
  171.     hidari=(_h1+_h2+_h3+_h4+_h5+_h6+_h7+_h8+_h9+_h10+_h11+_h12+_h13+_omori1+_omori2+_omori3+_omori4+_omori5);
  172.     if(migi==hidari){MoveCast(cn[1],p[0],150,100,0);}
  173.     if(migi>hidari){rightdown();}
  174.     if(migi<hidari){leftdown();}
  175. }
  176.