Re: Pikapelikisa 3 ilmoittautuminen
Posted: Thu Sep 11, 2008 6:37 pm
Eikös tämän kisan pitäny alkaa 18:00? Miksei ole alkanu?
KILPAILU ON ALKANUT.
Säännöt:
Code: Select all
SAFEEXIT OFF
FrameLimit 60
SCREEN 400,400
ClsColor cbWhiteSkin
Type HEITETYT
Field x As Integer
Field y As Integer
EndType
Repeat
Color cbRed
valinta = Valikko("Uusi peli|Poistu",200,200,200,-1,10,1,255,255,255)
Select valinta
Case 1
i = 0
pisteet = 0
all_pisteet = 0
Repeat
i + 1
pisteet = level(i,i*5,3,i*5)
all_pisteet = all_pisteet + pisteet
Until Not pisteet
Text 0,0,"Selvisit levelliin "+i +" asti."
Text 0,13,"Sinulle kertyi "+all_pisteet+" pistettä."
DrawScreen
WaitKey
Case 2
End
EndSelect
DrawScreen
Forever
Function level(taso,max_virhe,tikat,t_pisteet)
DrawScreen
ClearKeys
Color cbBlack
Text 0,0,"Taso: "+taso
Text 0,13,"Tikat: "+tikat
Text 0,26,"Tarvitset "+t_pisteet+" pistettä voittoon."
Text 0,39,"Aloita painamalla mitä tahansa näppäintä."
DrawScreen
WaitKey
taulu = MakeImage(400,400)
DrawToImage taulu
For i = 0 To 360 Step 40
Color cbWhite
If Not i Mod 80 Then Color cbRed
Circle i/2,i/2,400-i
Next i
DrawToScreen
ClearMouse
Repeat
virhex = Rand(-max_virhe,max_virhe)
virhey = Rand(-max_virhe,max_virhe)
PositionMouse Max(Min(MouseX()+virhex,400),0), Max(Min(MouseY()+virhey,400),0)
If MouseHit(1) Then
tikka.HEITETYT = New(HEITETYT)
tikka\x = MouseX()
tikka\y = MouseY()
tikat = tikat - 1
EndIf
DrawImage taulu,0,0
Circle MouseX()-5,MouseY()-5,10
Color cbBlack
For tikka.HEITETYT = Each HEITETYT
Circle tikka\x-5,tikka\y-5,10
Next tikka
DrawScreen
If EscapeKey() Then Return 0
Until tikat = 0
For tikka.HEITETYT = Each HEITETYT
Color cbBlack
pisteet = pisteet + Max(RoundDown((220 - Distance (200, 200, tikka\x, tikka\y) ) / 20),0)
Delete tikka
Next tikka
DeleteImage taulu
Text 0,0,"Sait " + pisteet + " pistettä."
If pisteet < t_pisteet Then
Text 0,13,"Tarvitsit "+T_pisteet+" pistettä."
DrawScreen
WaitKey
Return 0
EndIf
DrawScreen
WaitKey
Return pisteet
EndFunction
Function Valikko(teksti$,x,y,w = -1,h = -1,vali=10,center = 1,r2 = 0,g2 = 0,b2 = 0,hit_type = 2,nappi = 1,nappulan_muoto=0,muoto = 0)
If h = -1 Then h = TextHeight(teksti$)+20
For i = 1 To Int(CountWords(teksti$,"|"))
If tw < TextWidth(GetWord(teksti$,i,"|")) Then tw = TextWidth(GetWord(teksti$,i,"|"))
Next i
If center Then
th = TextHeight(" ")
y = y - (Int(CountWords(teksti$,"|"))*h+(Int(CountWords(teksti$,"|"))-1)*vali)/2
x = x - w/2
EndIf
For i = 1 To Int(CountWords(teksti$,"|"))
If Painike(GetWord(teksti$,i,"|"),x,y,w,h,r2,g2,b2,hit_type,nappi,nappulan_muoto) Then palautus = i
y = y + vali + h
Next i
Select palautus
Case 0
Select muoto
Case 0
Return 0
Case 1
Return ""
EndSelect
Default
Select muoto
Case 0
Return palautus
Case 1
Return GetWord(teksti$,palautus,"|")
EndSelect
EndSelect
EndFunction
Function Painike(teksti$,x,y,w = -1,h = -1,r2 = 0,g2 = 0,b2 = 0,hit_type = 2,nappi = 1,nappulan_muoto=0)
r = getRGB(RED)
g = getRGB(GREEN)
b = getRGB(BLUE)
If w = -1 Then w = TextWidth(teksti$)+20
If h = -1 Then h = TextHeight(teksti$)+20
If MouseON(x,y,w,h,True) Then
Color Max(r - 50,0),Max(g - 50,0),Max(b - 50,0)
Select HIT_TYPE
Case 0
If MouseHit(nappi) Then klikattu = True
Case 1
If MouseDown(nappi) Then klikattu = True
Case 2
If MouseUp(nappi) Then klikattu = True
EndSelect
EndIf
Select nappulan_muoto
Case 0
Box x + 1,y + 1,w-2,h-2
Case 1
Ellipse x + 1,y + 1,w-2,h-2
EndSelect
Color r2,g2,b2
Select nappulan_muoto
Case 0
Box x,y,w,h,False
Case 1
Ellipse x,y,w,h,False
EndSelect
CenterText x+w/2,y+h/2,teksti$,2
Color r,g,b
Return klikattu
EndFunction
Function MouseON(x1,y1,x2,y2,wh = 0)
If wh Then
x2 = x1 + x2
y2 = y1 + y2
EndIf
If x1 <= MouseX() And y1 <= MouseY() And x2 >= MouseX() And y2 >= MouseY() Then Return 1
Return 0
EndFunction
Päivitin peliä.
Jos vaikka valikko on itse peli ja tikanheitto minipeli sen pelin sisällä.