Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '-----By Lou & Sky
  2.  
  3. SuperStrict
  4.  
  5.  
  6. 'intro
  7.  
  8. Global Ende_intro:Int=0
  9. Global Ende_Menu:Int=0
  10. Global ende_credits:Int=0
  11. Global Ende_options:Int=0
  12.  
  13. Global process_intro:Float=0
  14. Global buttons_done:Int=0
  15.  
  16. Global maskdrawn:Int=0
  17.  
  18. Global Mousexx:Int=0
  19. Global Mouseyy:Int=0
  20.  
  21. Global ip:String="0.0.0.0"
  22. Global port:String="0"
  23. Global username:String="name"
  24.  
  25. Global iplang:Int
  26. Global portlang:Int
  27. Global namelang:Int
  28.  
  29.  
  30. Global IMG_intro:TImage     'menu
  31. Global IMG_menu:TImage
  32. Global IMG_menu_overlay:TImage
  33. Global IMG_menu_0:TImage
  34. Global IMG_menu_1:TImage
  35. Global IMG_mask:TImage
  36. Global IMG_credits:TImage
  37. Global BUT_splayer:TImage[3]        'menu buttons
  38. Global BUT_mplayer:TImage[3]
  39. Global BUT_options:TImage[3]
  40. Global BUT_credits:TImage[3]
  41. Global BUT_exit:TImage[3]
  42.  
  43. Global IMG_cloud0:TImage        'options
  44. Global IMG_cloud1:TImage
  45. Global OBUT_up:TImage           'options buttons
  46. Global OBUT_uptext:TImage
  47. Global OBUT_name:TImage
  48. Global OBUT_ip:TImage
  49. Global OBUT_port:TImage
  50. Global OBUT_down:TImage
  51. Global OBUT_button_up:TImage
  52. Global OBUT_button_save:TImage
  53. Global OBUT_button_cancel:TImage
  54. Global OBUT_button_save2:TImage
  55. Global OBUT_button_cancel2:TImage
  56. Global OBUT_button_down:TImage
  57.  
  58. Global font_options:TImageFont=LoadImageFont("gfx\font\technott.ttf",38,SMOOTHFONT)
  59.  
  60. Global OBUT_textmark:TImage     'textmark
  61. Global textblink:Float=0
  62. Global textblinkstate:Int=0
  63.  
  64. Global mask_hud:TImage          'ingame
  65. Global TEXTURE_ground:TImage[5,4]   '[X,Y] X=anzahl verschiedener texturen,y=anzahl verschiedener states (blood,clean..)
  66.  
  67. Global a:Int,b:Int,c:Int,d:Int
  68.  
  69. Global fa:Float,fb:Float,fc:Float,fd:Float,fe:Float,ff:Float
  70.  
  71. Global FPS:Float
  72. Global FPS_MAX:Int = 60
  73. Global FPS_LAST:Int = MilliSecs()
  74.  
  75. '=======================================================================================================
  76. 'Types
  77. Type TButton
  78.     Field image:TImage
  79.     Field x:Int,y:Int,x2:Int,y2:Int
  80.     Field click_trigger:Int
  81.     Field over_trigger:Int
  82.    
  83.     Method drawself()
  84.         DrawImageRect(image,x,y,x2,y2)
  85.     End Method
  86.    
  87.     Method click()
  88.         If (MouseX()> x And MouseY()>y And MouseX()<x+x2 And MouseY()<y+y2) Then click_trigger=1 Else click_trigger=0
  89.     End Method
  90.    
  91.     Method over()
  92.         If (MouseX()> x And MouseY()>y And MouseX()<x+x2 And MouseY()<y+y2) Then over_trigger=1 Else over_trigger=0
  93.     End Method
  94.    
  95. End Type
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108. '=======================================================================================================
  109. 'functions
  110.  
  111. Function defaults()
  112. SetClsColor(0,0,0)
  113. SetColor(255,255,255)
  114. SetAlpha(1)
  115. a=0;b=0;c=0;d=0;fa=0;fb=0;fc=0;fd=0
  116. End Function
  117.  
  118. '=======================================================================================================
  119.  
  120. Rem
  121. Function menu_trigger(trigger:String)
  122.     Select trigger
  123.         Case "splayer"
  124.        
  125.         Case "mplayer"
  126.        
  127.         Case "options"
  128.        
  129.         Case "credits"
  130.        
  131.         Case "func_exit"
  132.        
  133.     End Select
  134. End Function
  135. End Rem
  136.  
  137. '=======================================================================================================
  138.  
  139. Function process_intro_bar(process:Float)
  140.     DrawRect(0,GraphicsHeight()-10,GraphicsWidth()*(process),10)
  141. End Function
  142.  
  143. '=======================================================================================================
  144.  
  145. Function textmark(x:Int,y:Int)
  146.     If textblinkstate=0     Then textblink:+0.1     Else textblink:-0.1
  147.     If textblink>1      Then textblinkstate=1
  148.     If textblink<0      Then textblinkstate=0
  149.     SetAlpha(textblink)
  150.     DrawImage(OBUT_textmark,x,y)
  151. End Function
  152.  
  153. '=======================================================================================================
  154.  
  155. 'Function options_save(ip:String,port:String,username:String)
  156.    
  157. 'End Function
  158.  
  159. '=======================================================================================================
  160.  
  161. Function do_options()
  162.     SetImageFont(font_options)
  163.     FlushKeys()
  164.     Local temp_img0:TImage=BUT_splayer[2]
  165.     Local temp_img1:TImage=BUT_mplayer[2]
  166.     Local temp_img2:TImage=BUT_options[2]
  167.     Local temp_img3:TImage=BUT_credits[2]
  168.     Local temp_img4:TImage=BUT_exit[2] 
  169.     fb=1
  170.     a=0
  171.     b=0
  172.     c=12
  173.     d=0
  174.     Local e:Float=1
  175.     Local f:Float=0
  176.     Local g:Float=0
  177.     Local Markierung:Int=0
  178.     Local key:Int
  179.     Local validip:Int
  180.     Local validport:Int
  181.     Local validusername:Int
  182.    
  183.     Repeat
  184.         Cls
  185.         maskdrawn=0
  186.         mousexx=(MouseX()-mousexx)/c+mousexx            'wie sehr soll die bg-verschiebung hinterher hängen
  187.         mouseyy=(MouseY()-mouseyy)/c+mouseyy
  188.        
  189.         fb:-0.01        'geschwindigkeit des gesamt-fades
  190.         If fb<=0.5
  191.             fb=0.5
  192.             If d=0 Then d=1
  193.         EndIf
  194.        
  195.         splayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-splayer.x2/2+GraphicsWidth()/(16*fe)    'button x/y
  196.         splayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-1-2)*splayer.y2              '(5-x-2) x=stelle des buttons
  197.         mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
  198.         mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
  199.         options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
  200.         options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
  201.         credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
  202.         credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
  203.         func_exit.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-func_exit.x2/2+GraphicsWidth()/(16*fe)
  204.         func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
  205.  
  206.         SetAlpha(1)
  207.         DrawImageRect(IMG_menu_0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-GraphicsWidth()/Int((64*fc)),(GraphicsHeight()-MouseYy)/Int((32*fc))-GraphicsHeight()/Int((64*fc))-GraphicsHeight()/Int((64*fc)),GraphicsWidth()+GraphicsWidth()/Int((16*fc)),GraphicsHeight()+GraphicsHeight()/Int((16*fc)))
  208.         SetAlpha(fb)
  209.         DrawImageRect(IMG_menu_1,(GraphicsWidth()-MouseXx)/Int((16*fd))-GraphicsWidth()/Int((32*fd))-GraphicsWidth()/Int((32*fd)),(GraphicsHeight()-MouseYy)/Int((16*fd))-GraphicsHeight()/Int((32*fd))-GraphicsHeight()/Int((32*fd)),GraphicsWidth()+GraphicsWidth()/Int((16*fd)),GraphicsHeight()+GraphicsHeight()/Int((16*fd)))
  210.        
  211.         SetAlpha(fb*2-1)
  212.         splayer.drawself()
  213.         mplayer.drawself()
  214.         options.drawself()
  215.         credits.drawself()
  216.         func_exit.drawself()
  217.        
  218.         SetAlpha(1-fb)
  219.         DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2)  'blured buttons
  220.         DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
  221.         DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
  222.         DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
  223.         DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
  224.        
  225.         a:+1
  226.         b:+2   
  227.         If a>=(GraphicsWidth())*2 Then a=1
  228.         If b>=(GraphicsWidth())*2 Then b=2
  229.        
  230.         SetAlpha((1-fb))   
  231.         DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-a,0,(GraphicsWidth())*3,GraphicsHeight())      'cloud
  232.         DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-b,0,(GraphicsWidth())*3,GraphicsHeight())
  233.        
  234.         If d=1
  235.             e:+(e*0.2)
  236.         EndIf
  237.         If e>(1.5*50)
  238.             d=2
  239.             e=(0.5*3*50)        'anzahl der buttons/2*höhe der buttons
  240.         EndIf
  241.        
  242.         SetAlpha((1-fb)*2)
  243.         DrawImageRect(OBUT_up,0,                        (GraphicsHeight()/2-25-e    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))            ,GraphicsWidth(),50)        'links head
  244.         DrawImageRect(OBUT_uptext,Max(0,Min(400,(Mousexx-75))), (GraphicsHeight()/2-25-e    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))            ,GraphicsWidth(),50)        'links text
  245.         DrawImageRect(OBUT_down,0,                      (GraphicsHeight()/2+25+e    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))            ,GraphicsWidth(),50)        'links unten
  246.        
  247.         If d=2
  248.             f:+0.1
  249.         EndIf
  250.         If f>1
  251.             f=1
  252.             FlushMouse()
  253.             d=3
  254.         EndIf
  255.        
  256.         SetAlpha(f)
  257.         DrawImageRect(OBUT_ip,0,            (GraphicsHeight()/2+25-e+(0*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))        ,GraphicsWidth(),50)        '0*50 -> 0= der wievielte button
  258.         DrawImageRect(OBUT_port,0,          (GraphicsHeight()/2+25-e+(1*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))        ,GraphicsWidth(),50)        'linke knöpfe
  259.         DrawImageRect(OBUT_name,0,          (GraphicsHeight()/2+25-e+(2*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))        ,GraphicsWidth(),50)
  260.        
  261.         If d=4
  262.             If (MouseX()<GraphicsWidth()-200    And MouseY()>(GraphicsHeight()/2+25-e+(0*50)    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))..
  263.                                     And MouseY()<(GraphicsHeight()/2+25-e+(0*50)    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))+50)
  264.                 If MouseHit(1)
  265.                     Markierung=1
  266.                     'ip=""
  267.                 EndIf
  268.             EndIf
  269.             If (MouseX()<GraphicsWidth()-200    And MouseY()>(GraphicsHeight()/2+25-e+(1*50)    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))..
  270.                                     And MouseY()<(GraphicsHeight()/2+25-e+(1*50)    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))+50)
  271.                 If MouseHit(1)
  272.                     Markierung=2
  273.                     'port=""
  274.                 EndIf
  275.             EndIf
  276.             If (MouseX()<GraphicsWidth()-200    And MouseY()>(GraphicsHeight()/2+25-e+(2*50)    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))..
  277.                                     And MouseY()<(GraphicsHeight()/2+25-e+(2*50)    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))+50)
  278.                 If MouseHit(1)
  279.                     Markierung=3
  280.                     'username=""
  281.                 EndIf
  282.             EndIf      
  283.            
  284.            
  285.             Select Markierung                                               'zeichne text-markierer
  286.                 Case 1
  287.                     key=GetChar()
  288.                     If key=8 Then ip=ip[0..Len(ip)-1]
  289.                     If key=9 Then Markierung=2
  290.                     If (key<>0 And key<>8 And key<>9 And key<>13) Then ip=ip+Chr(key)
  291.                     textmark(270+TextWidth(ip),     (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))
  292.                 Case 2
  293.                     key=GetChar()
  294.                     If key=8 Then port=port[0..Len(port)-1]
  295.                     If key=9 Then Markierung=3
  296.                     If (key<>0 And key<>8 And key<>9 And key<>13) Then port=port+Chr(key)
  297.                     textmark(210+TextWidth(port),       (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))
  298.                 Case 3
  299.                     key=GetChar()
  300.                     If key=8 Then username=username[0..Len(username)-1]
  301.                     If key=9 Then Markierung=1
  302.                     If (key<>0 And key<>8 And key<>9 And key<>13) Then username=username+Chr(key)
  303.                     textmark(225+TextWidth(username),   (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))
  304.             End Select
  305.            
  306.             If key=13 Then Print "save!"
  307.         EndIf  
  308.                     SetAlpha(f)
  309.                                                                                         'zeichne options-werte
  310.                     SetColor(200,110,0)
  311.                     DrawText ip,272,                (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
  312.                     DrawText port,212,          (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9      
  313.                     DrawText username,227,          (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
  314.                     SetColor(250,180,0)
  315.                     DrawText ip,270,                (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
  316.                     DrawText port,210,          (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7      
  317.                     DrawText username,225,          (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7  
  318.                     SetColor(255,255,255)  
  319.  
  320.        
  321.        
  322.         If d=3
  323.             g:+0.05
  324.         EndIf
  325.         If g>3
  326.             g=3
  327.             d=4
  328.         EndIf
  329.        
  330.         SetAlpha(g)
  331.         DrawImageRect(OBUT_button_up,0,     (GraphicsHeight()-150)          ,GraphicsWidth(),50)
  332.  
  333.         SetAlpha(g-0.5)
  334.         If (MouseX()>GraphicsWidth()-200 And MouseY()>(GraphicsHeight()-100) And MouseY()<(GraphicsHeight()-50))
  335.             DrawImageRect(OBUT_button_save2,0,      (GraphicsHeight()-100)          ,GraphicsWidth(),50)
  336.             If d=4
  337.                 If MouseHit(1)
  338.                     'options_save(ip,port,username) 'saving process & ende_options=1
  339.                     'If (validip=1 And validport=1 And validusername=1)
  340.                         ende_options=1
  341.                     'Else
  342.                     '   Print "warnung"
  343.                     'EndIf
  344.                    
  345.             EndIf
  346.         Else
  347.             DrawImageRect(OBUT_button_save,0,       (GraphicsHeight()-100)          ,GraphicsWidth(),50)
  348.         EndIf
  349.        
  350.         SetAlpha(g-1)
  351.         If (MouseX()>GraphicsWidth()-200 And MouseY()>(GraphicsHeight()-50) And MouseY()<(GraphicsHeight()))
  352.             DrawImageRect(OBUT_button_cancel2,0,    (GraphicsHeight()-50)           ,GraphicsWidth(),50)
  353.             If d=4
  354.                 If MouseHit(1) Then Ende_options=1
  355.             EndIf
  356.         Else
  357.             DrawImageRect(OBUT_button_cancel,0, (GraphicsHeight()-50)           ,GraphicsWidth(),50)
  358.         EndIf
  359.        
  360.         'SetAlpha(g-1.5)
  361.         'DrawImageRect(OBUT_button_down,0,      (GraphicsHeight()-50)           ,GraphicsWidth(),50)
  362.        
  363.        
  364.        
  365.        
  366.        
  367.        
  368.         If maskdrawn=0
  369.         SetAlpha(1)
  370.         DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
  371.         maskdrawn=1
  372.         EndIf
  373.         Flip 0;FlushMouse();fpsl();
  374.     Until Ende_Options=1   
  375.     options.image=BUT_options[0]
  376.     fb=0.49
  377.     g=2
  378.     Repeat
  379.    
  380.         Cls
  381.         maskdrawn=0
  382.         mousexx=(MouseX()-mousexx)/c+mousexx            'wie sehr soll die bg-verschiebung hinterher hängen
  383.         mouseyy=(MouseY()-mouseyy)/c+mouseyy
  384.        
  385.         fb:+0.01        'geschwindigkeit des gesamt-fades
  386.         If fb>1
  387.             fb=1
  388.             Ende_options=2
  389.         EndIf
  390.        
  391.         splayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-splayer.x2/2+GraphicsWidth()/(16*fe)    'button x/y
  392.         splayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-1-2)*splayer.y2              '(5-x-2) x=stelle des buttons
  393.         mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
  394.         mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
  395.         options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
  396.         options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
  397.         credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
  398.         credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
  399.         func_exit.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-func_exit.x2/2+GraphicsWidth()/(16*fe)
  400.         func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
  401.  
  402.         SetAlpha(1)
  403.         DrawImageRect(IMG_menu_0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-GraphicsWidth()/Int((64*fc)),(GraphicsHeight()-MouseYy)/Int((32*fc))-GraphicsHeight()/Int((64*fc))-GraphicsHeight()/Int((64*fc)),GraphicsWidth()+GraphicsWidth()/Int((16*fc)),GraphicsHeight()+GraphicsHeight()/Int((16*fc)))
  404.         SetAlpha(fb)
  405.         DrawImageRect(IMG_menu_1,(GraphicsWidth()-MouseXx)/Int((16*fd))-GraphicsWidth()/Int((32*fd))-GraphicsWidth()/Int((32*fd)),(GraphicsHeight()-MouseYy)/Int((16*fd))-GraphicsHeight()/Int((32*fd))-GraphicsHeight()/Int((32*fd)),GraphicsWidth()+GraphicsWidth()/Int((16*fd)),GraphicsHeight()+GraphicsHeight()/Int((16*fd)))
  406.        
  407.         SetAlpha(fb*2-1)
  408.         splayer.drawself()
  409.         mplayer.drawself()
  410.         options.drawself()
  411.         credits.drawself()
  412.         func_exit.drawself()
  413.        
  414.         SetAlpha(1-(fb))
  415.         DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2)  'blured buttons
  416.         DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
  417.         DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
  418.         DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
  419.         DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
  420.        
  421.         a:+1
  422.         b:+2   
  423.         If a>=(GraphicsWidth())*2 Then a=1
  424.         If b>=(GraphicsWidth())*2 Then b=2
  425.        
  426.         SetAlpha(1-(fb))   
  427.         DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-a,0,(GraphicsWidth())*3,GraphicsHeight())
  428.         DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-b,0,(GraphicsWidth())*3,GraphicsHeight())
  429.        
  430.         SetAlpha(2-(fb*2))
  431.         DrawImageRect(OBUT_up,0,                        (GraphicsHeight()/2-25-e    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))            ,GraphicsWidth(),50)
  432.         DrawImageRect(OBUT_uptext,Max(0,Min(400,(Mousexx-75))), (GraphicsHeight()/2-25-e    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))            ,GraphicsWidth(),50)
  433.         DrawImageRect(OBUT_down,0,                      (GraphicsHeight()/2+25+e    -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))            ,GraphicsWidth(),50)
  434.        
  435.         SetAlpha(2-(fb*2))
  436.         DrawImageRect(OBUT_ip,0,            (GraphicsHeight()/2+25-e+(0*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))        ,GraphicsWidth(),50)        '0*50 -> 0= der wievielte button
  437.         DrawImageRect(OBUT_port,0,          (GraphicsHeight()/2+25-e+(1*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))        ,GraphicsWidth(),50)
  438.         DrawImageRect(OBUT_name,0,          (GraphicsHeight()/2+25-e+(2*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))        ,GraphicsWidth(),50)
  439.        
  440.         SetAlpha(2-(fb*2))
  441.         SetColor(200,110,0)
  442.         DrawText ip,272,                (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
  443.         DrawText port,212,          (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9      
  444.         DrawText username,227,          (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
  445.         SetColor(250,180,0)
  446.         DrawText ip,270,                (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
  447.         DrawText port,210,          (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7      
  448.         DrawText username,225,          (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7  
  449.         SetColor(255,255,255)  
  450.        
  451.        
  452.        
  453.        
  454.         g:-0.05
  455.        
  456.         SetAlpha(g-1)
  457.         DrawImageRect(OBUT_button_up,0,     (GraphicsHeight()-150)          ,GraphicsWidth(),50)
  458.  
  459.         SetAlpha(g-0.5)
  460.         DrawImageRect(OBUT_button_save,0,       (GraphicsHeight()-100)          ,GraphicsWidth(),50)
  461.  
  462.        
  463.         SetAlpha(g)
  464.         DrawImageRect(OBUT_button_cancel,0, (GraphicsHeight()-50)           ,GraphicsWidth(),50)
  465.  
  466.        
  467.         If maskdrawn=0
  468.         SetAlpha(1)
  469.         DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
  470.         maskdrawn=1
  471.         EndIf
  472.         Flip 0;fpsl()
  473.        
  474.     Until Ende_options=2
  475.     Ende_options=0
  476.     d=0
  477.     ff=1   
  478.     g=0
  479. End Function
  480.  
  481. '=======================================================================================================
  482.  
  483. Function do_credits()
  484.     FlushKeys()
  485.     Local temp_img0:TImage=BUT_splayer[2]
  486.     Local temp_img1:TImage=BUT_mplayer[2]
  487.     Local temp_img2:TImage=BUT_options[2]
  488.     Local temp_img3:TImage=BUT_credits[2]
  489.     Local temp_img4:TImage=BUT_exit[2]
  490.    
  491.     fa=0
  492.     a=1
  493.     fb=0
  494.     ff=0
  495.     b=0
  496.     c=8
  497.     Local d:Int
  498.     Local e:Int
  499.    
  500.     Repeat
  501.         Cls
  502.        
  503.         If b=0
  504.         mousexx=(MouseX()-mousexx)/c+mousexx            'wie sehr soll die bg-verschiebung hinterher hängen
  505.         mouseyy=(MouseY()-mouseyy)/c+mouseyy
  506.         c:+4
  507.         EndIf
  508.        
  509.         fb=a-fa
  510.         If fa>0.35 Then b=1
  511.         If fa>0.5 Then fa=0.5
  512.        
  513.         SetAlpha(fb)
  514.         DrawImageRect(IMG_menu_0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-GraphicsWidth()/Int((64*fc)),(GraphicsHeight()-MouseYy)/Int((32*fc))-GraphicsHeight()/Int((64*fc))-GraphicsHeight()/Int((64*fc)),GraphicsWidth()+GraphicsWidth()/Int((16*fc)),GraphicsHeight()+GraphicsHeight()/Int((16*fc)))
  515.         SetAlpha(1)
  516.         DrawImageRect(IMG_menu_1,(GraphicsWidth()-MouseXx)/Int((16*fd))-GraphicsWidth()/Int((32*fd))-GraphicsWidth()/Int((32*fd)),(GraphicsHeight()-MouseYy)/Int((16*fd))-GraphicsHeight()/Int((32*fd))-GraphicsHeight()/Int((32*fd)),GraphicsWidth()+GraphicsWidth()/Int((16*fd)),GraphicsHeight()+GraphicsHeight()/Int((16*fd)))
  517.        
  518.         fb=a-fa*2
  519.         SetAlpha(fb)
  520.         splayer.drawself()
  521.         mplayer.drawself()
  522.         options.drawself()
  523.         credits.drawself()
  524.         func_exit.drawself()       
  525.        
  526.         fb=fa
  527.         SetAlpha(fb)
  528.         DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2)  'blured buttons
  529.         DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
  530.         DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
  531.         DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
  532.         DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
  533.        
  534.         splayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-splayer.x2/2+GraphicsWidth()/(16*fe)    'button x/y
  535.         splayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-1-2)*splayer.y2              '(5-x-2) x=stelle des buttons
  536.         mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
  537.         mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
  538.         options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
  539.         options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
  540.         credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
  541.         credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
  542.         func_exit.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-func_exit.x2/2+GraphicsWidth()/(16*fe)
  543.         func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
  544.        
  545.        
  546.        
  547.        
  548.        
  549.        
  550.         d:+1
  551.         e:+2   
  552.         If d>=(GraphicsWidth())*2 Then d=1
  553.         If e>=(GraphicsWidth())*2 Then e=2
  554.        
  555.         SetAlpha(ff)   
  556.         DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-d,0,(GraphicsWidth())*3,GraphicsHeight())      'cloud
  557.         DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-e,0,(GraphicsWidth())*3,GraphicsHeight())
  558.        
  559.        
  560.         If b=1
  561.         ff:+0.02
  562.         If ff>1 Then ff=1           'credits-splash
  563.         SetAlpha(ff)
  564.         DrawImageRect(IMG_credits,0,0,GraphicsWidth(),GraphicsHeight())
  565.         EndIf
  566.        
  567.  
  568.        
  569.        
  570.        
  571.        
  572.        
  573.         SetAlpha(1)
  574.         DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
  575.         fa:+0.01
  576.    
  577.         Flip 0
  578.         fpsl()
  579.        
  580.     Until GetChar()<>0 Or MouseHit(1) Or MouseHit(2)
  581.     b=128
  582.     credits.image=BUT_credits[0]
  583.     Repeat
  584.         Cls
  585.         maskdrawn=0
  586.  
  587.        
  588.         mousexx=(MouseX()-mousexx)/b+mousexx            'wie sehr soll die bg-verschiebung hinterher hängen
  589.         mouseyy=(MouseY()-mouseyy)/b+mouseyy
  590.         b:-8
  591.         If b<16 Then b=16
  592.        
  593.         fb=a-fa
  594.         If fa<0 Then fa=0
  595.         fa:-0.01
  596.         If fa<0 Then ende_credits=1
  597.        
  598.         SetAlpha(fb)        'bg
  599.         DrawImageRect(IMG_menu_0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-GraphicsWidth()/Int((64*fc)),(GraphicsHeight()-MouseYy)/Int((32*fc))-GraphicsHeight()/Int((64*fc))-GraphicsHeight()/Int((64*fc)),GraphicsWidth()+GraphicsWidth()/Int((16*fc)),GraphicsHeight()+GraphicsHeight()/Int((16*fc)))
  600.         SetAlpha(1)
  601.         DrawImageRect(IMG_menu_1,(GraphicsWidth()-MouseXx)/Int((16*fd))-GraphicsWidth()/Int((32*fd))-GraphicsWidth()/Int((32*fd)),(GraphicsHeight()-MouseYy)/Int((16*fd))-GraphicsHeight()/Int((32*fd))-GraphicsHeight()/Int((32*fd)),GraphicsWidth()+GraphicsWidth()/Int((16*fd)),GraphicsHeight()+GraphicsHeight()/Int((16*fd)))
  602.        
  603.         fb=a-fa*2
  604.         SetAlpha(fb)
  605.         splayer.drawself()          'unblured button
  606.         mplayer.drawself()
  607.         options.drawself()
  608.         credits.drawself()
  609.         func_exit.drawself()       
  610.        
  611.         fb=fa
  612.         SetAlpha(fb)
  613.         DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2)      'blured button
  614.         DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
  615.         DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
  616.         DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
  617.         DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
  618.        
  619.         splayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-splayer.x2/2+GraphicsWidth()/(16*fe)    'button x/y
  620.         splayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-1-2)*splayer.y2              '(5-x-2) x=stelle des buttons
  621.         mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
  622.         mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
  623.         options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
  624.         options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
  625.         credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
  626.         credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
  627.         func_exit.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-func_exit.x2/2+GraphicsWidth()/(16*fe)
  628.         func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
  629.                
  630.         d:+1
  631.         e:+2   
  632.         If d>=(GraphicsWidth())*2 Then d=1
  633.         If e>=(GraphicsWidth())*2 Then e=2
  634.        
  635.         SetAlpha(ff)   
  636.         DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-d,0,(GraphicsWidth())*3,GraphicsHeight())      'cloud
  637.         DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-e,0,(GraphicsWidth())*3,GraphicsHeight())
  638.        
  639.        
  640.        
  641.  
  642.         ff:-0.02                'splash-screen(eigentlicher credits)
  643.         If ff<0 Then ff=0
  644.         SetAlpha(ff)
  645.         DrawImageRect(IMG_credits,0,0,GraphicsWidth(),GraphicsHeight())    
  646.        
  647.        
  648.        
  649.         If maskdrawn=0      'shadow-rahmen
  650.             SetAlpha(1)
  651.             DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
  652.             maskdrawn=1
  653.         EndIf
  654.        
  655.        
  656.        
  657.         Flip 0
  658.         fpsl()
  659.     Until ende_credits=1
  660.     FlushMouse()
  661.     ende_credits=0
  662.     ff=1
  663. End Function
  664.  
  665. '=======================================================================================================
  666.  
  667. Function do_exit()
  668.     SetAlpha(1)
  669.     fa=0
  670.     a=1
  671.     fb=0
  672.    
  673.     Local temp_img0:TImage=BUT_splayer[2]
  674.     Local temp_img1:TImage=BUT_mplayer[2]
  675.     Local temp_img2:TImage=BUT_options[2]
  676.     Local temp_img3:TImage=BUT_credits[2]
  677.     Local temp_img4:TImage=BUT_exit[2]
  678.    
  679.     Repeat
  680.         Cls
  681.         fb=a-fa
  682.         SetAlpha(fb)
  683.         DrawImageRect(IMG_menu_0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-GraphicsWidth()/Int((64*fc)),(GraphicsHeight()-MouseYy)/Int((32*fc))-GraphicsHeight()/Int((64*fc))-GraphicsHeight()/Int((64*fc)),GraphicsWidth()+GraphicsWidth()/Int((16*fc)),GraphicsHeight()+GraphicsHeight()/Int((16*fc)))
  684.         DrawImageRect(IMG_menu_1,(GraphicsWidth()-MouseXx)/Int((16*fd))-GraphicsWidth()/Int((32*fd))-GraphicsWidth()/Int((32*fd)),(GraphicsHeight()-MouseYy)/Int((16*fd))-GraphicsHeight()/Int((32*fd))-GraphicsHeight()/Int((32*fd)),GraphicsWidth()+GraphicsWidth()/Int((16*fd)),GraphicsHeight()+GraphicsHeight()/Int((16*fd)))
  685.         splayer.drawself()
  686.         mplayer.drawself()
  687.         options.drawself()
  688.         credits.drawself()
  689.         func_exit.drawself()
  690.         If fa>1
  691.             SetAlpha(2-fa)
  692.             fa:+0.02
  693.         Else
  694.             SetAlpha(fa)
  695.         EndIf
  696.         DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2)
  697.         DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
  698.         DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
  699.         DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
  700.         DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
  701.        
  702.         SetAlpha(1)
  703.         DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
  704.         fa:+0.02
  705.        
  706.         If fa>2 Then End
  707.        
  708.         Flip 0
  709.         fpsl()
  710.     Forever
  711. End Function
  712.  
  713.  
  714. Function fpsl()
  715. While FPS_LAST > (MilliSecs() - (1000/FPS_MAX))
  716.  
  717.     Delay FPS_LAST - (MilliSecs() - (1000/FPS_MAX))-1
  718.    
  719. End While
  720. FPS_Last = MilliSecs()
  721. End Function
  722.  
  723.  
  724.  
  725. '=======================================================================================================
  726. '=======================================================================================================
  727. '=======================================================================================================
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735. 'Main
  736.  
  737. AppTitle$="Economy Wars"
  738. Graphics(800,600)
  739. SetBlend ALPHABLEND
  740.  
  741. 'loading and preparing files
  742.  
  743. DrawText "Loading Images...",0,GraphicsHeight()-25
  744. process_intro=0.01;process_intro_bar(process_intro);Flip
  745. IMG_intro=LoadImage("gfx\HUD\bg\economywars.jpg",MASKEDIMAGE)
  746. IMG_menu=LoadImage("gfx\HUD\bg\menu.jpg",MASKEDIMAGE)
  747. IMG_menu_overlay=LoadImage("gfx\HUD\bg\menu_overlay.png",MASKEDIMAGE)
  748. process_intro=0.05;process_intro_bar(process_intro);Flip
  749. IMG_menu_0=LoadImage("gfx\HUD\bg\menu_0.jpg",MASKEDIMAGE)
  750. IMG_menu_1=LoadImage("gfx\HUD\bg\menu_1.png",MASKEDIMAGE)
  751. process_intro=0.1;process_intro_bar(process_intro);Flip
  752. IMG_mask=LoadImage("gfx\HUD\bg\mask.png",MASKEDIMAGE)
  753. IMG_credits=LoadImage("gfx\HUD\bg\credits.png",MASKEDIMAGE)
  754.  
  755. process_intro=0.12;process_intro_bar(process_intro);Flip
  756. BUT_splayer[0]=LoadImage("gfx\HUD\menu\splayer.png",MASKEDIMAGE)
  757. BUT_splayer[1]=LoadImage("gfx\HUD\menu\splayer_over.png",MASKEDIMAGE)
  758. BUT_splayer[2]=LoadImage("gfx\HUD\menu\splayer_blur.png",MASKEDIMAGE)
  759. process_intro=0.14;process_intro_bar(process_intro);Flip
  760. BUT_mplayer[0]=LoadImage("gfx\HUD\menu\mplayer.png",MASKEDIMAGE)
  761. BUT_mplayer[1]=LoadImage("gfx\HUD\menu\mplayer_over.png",MASKEDIMAGE)
  762. BUT_mplayer[2]=LoadImage("gfx\HUD\menu\mplayer_blur.png",MASKEDIMAGE)
  763. process_intro=0.16;process_intro_bar(process_intro);Flip
  764. BUT_options[0]=LoadImage("gfx\HUD\menu\options.png",MASKEDIMAGE)
  765. BUT_options[1]=LoadImage("gfx\HUD\menu\options_over.png",MASKEDIMAGE)
  766. BUT_options[2]=LoadImage("gfx\HUD\menu\options_blur.png",MASKEDIMAGE)
  767. process_intro=0.18;process_intro_bar(process_intro);Flip
  768. BUT_credits[0]=LoadImage("gfx\HUD\menu\credits.png",MASKEDIMAGE)
  769. BUT_credits[1]=LoadImage("gfx\HUD\menu\credits_over.png",MASKEDIMAGE)
  770. BUT_credits[2]=LoadImage("gfx\HUD\menu\credits_blur.png",MASKEDIMAGE)
  771. process_intro=0.2;process_intro_bar(process_intro);Flip
  772. BUT_exit[0]=LoadImage("gfx\HUD\menu\exit.png",MASKEDIMAGE)
  773. BUT_exit[1]=LoadImage("gfx\HUD\menu\exit_over.png",MASKEDIMAGE)
  774. BUT_exit[2]=LoadImage("gfx\HUD\menu\exit_blur.png",MASKEDIMAGE)
  775.  
  776. process_intro=0.22;process_intro_bar(process_intro);Flip
  777. IMG_cloud0=LoadImage("gfx\HUD\menu\menu_cloud0.png",MASKEDIMAGE)
  778. IMG_cloud1=LoadImage("gfx\HUD\menu\menu_cloud0.png",MASKEDIMAGE)
  779. process_intro=0.24;process_intro_bar(process_intro);Flip
  780. OBUT_up=LoadImage("gfx\HUD\menu\options_up0.png",MASKEDIMAGE)
  781. OBUT_uptext=LoadImage("gfx\HUD\menu\options_up1.png",MASKEDIMAGE)
  782. OBUT_name=LoadImage("gfx\HUD\menu\options_username.png",MASKEDIMAGE)
  783. process_intro=0.26;process_intro_bar(process_intro);Flip
  784. OBUT_ip=LoadImage("gfx\HUD\menu\options_connect.png",MASKEDIMAGE)
  785. OBUT_port=LoadImage("gfx\HUD\menu\options_port.png",MASKEDIMAGE)
  786. OBUT_down=LoadImage("gfx\HUD\menu\options_down.png",MASKEDIMAGE)
  787. process_intro=0.28;process_intro_bar(process_intro);Flip
  788. OBUT_textmark=LoadImage("gfx\HUD\menu\textmark.png",MASKEDIMAGE)
  789. process_intro=0.30;process_intro_bar(process_intro);Flip
  790. OBUT_button_up=LoadImage("gfx\HUD\menu\options_button_up.png",MASKEDIMAGE)
  791. OBUT_button_save=LoadImage("gfx\HUD\menu\options_button_save.png",MASKEDIMAGE)
  792. OBUT_button_cancel=LoadImage("gfx\HUD\menu\options_button_cancel.png",MASKEDIMAGE)
  793. OBUT_button_down=LoadImage("gfx\HUD\menu\options_button_down.png",MASKEDIMAGE)
  794. OBUT_button_save2=LoadImage("gfx\HUD\menu\options_button_save_over.png",MASKEDIMAGE)
  795. OBUT_button_cancel2=LoadImage("gfx\HUD\menu\options_button_cancel_over.png",MASKEDIMAGE)
  796.  
  797.  
  798.  
  799.  
  800. SetColor(0,0,0);DrawRect(0,GraphicsHeight()-50,GraphicsWidth(),50)
  801. SetColor(255,255,255)DrawText "Loading Textures...",0,GraphicsHeight()-25
  802.  
  803. process_intro=0.50;process_intro_bar(process_intro);Flip
  804. mask_hud=LoadImage("gfx\HUD\ingame\HUD.png",MASKEDIMAGE)
  805. TEXTURE_ground[0,0]=LoadImage("gfx\texture\ground\dirt_clean.jpg",MASKEDIMAGE)
  806. TEXTURE_ground[0,1]=LoadImage("gfx\texture\ground\dirt_blood0.jpg",MASKEDIMAGE)
  807. TEXTURE_ground[0,2]=LoadImage("gfx\texture\ground\dirt_blood1.jpg",MASKEDIMAGE)
  808. TEXTURE_ground[0,3]=LoadImage("gfx\texture\ground\dirt_blood2.jpg",MASKEDIMAGE)
  809. process_intro=0.52;process_intro_bar(process_intro);Flip
  810. TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\grass_clean.jpg",MASKEDIMAGE)
  811. TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\grass_blood0.jpg",MASKEDIMAGE)
  812. TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\grass_blood1.jpg",MASKEDIMAGE)
  813. TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\grass_blood2.jpg",MASKEDIMAGE)
  814. process_intro=0.54;process_intro_bar(process_intro);Flip
  815. TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\sand_clean.jpg",MASKEDIMAGE)
  816. TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\sand_blood0.jpg",MASKEDIMAGE)
  817. TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\sand_blood1.jpg",MASKEDIMAGE)
  818. TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\sand_blood2.jpg",MASKEDIMAGE)
  819. process_intro=0.56;process_intro_bar(process_intro);Flip
  820. TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\stone_clean.jpg",MASKEDIMAGE)
  821. TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\stone_blood0.jpg",MASKEDIMAGE)
  822. TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\stone_blood1.jpg",MASKEDIMAGE)
  823. TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\stone_blood2.jpg",MASKEDIMAGE)
  824. process_intro=0.58;process_intro_bar(process_intro);Flip
  825. TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\water_clean.jpg",MASKEDIMAGE)
  826. TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\water_blood0.jpg",MASKEDIMAGE)
  827. TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\water_blood1.jpg",MASKEDIMAGE)
  828. TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\water_blood2.jpg",MASKEDIMAGE)
  829.  
  830.  
  831.  
  832. process_intro=1;process_intro_bar(process_intro);Flip
  833. Delay(10)
  834.  
  835. 'kann später weg...
  836. SetAlpha(0.05)
  837. SetColor(0,0,0)
  838. For a=0 To 100
  839. DrawRect(0,0,GraphicsWidth(),GraphicsHeight());Flip 0
  840. Delay(10)
  841. Next
  842. SetColor(255,255,255)
  843. 'bis hierhin
  844.  
  845. fa=0
  846. a=0
  847. SetAlpha(0)
  848. DrawImage(IMG_cloud0,0,0)
  849. DrawImage(IMG_cloud1,0,0)
  850.  
  851. Repeat'intro
  852. Cls
  853.  
  854.  
  855.  
  856. If KeyHit(KEY_SPACE) Or MouseHit(1) Then Ende_intro=1
  857.  
  858. If a=0 And fa<2
  859.     fa:+0.01
  860. EndIf
  861. If fa>=2
  862.     a=1
  863. EndIf
  864. If a=1
  865.     fa:-0.01
  866. EndIf
  867. If a=1 And fa<0
  868.     ende_intro=1
  869. EndIf
  870.  
  871. SetAlpha(fa)
  872. DrawImageRect(IMG_intro,0,0,GraphicsWidth(),GraphicsHeight())
  873.  
  874. fpsl()
  875. Flip 0
  876. Until Ende_intro=1
  877.  
  878. '=======================================================================================================
  879. defaults()'restore defaults
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.         Global splayer:TButton=New TButton
  890.         Global mplayer:TButton=New TButton
  891.         Global options:TButton=New TButton
  892.         Global credits:TButton=New TButton
  893.         Global func_exit:TButton=New TButton
  894.  
  895. '=======================================================================================================
  896.  
  897. Repeat'menu
  898. Cls
  899. If KeyDown(KEY_ESCAPE) Or KeyDown(KEY_F10) Or AppTerminate() Then End
  900. If a<>1
  901.     If KeyHit(KEY_SPACE) Or MouseHit(1)
  902.     fa=1;a=1;EndIf
  903. EndIf
  904.  
  905. maskdrawn=0
  906.  
  907. mousexx=(MouseX()-mousexx)/16+mousexx           'wie sehr soll die bg-verschiebung hinterher hängen
  908. mouseyy=(MouseY()-mouseyy)/16+mouseyy
  909.  
  910. If a=0 And fa<1
  911.     fa:+0.01
  912. EndIf
  913. If fa>=1
  914.     a=1
  915. EndIf
  916. If a=1
  917.     fa=1
  918.     b=1
  919. EndIf
  920.  
  921.  
  922. SetAlpha(fa)
  923. 'BG und 2. BG: entgegen der mauspos von der mitte aus bewegen.
  924. fc=1'menu_0 multiplikator der bg-verschiebungs-verlangsamung
  925. fd=1'menu_1
  926. fe=1'buttons
  927. DrawImageRect(IMG_menu_0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-GraphicsWidth()/Int((64*fc)),(GraphicsHeight()-MouseYy)/Int((32*fc))-GraphicsHeight()/Int((64*fc))-GraphicsHeight()/Int((64*fc)),GraphicsWidth()+GraphicsWidth()/Int((16*fc)),GraphicsHeight()+GraphicsHeight()/Int((16*fc)))
  928. DrawImageRect(IMG_menu_1,(GraphicsWidth()-MouseXx)/Int((16*fd))-GraphicsWidth()/Int((32*fd))-GraphicsWidth()/Int((32*fd)),(GraphicsHeight()-MouseYy)/Int((16*fd))-GraphicsHeight()/Int((32*fd))-GraphicsHeight()/Int((32*fd)),GraphicsWidth()+GraphicsWidth()/Int((16*fd)),GraphicsHeight()+GraphicsHeight()/Int((16*fd)))
  929.  
  930.  
  931.  
  932. If b=1      'wenn hintergrund 100% sichtbar
  933.     If c=1
  934.         fb:+0.02            'fb=pulsierende variable (noch keine zuweisung)
  935.         If fb>1 Then c=0
  936.     Else
  937.         fb:-0.02
  938.         If fb<0.5 Then c=1
  939.     EndIf
  940.     If buttons_done=0
  941.         buttons_done=1
  942.     EndIf
  943. EndIf
  944.  
  945.  
  946. If buttons_done=1           'Buttons initiieren
  947.  
  948.     splayer.image=BUT_splayer[0]
  949.     splayer.x2=400
  950.     splayer.y2=100
  951.    
  952.     mplayer.image=BUT_mplayer[0]
  953.     mplayer.x2=400
  954.     mplayer.y2=100
  955.    
  956.     options.image=BUT_options[0]
  957.     options.x2=400
  958.     options.y2=100
  959.    
  960.     credits.image=BUT_credits[0]
  961.     credits.x2=400
  962.     credits.y2=100
  963.    
  964.     func_exit.image=BUT_exit[0]
  965.     func_exit.x2=400
  966.     func_exit.y2=100
  967.    
  968.    
  969.    
  970.     buttons_done=2
  971. EndIf
  972.  
  973.  
  974. If buttons_done=2                                                                                                   'zeichne buttons
  975.     ff:+0.05    'button-fade in
  976.     If ff>1 Then ff=1
  977.     SetAlpha(ff)
  978.  
  979.     splayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-splayer.x2/2+GraphicsWidth()/(16*fe)
  980.     splayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-1-2)*splayer.y2      '(5-x-2) x=stelle des buttons
  981.     splayer.drawself()
  982.     mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
  983.     mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
  984.     mplayer.drawself()
  985.     options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
  986.     options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
  987.     options.drawself()
  988.     credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
  989.     credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
  990.     credits.drawself()
  991.     func_exit.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-func_exit.x2/2+GraphicsWidth()/(16*fe)
  992.     func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
  993.     func_exit.drawself()
  994.  
  995.    
  996.    
  997.    
  998.     splayer.over()      'mouseover?
  999.     mplayer.over()
  1000.     options.over()
  1001.     credits.over()
  1002.     func_exit.over()
  1003.    
  1004.     splayer.click()     'mouseclick?
  1005.     mplayer.click()
  1006.     options.click()
  1007.     credits.click()
  1008.     func_exit.click()
  1009.        
  1010.     If splayer.over_trigger=1 Then splayer.image=BUT_splayer[1] Else splayer.image=BUT_splayer[0]
  1011.     If mplayer.over_trigger=1 Then mplayer.image=BUT_mplayer[1] Else mplayer.image=BUT_mplayer[0]
  1012.     If options.over_trigger=1 Then options.image=BUT_options[1] Else options.image=BUT_options[0]
  1013.     If credits.over_trigger=1 Then credits.image=BUT_credits[1] Else credits.image=BUT_credits[0]
  1014.     If func_exit.over_trigger=1 Then func_exit.image=BUT_exit[1] Else func_exit.image=BUT_exit[0]
  1015.    
  1016.     If MouseHit(1)
  1017.     If splayer.click_trigger=1 Then Print "splayer.click()"
  1018.     If mplayer.click_trigger=1 Then Print "mplayer.click()"
  1019.     If options.click_trigger=1 Then Print do_options()
  1020.     If credits.click_trigger=1 Then do_credits()
  1021.     If func_exit.click_trigger=1 Then do_exit()
  1022.     EndIf
  1023.    
  1024.    
  1025. EndIf
  1026.  
  1027.  
  1028. Rem
  1029. If b=1
  1030. SetAlpha(fb)
  1031. DrawImageRect(IMG_menu_overlay,MouseX()/8-GraphicsWidth()/16,MouseY()/12-GraphicsHeight()/24,GraphicsWidth(),GraphicsHeight())
  1032. EndIf
  1033. End Rem
  1034.  
  1035. SetAlpha(1)
  1036. If maskdrawn=0
  1037. DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
  1038. maskdrawn=1
  1039. EndIf
  1040.  
  1041.  
  1042. fpsl()
  1043. Flip 0
  1044. Until Ende_menu=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement