Tässä oma pikku tuotokseni. Sukulaiset tulivat ajoissa kylää ja aikaa tekemiseen jäi noin tunti, joten koodi voi olla siistimätöntä ja listojen lataus ja tallennus jäi pois mutta laitan kuitenkin.
Code: Select all
SCREEN 320,240
Dim name(10) As String
Dim score(10)
sw = ScreenWidth()
sh = ScreenHeight()
SetWindow "Ûber 1337 minigame"
//load()
//Menu
alku:
Repeat
Text sw/2 - TextWidth("Start Game")/2, 80, "Start Game"
Text sw/2 - TextWidth("High Scores")/2, 120, "High Scores"
Text sw/2 - TextWidth("Quit")/2, 160, "Quit"
If MouseY() > 70 And MouseX() > sw/2-50 And MouseX() < sw/2+50 Then
s = (MouseY()-70) / 25
Else
s = 0
EndIf
For i = 1 To 3
Color 255,255,255
If s = i Then Color 255,0,0
Box sw/2 - 50, 70 + (i-1) * 40, 100, 30, 0
Next i
Color 255,255,255
If MouseHit(1) And s <> 0 Then
Select s
Case 1
Exit
Case 2
Goto pojot
Case 3
//save()
End
EndSelect
EndIf
DrawScreen
Forever
Type lines
Field y
Field hole
EndType
FrameLimit 40
Print "Press any key to start game!"
WaitKey
points = 0
alku = Timer()
x = sw/2
y = 10
Color 255,255,255
Cls
Repeat
For l.lines = Each lines
If Distance(0, y + 5, 0, l\y) < 5 Then
If x < l\hole or x > l\hole + 30
touch = True
Else
touch = False
add = Timer()
EndIf
EndIf
l\y = l\y - 1//Min(Max(points / 5, 1), 5)
Box 0,l\y,l\hole,1
Box l\hole+30,l\y,sw,1
Next l
If add <> 0 And Timer() - add > 200 Then points + 1 : add = False
If Timer()-alku > 2000-(Min(Max(points / 5, 1), 4)*300) Then
l.lines = New(lines)
l\y = sh
l\hole = Rand(0,sw-30)
alku = Timer()
EndIf
Circle x-5, y-5, 10
x = Max(Min(x + RightKey()*3 - LeftKey()*3, sw-5), 5)
If Not touch Then
y = Min(y + 2, sh-6)
Else
y = y - 1//Min(Max(points / 5, 1), 5)
EndIf
Text sw-TextWidth("Points: "+points), 0, "Points: "+points
If y - 5 <= 0 Then Exit
DrawScreen
Forever
If points > score(9) Then
While Not KeyHit(28)
nimi$ = Input("Gib meh ur namez!: ")
DrawScreen
Wend
CloseInput
score(10) = points
name(10) = nimi$
While Not swapped
swapped = True
For i = 0 To 10
If score(i) < score(i+1) Then
temp$ = name(i)
sc = score(i)
score(i) = score(i+1)
name(i) = name(i+1)
score(i+1) = sc
name(i+1) = temp$
swapped = False
EndIf
Next i
Wend
EndIf
Goto alku
pojot:
Cls
For i = 0 To 9
If name(i) = "" Then namee$ = "Anonymous" Else namee$ = name(i)
Text 25, (i+1)*20, i+1+": "+namee+" - "+score(i)
Next i
DrawScreen
WaitKey
Goto alku
Tehtävä on yksinkertaisuudessaan varoa viivoja joita nousee jatkuvalla syötöllä ylös ja päästä joka viivassa olevaan rakoon. Viiva vie mukanaan ja ylhäällä on kuolema.