Code: Select all
SCREEN 400,300
FrameLimit 30
Const SÄDE = 15
Const MÄÄRÄ= 20
Const VÄLI = 10
Const NOPEUS= 3
Const TÄYTTÖ= 0
Const KÄÄNTYVYYS= 10
Dim XYA(3,MÄÄRÄ)
ClsColor 100,100,100:Cls
Color 0,0,0
Repeat
palkki("Über valikko 3000",50,70,300,20)
If button("Aloita!",120,100,160,20) Then MakeError "Aloitit!"
If button("Ohjeet",120,130,160,20) Then MakeError "Äänestä tätä valikkoa!"
If button("Asetukset",120,160,160,20) Then MakeError "Asetuksia ei ole"
If button("Lopeta",150,190,100,20) Then MakeError "Lopetit! Etkö muka pidä valikostani? >:("
Gosub Luonti
Gosub Muut
DrawScreen
Forever
Luonti:
If LVM=VÄLI Then
If Tehdyt=MÄÄRÄ Then
For f=2 To MÄÄRÄ
XYA(1,f-1)=XYA(1,f)
XYA(2,f-1)=XYA(2,f)
XYA(3,f-1)=XYA(3,f)
Next f
tehdyt-1
EndIf
If Rand(1,2)=1 Then
XYA(1,tehdyt+1)=1
XYA(2,tehdyt+1)=ScreenHeight()-1
XYA(3,tehdyt+1)=Rand(105,165)
Else
XYA(1,tehdyt+1)=ScreenWidth()-1
XYA(2,tehdyt+1)=ScreenHeight()-1
XYA(3,tehdyt+1)=Rand(15,75)
EndIf
tehdyt+1
LVM=0
EndIf
LVM+1
Return
Muut:
For f=1 To tehdyt
XYA(3,f)=XYA(3,f)+Rand(0-kääntyvyys,0+kääntyvyys)
XYA(1,f)=XYA(1,f)-Cos(XYA(3,f))*NOPEUS
XYA(2,f)=XYA(2,f)-Sin(XYA(3,f))*NOPEUS
If XYA(1,f)>ScreenWidth() Then XYA(1,f)=ScreenWidth()-1
If XYA(1,f)<0 Then XYA(1,f)=1
If XYA(2,f)>ScreenHeight() Then XYA(2,f)=ScreenHeight()-1
If XYA(2,f)<0 Then XYA(2,f)=1
RoundDot(XYA(1,f),XYA(2,f),SÄDE,Täyttö)
Next f
Return
Function RoundDot(x,y,säe,tila=1)
Circle x-säe,y-säe,säe*2,tila
Circle (x-säe)+säe/2,(y-säe)+säe/2,säe/2-2,tila
EndFunction
Function Button(Tex$,x,y,w,h)
If MouseX()>x And MouseX()<x+w And MouseY()>y And MouseY()<y+h Then
If MouseDown(1) Then
Color 120,120,120
Else
Color 150,150,150
EndIf
päällä=1
Else
Color 200,200,200
EndIf
Box x+h/2,y,w-h,h
Circle x,y,h
Circle x+w-h,y,h
Color 0,0,0
CenterText x+w/2,y+h/2,Tex$,2
If päällä And MouseUp(1) Then Return 1
EndFunction
Function palkki(Tex$,x,y,w,h)
Color 200,200,200
Box x+h/2,y,w-h,h
Circle x,y,h
Circle x+w-h,y,h
Color 0,0,0
CenterText x+w/2,y+h/2,Tex$,2
EndFunction
Ja eurosisulla on UPEA!
EDIT:
Muokkasin vähän