Tous les cent points, une nouvelle balle apparaît.
La partie est perdue s'il reste moins de deux balles à l'écran.
La roulette de la souris permet de changer le mode de déplacement des raquettes:
Mode 1: (Raquettes noires) Mode "symétrique"
Mode 2: (Raquettes bleues) Mode "jongleur d'élite"
Si quelqu'un connaît le nom du jeu original hautement mieux fait, qu'il n'hésite pas à le préciser. Je l'avais trouvé très bien.
Code : Tout sélectionner
ExamineDesktops()
DW = DesktopWidth(0)
DH = DesktopHeight(0)
DD = DesktopDepth(0)
InitSprite()
InitMouse()
OpenScreen(DW, DH, DD, "")
LoadFont(0, "courier new", 32)
CreateSprite(0, DW, DH)
CreateSprite(1, 16, 16)
StartDrawing(SpriteOutput(1) )
Circle(8, 8, 8, #White)
StopDrawing()
CreateSprite(2, 128, 16)
StartDrawing(SpriteOutput(2) )
Box(0, 0, 128, 16, #White)
Box(2, 2, 124, 12, #Blue)
StopDrawing()
CreateSprite(3, 128, 16)
StartDrawing(SpriteOutput(3) )
Box(0, 0, 128, 16, #White)
Box(2, 2, 124, 12, #Black)
StopDrawing()
Nb = 19
Qty = 7
Dim Ok.I(Nb)
Dim BX.F(Nb)
Dim BY.F(Nb)
Dim BA.F(Nb)
Dim BV.F(Nb)
Lap = 100
For I = 0 To 6
Ok(I) = 1
BX(I) = DW / 2.0
BY(I) = DH / 2.0
BA(I) = Random(628) / 100.0
BV(I) = 4 + Random(40) / 10.0
Next
Repeat
Delay(1)
ExamineMouse()
MDX = MouseDeltaX()
MDY = MouseDeltaY()
Opt = (Opt + MouseWheel() ) & 1
DisplaySprite(0, 0, 0)
For I = 0 To Nb
If Ok(I)
BX.F = BX(I)
BY.F = BY(I)
BA.F = BA(I)
BV.F = BV(I)
DisplaySprite(1, BX, BY)
BX + Cos(BA) * BV
BY + Sin(BA) * BV
If (BX + 16 => (DW - 1) ) Or (BX <= 0)
BA = (#PI / 2.0 - BA) + #PI / 2.0 + Random(1) / 157.0
EndIf
If (BY <= 0)
BA = (#PI - BA) + #PI
EndIf
If BY > (DH - 1.0)
Ok(I) = 0
Qty - 1
If Qty <= 2
Break 2
EndIf
EndIf
If (BY + 16) => (DH - 18)
Deca = -DW
For J = 0 To 1
If (BX + 32 > (RX + Deca) ) And (BX - 16 < (RX + Deca) + 128)
BA = ((#PI - Modif) - BA) + #PI
BY = DH - 58
Score + Qty
If Score => Lap
Lap + 100
New = 1
EndIf
EndIf
Deca + DW
Next
EndIf
If (BY + 16) => (DH - 38)
Deca = - DW
For J = 0 To 1
If (BX + 32 > (RX2 + Deca) ) And (BX - 16 < (RX2 + Deca) + 128)
BA = ((#PI - Modif) - BA) + #PI
BY = (DH - 78)
Score + Qty
If Score => Lap
Lap + 100
New = 1
EndIf
EndIf
Deca + DW
Next
EndIf
DisplaySprite(2 + Opt, RX, (DH - 18.0) )
DisplaySprite(2 + Opt, RX - DW, (DH - 18.0) )
DisplaySprite(2 + Opt, RX2, (DH - 38.0) )
DisplaySprite(2 + Opt, RX2 - DW, (DH - 38.0) )
BX(I) = BX
BY(I) = BY
BV = BV * 1.0001
BV(I) = BV
BA(I) = BA
Else
If New
Qty + 1
Ok(I) = 1
BX(I) = DW / 2.0
BY(I) = DH / 2.0
BA(I) = Random(628) / 100.0
BV(I) = 4 + Random(40) / 10.0
New = 0
EndIf
EndIf
Next
RX + MDX << 2
If RX => DW: RX - DW: EndIf
If RX < 0: RX + DW: EndIf
If Opt
RX2 = DW - RX - 128
Else
RX2 + MDY << 2
EndIf
If RX2 => DW: RX2 - DW: EndIf
If RX2 < 0: RX2 + DW: EndIf
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, Str(Score) )
StopDrawing()
FlipBuffers()
Until MouseButton(2)
CloseScreen()
MessageRequester("Score", Str(Score) + " points")