Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '-----By Lou & Sky
- SuperStrict
- 'intro
- Global Ende_intro:Int=0
- Global Ende_Menu:Int=0
- Global ende_credits:Int=0
- Global Ende_options:Int=0
- Global process_intro:Float=0
- Global buttons_done:Int=0
- Global maskdrawn:Int=0
- Global Mousexx:Int=0
- Global Mouseyy:Int=0
- Global ip:String="0.0.0.0"
- Global port:String="0"
- Global username:String="name"
- Global iplang:Int
- Global portlang:Int
- Global namelang:Int
- Global IMG_intro:TImage 'menu
- Global IMG_menu:TImage
- Global IMG_menu_overlay:TImage
- Global IMG_menu_0:TImage
- Global IMG_menu_1:TImage
- Global IMG_mask:TImage
- Global IMG_credits:TImage
- Global BUT_splayer:TImage[3] 'menu buttons
- Global BUT_mplayer:TImage[3]
- Global BUT_options:TImage[3]
- Global BUT_credits:TImage[3]
- Global BUT_exit:TImage[3]
- Global IMG_cloud0:TImage 'options
- Global IMG_cloud1:TImage
- Global OBUT_up:TImage 'options buttons
- Global OBUT_uptext:TImage
- Global OBUT_name:TImage
- Global OBUT_ip:TImage
- Global OBUT_port:TImage
- Global OBUT_down:TImage
- Global OBUT_button_up:TImage
- Global OBUT_button_save:TImage
- Global OBUT_button_cancel:TImage
- Global OBUT_button_save2:TImage
- Global OBUT_button_cancel2:TImage
- Global OBUT_button_down:TImage
- Global font_options:TImageFont=LoadImageFont("gfx\font\technott.ttf",38,SMOOTHFONT)
- Global OBUT_textmark:TImage 'textmark
- Global textblink:Float=0
- Global textblinkstate:Int=0
- Global mask_hud:TImage 'ingame
- Global TEXTURE_ground:TImage[5,4] '[X,Y] X=anzahl verschiedener texturen,y=anzahl verschiedener states (blood,clean..)
- Global a:Int,b:Int,c:Int,d:Int
- Global fa:Float,fb:Float,fc:Float,fd:Float,fe:Float,ff:Float
- Global FPS:Float
- Global FPS_MAX:Int = 60
- Global FPS_LAST:Int = MilliSecs()
- '=======================================================================================================
- 'Types
- Type TButton
- Field image:TImage
- Field x:Int,y:Int,x2:Int,y2:Int
- Field click_trigger:Int
- Field over_trigger:Int
- Method drawself()
- DrawImageRect(image,x,y,x2,y2)
- End Method
- Method click()
- If (MouseX()> x And MouseY()>y And MouseX()<x+x2 And MouseY()<y+y2) Then click_trigger=1 Else click_trigger=0
- End Method
- Method over()
- If (MouseX()> x And MouseY()>y And MouseX()<x+x2 And MouseY()<y+y2) Then over_trigger=1 Else over_trigger=0
- End Method
- End Type
- '=======================================================================================================
- 'functions
- Function defaults()
- SetClsColor(0,0,0)
- SetColor(255,255,255)
- SetAlpha(1)
- a=0;b=0;c=0;d=0;fa=0;fb=0;fc=0;fd=0
- End Function
- '=======================================================================================================
- Rem
- Function menu_trigger(trigger:String)
- Select trigger
- Case "splayer"
- Case "mplayer"
- Case "options"
- Case "credits"
- Case "func_exit"
- End Select
- End Function
- End Rem
- '=======================================================================================================
- Function process_intro_bar(process:Float)
- DrawRect(0,GraphicsHeight()-10,GraphicsWidth()*(process),10)
- End Function
- '=======================================================================================================
- Function textmark(x:Int,y:Int)
- If textblinkstate=0 Then textblink:+0.1 Else textblink:-0.1
- If textblink>1 Then textblinkstate=1
- If textblink<0 Then textblinkstate=0
- SetAlpha(textblink)
- DrawImage(OBUT_textmark,x,y)
- End Function
- '=======================================================================================================
- 'Function options_save(ip:String,port:String,username:String)
- 'End Function
- '=======================================================================================================
- Function do_options()
- SetImageFont(font_options)
- FlushKeys()
- Local temp_img0:TImage=BUT_splayer[2]
- Local temp_img1:TImage=BUT_mplayer[2]
- Local temp_img2:TImage=BUT_options[2]
- Local temp_img3:TImage=BUT_credits[2]
- Local temp_img4:TImage=BUT_exit[2]
- fb=1
- a=0
- b=0
- c=12
- d=0
- Local e:Float=1
- Local f:Float=0
- Local g:Float=0
- Local Markierung:Int=0
- Local key:Int
- Local validip:Int
- Local validport:Int
- Local validusername:Int
- Repeat
- Cls
- maskdrawn=0
- mousexx=(MouseX()-mousexx)/c+mousexx 'wie sehr soll die bg-verschiebung hinterher hängen
- mouseyy=(MouseY()-mouseyy)/c+mouseyy
- fb:-0.01 'geschwindigkeit des gesamt-fades
- If fb<=0.5
- fb=0.5
- If d=0 Then d=1
- EndIf
- 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
- 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
- mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
- mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
- options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
- options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
- credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
- credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
- 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)
- func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
- SetAlpha(1)
- 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)))
- SetAlpha(fb)
- 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)))
- SetAlpha(fb*2-1)
- splayer.drawself()
- mplayer.drawself()
- options.drawself()
- credits.drawself()
- func_exit.drawself()
- SetAlpha(1-fb)
- DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2) 'blured buttons
- DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
- DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
- DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
- DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
- a:+1
- b:+2
- If a>=(GraphicsWidth())*2 Then a=1
- If b>=(GraphicsWidth())*2 Then b=2
- SetAlpha((1-fb))
- DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-a,0,(GraphicsWidth())*3,GraphicsHeight()) 'cloud
- DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-b,0,(GraphicsWidth())*3,GraphicsHeight())
- If d=1
- e:+(e*0.2)
- EndIf
- If e>(1.5*50)
- d=2
- e=(0.5*3*50) 'anzahl der buttons/2*höhe der buttons
- EndIf
- SetAlpha((1-fb)*2)
- DrawImageRect(OBUT_up,0, (GraphicsHeight()/2-25-e -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50) 'links head
- 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
- DrawImageRect(OBUT_down,0, (GraphicsHeight()/2+25+e -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50) 'links unten
- If d=2
- f:+0.1
- EndIf
- If f>1
- f=1
- FlushMouse()
- d=3
- EndIf
- SetAlpha(f)
- 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
- DrawImageRect(OBUT_port,0, (GraphicsHeight()/2+25-e+(1*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50) 'linke knöpfe
- DrawImageRect(OBUT_name,0, (GraphicsHeight()/2+25-e+(2*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50)
- If d=4
- If (MouseX()<GraphicsWidth()-200 And MouseY()>(GraphicsHeight()/2+25-e+(0*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))..
- And MouseY()<(GraphicsHeight()/2+25-e+(0*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))+50)
- If MouseHit(1)
- Markierung=1
- 'ip=""
- EndIf
- EndIf
- If (MouseX()<GraphicsWidth()-200 And MouseY()>(GraphicsHeight()/2+25-e+(1*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))..
- And MouseY()<(GraphicsHeight()/2+25-e+(1*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))+50)
- If MouseHit(1)
- Markierung=2
- 'port=""
- EndIf
- EndIf
- If (MouseX()<GraphicsWidth()-200 And MouseY()>(GraphicsHeight()/2+25-e+(2*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))..
- And MouseY()<(GraphicsHeight()/2+25-e+(2*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))+50)
- If MouseHit(1)
- Markierung=3
- 'username=""
- EndIf
- EndIf
- Select Markierung 'zeichne text-markierer
- Case 1
- key=GetChar()
- If key=8 Then ip=ip[0..Len(ip)-1]
- If key=9 Then Markierung=2
- If (key<>0 And key<>8 And key<>9 And key<>13) Then ip=ip+Chr(key)
- textmark(270+TextWidth(ip), (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))
- Case 2
- key=GetChar()
- If key=8 Then port=port[0..Len(port)-1]
- If key=9 Then Markierung=3
- If (key<>0 And key<>8 And key<>9 And key<>13) Then port=port+Chr(key)
- textmark(210+TextWidth(port), (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))
- Case 3
- key=GetChar()
- If key=8 Then username=username[0..Len(username)-1]
- If key=9 Then Markierung=1
- If (key<>0 And key<>8 And key<>9 And key<>13) Then username=username+Chr(key)
- textmark(225+TextWidth(username), (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc))))
- End Select
- If key=13 Then Print "save!"
- EndIf
- SetAlpha(f)
- 'zeichne options-werte
- SetColor(200,110,0)
- DrawText ip,272, (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
- DrawText port,212, (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
- DrawText username,227, (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
- SetColor(250,180,0)
- DrawText ip,270, (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
- DrawText port,210, (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
- DrawText username,225, (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
- SetColor(255,255,255)
- If d=3
- g:+0.05
- EndIf
- If g>3
- g=3
- d=4
- EndIf
- SetAlpha(g)
- DrawImageRect(OBUT_button_up,0, (GraphicsHeight()-150) ,GraphicsWidth(),50)
- SetAlpha(g-0.5)
- If (MouseX()>GraphicsWidth()-200 And MouseY()>(GraphicsHeight()-100) And MouseY()<(GraphicsHeight()-50))
- DrawImageRect(OBUT_button_save2,0, (GraphicsHeight()-100) ,GraphicsWidth(),50)
- If d=4
- If MouseHit(1)
- 'options_save(ip,port,username) 'saving process & ende_options=1
- 'If (validip=1 And validport=1 And validusername=1)
- ende_options=1
- 'Else
- ' Print "warnung"
- 'EndIf
- EndIf
- Else
- DrawImageRect(OBUT_button_save,0, (GraphicsHeight()-100) ,GraphicsWidth(),50)
- EndIf
- SetAlpha(g-1)
- If (MouseX()>GraphicsWidth()-200 And MouseY()>(GraphicsHeight()-50) And MouseY()<(GraphicsHeight()))
- DrawImageRect(OBUT_button_cancel2,0, (GraphicsHeight()-50) ,GraphicsWidth(),50)
- If d=4
- If MouseHit(1) Then Ende_options=1
- EndIf
- Else
- DrawImageRect(OBUT_button_cancel,0, (GraphicsHeight()-50) ,GraphicsWidth(),50)
- EndIf
- 'SetAlpha(g-1.5)
- 'DrawImageRect(OBUT_button_down,0, (GraphicsHeight()-50) ,GraphicsWidth(),50)
- If maskdrawn=0
- SetAlpha(1)
- DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
- maskdrawn=1
- EndIf
- Flip 0;FlushMouse();fpsl();
- Until Ende_Options=1
- options.image=BUT_options[0]
- fb=0.49
- g=2
- Repeat
- Cls
- maskdrawn=0
- mousexx=(MouseX()-mousexx)/c+mousexx 'wie sehr soll die bg-verschiebung hinterher hängen
- mouseyy=(MouseY()-mouseyy)/c+mouseyy
- fb:+0.01 'geschwindigkeit des gesamt-fades
- If fb>1
- fb=1
- Ende_options=2
- EndIf
- 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
- 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
- mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
- mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
- options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
- options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
- credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
- credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
- 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)
- func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
- SetAlpha(1)
- 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)))
- SetAlpha(fb)
- 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)))
- SetAlpha(fb*2-1)
- splayer.drawself()
- mplayer.drawself()
- options.drawself()
- credits.drawself()
- func_exit.drawself()
- SetAlpha(1-(fb))
- DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2) 'blured buttons
- DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
- DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
- DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
- DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
- a:+1
- b:+2
- If a>=(GraphicsWidth())*2 Then a=1
- If b>=(GraphicsWidth())*2 Then b=2
- SetAlpha(1-(fb))
- DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-a,0,(GraphicsWidth())*3,GraphicsHeight())
- DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-b,0,(GraphicsWidth())*3,GraphicsHeight())
- SetAlpha(2-(fb*2))
- DrawImageRect(OBUT_up,0, (GraphicsHeight()/2-25-e -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50)
- DrawImageRect(OBUT_uptext,Max(0,Min(400,(Mousexx-75))), (GraphicsHeight()/2-25-e -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50)
- DrawImageRect(OBUT_down,0, (GraphicsHeight()/2+25+e -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50)
- SetAlpha(2-(fb*2))
- 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
- DrawImageRect(OBUT_port,0, (GraphicsHeight()/2+25-e+(1*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50)
- DrawImageRect(OBUT_name,0, (GraphicsHeight()/2+25-e+(2*50) -((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))) ,GraphicsWidth(),50)
- SetAlpha(2-(fb*2))
- SetColor(200,110,0)
- DrawText ip,272, (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
- DrawText port,212, (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
- DrawText username,227, (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+9
- SetColor(250,180,0)
- DrawText ip,270, (GraphicsHeight()/2+25-e+(0*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
- DrawText port,210, (GraphicsHeight()/2+25-e+(1*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
- DrawText username,225, (GraphicsHeight()/2+25-e+(2*50))-((0.25*(GraphicsHeight()))-(GraphicsHeight()-MouseYy)/Int((4*fc)))+7
- SetColor(255,255,255)
- g:-0.05
- SetAlpha(g-1)
- DrawImageRect(OBUT_button_up,0, (GraphicsHeight()-150) ,GraphicsWidth(),50)
- SetAlpha(g-0.5)
- DrawImageRect(OBUT_button_save,0, (GraphicsHeight()-100) ,GraphicsWidth(),50)
- SetAlpha(g)
- DrawImageRect(OBUT_button_cancel,0, (GraphicsHeight()-50) ,GraphicsWidth(),50)
- If maskdrawn=0
- SetAlpha(1)
- DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
- maskdrawn=1
- EndIf
- Flip 0;fpsl()
- Until Ende_options=2
- Ende_options=0
- d=0
- ff=1
- g=0
- End Function
- '=======================================================================================================
- Function do_credits()
- FlushKeys()
- Local temp_img0:TImage=BUT_splayer[2]
- Local temp_img1:TImage=BUT_mplayer[2]
- Local temp_img2:TImage=BUT_options[2]
- Local temp_img3:TImage=BUT_credits[2]
- Local temp_img4:TImage=BUT_exit[2]
- fa=0
- a=1
- fb=0
- ff=0
- b=0
- c=8
- Local d:Int
- Local e:Int
- Repeat
- Cls
- If b=0
- mousexx=(MouseX()-mousexx)/c+mousexx 'wie sehr soll die bg-verschiebung hinterher hängen
- mouseyy=(MouseY()-mouseyy)/c+mouseyy
- c:+4
- EndIf
- fb=a-fa
- If fa>0.35 Then b=1
- If fa>0.5 Then fa=0.5
- SetAlpha(fb)
- 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)))
- SetAlpha(1)
- 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)))
- fb=a-fa*2
- SetAlpha(fb)
- splayer.drawself()
- mplayer.drawself()
- options.drawself()
- credits.drawself()
- func_exit.drawself()
- fb=fa
- SetAlpha(fb)
- DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2) 'blured buttons
- DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
- DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
- DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
- DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
- 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
- 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
- mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
- mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
- options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
- options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
- credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
- credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
- 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)
- func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
- d:+1
- e:+2
- If d>=(GraphicsWidth())*2 Then d=1
- If e>=(GraphicsWidth())*2 Then e=2
- SetAlpha(ff)
- DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-d,0,(GraphicsWidth())*3,GraphicsHeight()) 'cloud
- DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-e,0,(GraphicsWidth())*3,GraphicsHeight())
- If b=1
- ff:+0.02
- If ff>1 Then ff=1 'credits-splash
- SetAlpha(ff)
- DrawImageRect(IMG_credits,0,0,GraphicsWidth(),GraphicsHeight())
- EndIf
- SetAlpha(1)
- DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
- fa:+0.01
- Flip 0
- fpsl()
- Until GetChar()<>0 Or MouseHit(1) Or MouseHit(2)
- b=128
- credits.image=BUT_credits[0]
- Repeat
- Cls
- maskdrawn=0
- mousexx=(MouseX()-mousexx)/b+mousexx 'wie sehr soll die bg-verschiebung hinterher hängen
- mouseyy=(MouseY()-mouseyy)/b+mouseyy
- b:-8
- If b<16 Then b=16
- fb=a-fa
- If fa<0 Then fa=0
- fa:-0.01
- If fa<0 Then ende_credits=1
- SetAlpha(fb) 'bg
- 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)))
- SetAlpha(1)
- 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)))
- fb=a-fa*2
- SetAlpha(fb)
- splayer.drawself() 'unblured button
- mplayer.drawself()
- options.drawself()
- credits.drawself()
- func_exit.drawself()
- fb=fa
- SetAlpha(fb)
- DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2) 'blured button
- DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
- DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
- DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
- DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
- 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
- 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
- mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
- mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
- options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
- options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
- credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
- credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
- 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)
- func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
- d:+1
- e:+2
- If d>=(GraphicsWidth())*2 Then d=1
- If e>=(GraphicsWidth())*2 Then e=2
- SetAlpha(ff)
- DrawImageRect(IMG_cloud0,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-d,0,(GraphicsWidth())*3,GraphicsHeight()) 'cloud
- DrawImageRect(IMG_cloud1,(GraphicsWidth()-MouseXx)/Int((32*fc))-GraphicsWidth()/Int((64*fc))-e,0,(GraphicsWidth())*3,GraphicsHeight())
- ff:-0.02 'splash-screen(eigentlicher credits)
- If ff<0 Then ff=0
- SetAlpha(ff)
- DrawImageRect(IMG_credits,0,0,GraphicsWidth(),GraphicsHeight())
- If maskdrawn=0 'shadow-rahmen
- SetAlpha(1)
- DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
- maskdrawn=1
- EndIf
- Flip 0
- fpsl()
- Until ende_credits=1
- FlushMouse()
- ende_credits=0
- ff=1
- End Function
- '=======================================================================================================
- Function do_exit()
- SetAlpha(1)
- fa=0
- a=1
- fb=0
- Local temp_img0:TImage=BUT_splayer[2]
- Local temp_img1:TImage=BUT_mplayer[2]
- Local temp_img2:TImage=BUT_options[2]
- Local temp_img3:TImage=BUT_credits[2]
- Local temp_img4:TImage=BUT_exit[2]
- Repeat
- Cls
- fb=a-fa
- SetAlpha(fb)
- 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)))
- 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)))
- splayer.drawself()
- mplayer.drawself()
- options.drawself()
- credits.drawself()
- func_exit.drawself()
- If fa>1
- SetAlpha(2-fa)
- fa:+0.02
- Else
- SetAlpha(fa)
- EndIf
- DrawImageRect(temp_img0,splayer.x,splayer.y,splayer.x2,splayer.y2)
- DrawImageRect(temp_img1,mplayer.x,mplayer.y,mplayer.x2,mplayer.y2)
- DrawImageRect(temp_img2,options.x,options.y,options.x2,options.y2)
- DrawImageRect(temp_img3,credits.x,credits.y,credits.x2,credits.y2)
- DrawImageRect(temp_img4,func_exit.x,func_exit.y,func_exit.x2,func_exit.y2)
- SetAlpha(1)
- DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
- fa:+0.02
- If fa>2 Then End
- Flip 0
- fpsl()
- Forever
- End Function
- Function fpsl()
- While FPS_LAST > (MilliSecs() - (1000/FPS_MAX))
- Delay FPS_LAST - (MilliSecs() - (1000/FPS_MAX))-1
- End While
- FPS_Last = MilliSecs()
- End Function
- '=======================================================================================================
- '=======================================================================================================
- '=======================================================================================================
- 'Main
- AppTitle$="Economy Wars"
- Graphics(800,600)
- SetBlend ALPHABLEND
- 'loading and preparing files
- DrawText "Loading Images...",0,GraphicsHeight()-25
- process_intro=0.01;process_intro_bar(process_intro);Flip
- IMG_intro=LoadImage("gfx\HUD\bg\economywars.jpg",MASKEDIMAGE)
- IMG_menu=LoadImage("gfx\HUD\bg\menu.jpg",MASKEDIMAGE)
- IMG_menu_overlay=LoadImage("gfx\HUD\bg\menu_overlay.png",MASKEDIMAGE)
- process_intro=0.05;process_intro_bar(process_intro);Flip
- IMG_menu_0=LoadImage("gfx\HUD\bg\menu_0.jpg",MASKEDIMAGE)
- IMG_menu_1=LoadImage("gfx\HUD\bg\menu_1.png",MASKEDIMAGE)
- process_intro=0.1;process_intro_bar(process_intro);Flip
- IMG_mask=LoadImage("gfx\HUD\bg\mask.png",MASKEDIMAGE)
- IMG_credits=LoadImage("gfx\HUD\bg\credits.png",MASKEDIMAGE)
- process_intro=0.12;process_intro_bar(process_intro);Flip
- BUT_splayer[0]=LoadImage("gfx\HUD\menu\splayer.png",MASKEDIMAGE)
- BUT_splayer[1]=LoadImage("gfx\HUD\menu\splayer_over.png",MASKEDIMAGE)
- BUT_splayer[2]=LoadImage("gfx\HUD\menu\splayer_blur.png",MASKEDIMAGE)
- process_intro=0.14;process_intro_bar(process_intro);Flip
- BUT_mplayer[0]=LoadImage("gfx\HUD\menu\mplayer.png",MASKEDIMAGE)
- BUT_mplayer[1]=LoadImage("gfx\HUD\menu\mplayer_over.png",MASKEDIMAGE)
- BUT_mplayer[2]=LoadImage("gfx\HUD\menu\mplayer_blur.png",MASKEDIMAGE)
- process_intro=0.16;process_intro_bar(process_intro);Flip
- BUT_options[0]=LoadImage("gfx\HUD\menu\options.png",MASKEDIMAGE)
- BUT_options[1]=LoadImage("gfx\HUD\menu\options_over.png",MASKEDIMAGE)
- BUT_options[2]=LoadImage("gfx\HUD\menu\options_blur.png",MASKEDIMAGE)
- process_intro=0.18;process_intro_bar(process_intro);Flip
- BUT_credits[0]=LoadImage("gfx\HUD\menu\credits.png",MASKEDIMAGE)
- BUT_credits[1]=LoadImage("gfx\HUD\menu\credits_over.png",MASKEDIMAGE)
- BUT_credits[2]=LoadImage("gfx\HUD\menu\credits_blur.png",MASKEDIMAGE)
- process_intro=0.2;process_intro_bar(process_intro);Flip
- BUT_exit[0]=LoadImage("gfx\HUD\menu\exit.png",MASKEDIMAGE)
- BUT_exit[1]=LoadImage("gfx\HUD\menu\exit_over.png",MASKEDIMAGE)
- BUT_exit[2]=LoadImage("gfx\HUD\menu\exit_blur.png",MASKEDIMAGE)
- process_intro=0.22;process_intro_bar(process_intro);Flip
- IMG_cloud0=LoadImage("gfx\HUD\menu\menu_cloud0.png",MASKEDIMAGE)
- IMG_cloud1=LoadImage("gfx\HUD\menu\menu_cloud0.png",MASKEDIMAGE)
- process_intro=0.24;process_intro_bar(process_intro);Flip
- OBUT_up=LoadImage("gfx\HUD\menu\options_up0.png",MASKEDIMAGE)
- OBUT_uptext=LoadImage("gfx\HUD\menu\options_up1.png",MASKEDIMAGE)
- OBUT_name=LoadImage("gfx\HUD\menu\options_username.png",MASKEDIMAGE)
- process_intro=0.26;process_intro_bar(process_intro);Flip
- OBUT_ip=LoadImage("gfx\HUD\menu\options_connect.png",MASKEDIMAGE)
- OBUT_port=LoadImage("gfx\HUD\menu\options_port.png",MASKEDIMAGE)
- OBUT_down=LoadImage("gfx\HUD\menu\options_down.png",MASKEDIMAGE)
- process_intro=0.28;process_intro_bar(process_intro);Flip
- OBUT_textmark=LoadImage("gfx\HUD\menu\textmark.png",MASKEDIMAGE)
- process_intro=0.30;process_intro_bar(process_intro);Flip
- OBUT_button_up=LoadImage("gfx\HUD\menu\options_button_up.png",MASKEDIMAGE)
- OBUT_button_save=LoadImage("gfx\HUD\menu\options_button_save.png",MASKEDIMAGE)
- OBUT_button_cancel=LoadImage("gfx\HUD\menu\options_button_cancel.png",MASKEDIMAGE)
- OBUT_button_down=LoadImage("gfx\HUD\menu\options_button_down.png",MASKEDIMAGE)
- OBUT_button_save2=LoadImage("gfx\HUD\menu\options_button_save_over.png",MASKEDIMAGE)
- OBUT_button_cancel2=LoadImage("gfx\HUD\menu\options_button_cancel_over.png",MASKEDIMAGE)
- SetColor(0,0,0);DrawRect(0,GraphicsHeight()-50,GraphicsWidth(),50)
- SetColor(255,255,255)DrawText "Loading Textures...",0,GraphicsHeight()-25
- process_intro=0.50;process_intro_bar(process_intro);Flip
- mask_hud=LoadImage("gfx\HUD\ingame\HUD.png",MASKEDIMAGE)
- TEXTURE_ground[0,0]=LoadImage("gfx\texture\ground\dirt_clean.jpg",MASKEDIMAGE)
- TEXTURE_ground[0,1]=LoadImage("gfx\texture\ground\dirt_blood0.jpg",MASKEDIMAGE)
- TEXTURE_ground[0,2]=LoadImage("gfx\texture\ground\dirt_blood1.jpg",MASKEDIMAGE)
- TEXTURE_ground[0,3]=LoadImage("gfx\texture\ground\dirt_blood2.jpg",MASKEDIMAGE)
- process_intro=0.52;process_intro_bar(process_intro);Flip
- TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\grass_clean.jpg",MASKEDIMAGE)
- TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\grass_blood0.jpg",MASKEDIMAGE)
- TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\grass_blood1.jpg",MASKEDIMAGE)
- TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\grass_blood2.jpg",MASKEDIMAGE)
- process_intro=0.54;process_intro_bar(process_intro);Flip
- TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\sand_clean.jpg",MASKEDIMAGE)
- TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\sand_blood0.jpg",MASKEDIMAGE)
- TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\sand_blood1.jpg",MASKEDIMAGE)
- TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\sand_blood2.jpg",MASKEDIMAGE)
- process_intro=0.56;process_intro_bar(process_intro);Flip
- TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\stone_clean.jpg",MASKEDIMAGE)
- TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\stone_blood0.jpg",MASKEDIMAGE)
- TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\stone_blood1.jpg",MASKEDIMAGE)
- TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\stone_blood2.jpg",MASKEDIMAGE)
- process_intro=0.58;process_intro_bar(process_intro);Flip
- TEXTURE_ground[1,0]=LoadImage("gfx\texture\ground\water_clean.jpg",MASKEDIMAGE)
- TEXTURE_ground[2,1]=LoadImage("gfx\texture\ground\water_blood0.jpg",MASKEDIMAGE)
- TEXTURE_ground[3,2]=LoadImage("gfx\texture\ground\water_blood1.jpg",MASKEDIMAGE)
- TEXTURE_ground[4,3]=LoadImage("gfx\texture\ground\water_blood2.jpg",MASKEDIMAGE)
- process_intro=1;process_intro_bar(process_intro);Flip
- Delay(10)
- 'kann später weg...
- SetAlpha(0.05)
- SetColor(0,0,0)
- For a=0 To 100
- DrawRect(0,0,GraphicsWidth(),GraphicsHeight());Flip 0
- Delay(10)
- Next
- SetColor(255,255,255)
- 'bis hierhin
- fa=0
- a=0
- SetAlpha(0)
- DrawImage(IMG_cloud0,0,0)
- DrawImage(IMG_cloud1,0,0)
- Repeat'intro
- Cls
- If KeyHit(KEY_SPACE) Or MouseHit(1) Then Ende_intro=1
- If a=0 And fa<2
- fa:+0.01
- EndIf
- If fa>=2
- a=1
- EndIf
- If a=1
- fa:-0.01
- EndIf
- If a=1 And fa<0
- ende_intro=1
- EndIf
- SetAlpha(fa)
- DrawImageRect(IMG_intro,0,0,GraphicsWidth(),GraphicsHeight())
- fpsl()
- Flip 0
- Until Ende_intro=1
- '=======================================================================================================
- defaults()'restore defaults
- Global splayer:TButton=New TButton
- Global mplayer:TButton=New TButton
- Global options:TButton=New TButton
- Global credits:TButton=New TButton
- Global func_exit:TButton=New TButton
- '=======================================================================================================
- Repeat'menu
- Cls
- If KeyDown(KEY_ESCAPE) Or KeyDown(KEY_F10) Or AppTerminate() Then End
- If a<>1
- If KeyHit(KEY_SPACE) Or MouseHit(1)
- fa=1;a=1;EndIf
- EndIf
- maskdrawn=0
- mousexx=(MouseX()-mousexx)/16+mousexx 'wie sehr soll die bg-verschiebung hinterher hängen
- mouseyy=(MouseY()-mouseyy)/16+mouseyy
- If a=0 And fa<1
- fa:+0.01
- EndIf
- If fa>=1
- a=1
- EndIf
- If a=1
- fa=1
- b=1
- EndIf
- SetAlpha(fa)
- 'BG und 2. BG: entgegen der mauspos von der mitte aus bewegen.
- fc=1'menu_0 multiplikator der bg-verschiebungs-verlangsamung
- fd=1'menu_1
- fe=1'buttons
- 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)))
- 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)))
- If b=1 'wenn hintergrund 100% sichtbar
- If c=1
- fb:+0.02 'fb=pulsierende variable (noch keine zuweisung)
- If fb>1 Then c=0
- Else
- fb:-0.02
- If fb<0.5 Then c=1
- EndIf
- If buttons_done=0
- buttons_done=1
- EndIf
- EndIf
- If buttons_done=1 'Buttons initiieren
- splayer.image=BUT_splayer[0]
- splayer.x2=400
- splayer.y2=100
- mplayer.image=BUT_mplayer[0]
- mplayer.x2=400
- mplayer.y2=100
- options.image=BUT_options[0]
- options.x2=400
- options.y2=100
- credits.image=BUT_credits[0]
- credits.x2=400
- credits.y2=100
- func_exit.image=BUT_exit[0]
- func_exit.x2=400
- func_exit.y2=100
- buttons_done=2
- EndIf
- If buttons_done=2 'zeichne buttons
- ff:+0.05 'button-fade in
- If ff>1 Then ff=1
- SetAlpha(ff)
- splayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-splayer.x2/2+GraphicsWidth()/(16*fe)
- 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
- splayer.drawself()
- mplayer.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-mplayer.x2/2+GraphicsWidth()/(16*fe)
- mplayer.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-2-2)*mplayer.y2
- mplayer.drawself()
- options.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-options.x2/2+GraphicsWidth()/(16*fe)
- options.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-3-2)*options.y2
- options.drawself()
- credits.x=(GraphicsWidth()-MouseXx)/Int((8*fe))-GraphicsWidth()/Int((16*fe))-GraphicsWidth()/Int((16*fe))+GraphicsWidth()/2-credits.x2/2+GraphicsWidth()/(16*fe)
- credits.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-4-2)*credits.y2
- credits.drawself()
- 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)
- func_exit.y=(GraphicsHeight()-MouseYy)/Int((8*fe))-GraphicsHeight()/Int((16*fe))-GraphicsHeight()/Int((16*fe))+GraphicsHeight()/2-(5-5-2)*func_exit.y2
- func_exit.drawself()
- splayer.over() 'mouseover?
- mplayer.over()
- options.over()
- credits.over()
- func_exit.over()
- splayer.click() 'mouseclick?
- mplayer.click()
- options.click()
- credits.click()
- func_exit.click()
- If splayer.over_trigger=1 Then splayer.image=BUT_splayer[1] Else splayer.image=BUT_splayer[0]
- If mplayer.over_trigger=1 Then mplayer.image=BUT_mplayer[1] Else mplayer.image=BUT_mplayer[0]
- If options.over_trigger=1 Then options.image=BUT_options[1] Else options.image=BUT_options[0]
- If credits.over_trigger=1 Then credits.image=BUT_credits[1] Else credits.image=BUT_credits[0]
- If func_exit.over_trigger=1 Then func_exit.image=BUT_exit[1] Else func_exit.image=BUT_exit[0]
- If MouseHit(1)
- If splayer.click_trigger=1 Then Print "splayer.click()"
- If mplayer.click_trigger=1 Then Print "mplayer.click()"
- If options.click_trigger=1 Then Print do_options()
- If credits.click_trigger=1 Then do_credits()
- If func_exit.click_trigger=1 Then do_exit()
- EndIf
- EndIf
- Rem
- If b=1
- SetAlpha(fb)
- DrawImageRect(IMG_menu_overlay,MouseX()/8-GraphicsWidth()/16,MouseY()/12-GraphicsHeight()/24,GraphicsWidth(),GraphicsHeight())
- EndIf
- End Rem
- SetAlpha(1)
- If maskdrawn=0
- DrawImageRect(IMG_mask,0,0,GraphicsWidth(),GraphicsHeight())
- maskdrawn=1
- EndIf
- fpsl()
- Flip 0
- Until Ende_menu=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement