Étape 1: Vous devrez taper tous ces CODES pour rendre le jeu.
startover :ÉCRAN 10
CLS
PRINT « Ce qui est le nom du joueur 1? »
Player1.name$ d’entrée
PRINT « Ce qui est le nom du joueur 2? »
Player2.name$ d’entrée
IMPRIMER « combien de tours vous voulez jouer? »
Round.total d’entrée
Player1.score = 0
Player2.score = 0
tours = 0
Nouveau:
Tours = Tours + 1
« dessiner le champ
ECRAN 7
CLS
PEINTURE (5, 5), (2)
LIGNE (0, 0)-(3, 199), 0, BF
LIGNE (0, 199)-319 (194) 0, BF
LIGNE (318, 199)-314 (0) 0, BF
PEINTURE (1, 1), (15), (2).
LIGNE (0, 0)-(0, 200), 0
LIGNE (1, 74)-(3, 144), 0, BF
LIGNE (314, 74)-(319, 144), 0, BF
LIGNE (1, 0)-(319, 20), BF 15,
LIGNE (0, 0)-320 (15) 0, BF
LIGNE (317, 0)-(319, 199), 0, BF
LOCALISER 1, 1
IF player1.score > player2.score puis
COULEUR 9
D’AUTRE
COLOR 12
END IF
IF player1.score = player2.score THEN
COULEUR 15
END IF
PRINT "Score:";" "; Player2.Name$ ; ":"; Player2.score ; " "; Player1.Name$ ; ":"; Player1.score
Se tours > round.total puis
GOTO quit
END IF
Player1.x = 300
Player1.y = 95
Player2.x = 12
Player2.y = 95
Player1.Move$ = « n »
Player2.Move$ = « n »
ball.x = 163
ball.y = 3 * INT(55 * RND) + 26
x = INT(2 * RND)
IF x = 1 alors
ball.ns = 3
D’AUTRE
ball.ns = -3
END IF
x = INT(2 * RND)
IF x = 1 alors
ball.EW = 3
D’AUTRE
ball.EW = -3
END IF
ball.x.2 = ball.x
ball.y.2 = ball.y
Player1.x.2 = player1.x
Player1.y.2 = player1.y
Player2.x.2 = player2.x
Player2.y.2 = player2.y
Player1.ns = 0
Player1.EW = 0
Player2.ns = 0
Player2.EW = 0
a:
CERCLE (ball.x.2, ball.y.2), 6, 2
PEINTURE (ball.x.2, ball.y.2), (2), (2)
LIGNE (player1.x.2, player1.y.2 + 1)-(player1.x.2 + 6, player1.y.2 + 23), 2, BF
LIGNE (player2.x.2, player2.y.2 + 1)-(player2.x.2 + 6, player2.y.2 + 23), 2, BF
LIGNE (player1.x, player1.y + 1)-(player1.x + 6, player1.y + 23), 9, BF
LIGNE (player2.x, player2.y + 1)-(player2.x + 6, player2.y + 23), 12, BF
CERCLE (ball.x, ball.y), 6, 14
PEINTURE (ball.x, ball.y), (14), (14)
Flicker.Control = 6000000'
Count = 1 à Flicker.Control
Nombre suivant
ball.x.2 = ball.x
ball.y.2 = ball.y
Player1.x.2 = player1.x
Player1.y.2 = player1.y
Player2.x.2 = player2.x
Player2.y.2 = player2.y
ball.x = ball.x + ball.ew
ball.y = ball.y + ball.ns
Player1.x = player1.x + player1.ew
Player1.y = player1.y + player1.ns
Player2.x = player2.x + player2.ew
Player2.y = player2.y + player2.ns
IF ball.x - 6 = 74 et ball.y GOTO goal.1
END IF
IF ball.x + 6 > = 312 et ball.y > = 74 et ball.y GOTO goal.2
END IF
IF ball.y - ball.ns 6 = 3
END IF
IF ball.y + 6 > = 194 puis
ball.ns = -3
END IF
IF ball.x - ball.ew 6 = 3
END IF
IF ball.x + 6 > = 312 puis
ball.EW = -3
END IF
IF ball.x + 6 > = player1.x AND ball.x - 6 = player1.y AND ball.y ball.ew = - ball.ew
Bruit de IF = 1 THEN
UN SIGNAL SONORE
END IF
END IF
IF ball.x + 6 > = player2.x AND ball.x - 6 = player2.y AND ball.y ball.ew = - ball.ew
Bruit de IF = 1 THEN
UN SIGNAL SONORE
END IF
END IF
IF player1.y player1.ns = 3
END IF
IF player1.y + 24 > = 194 puis
Player1.ns = -3
END IF
IF player1.x player1.ew = 3
END IF
IF player1.x + 6 > = 312 puis
Player1.EW = -3
END IF
IF player2.y player2.ns = 3
END IF
IF player2.y + 24 > = 194 puis
Player2.ns = -3
END IF
IF player2.x player2.ew = 3
END IF
IF player2.x + 6 > = 312 puis
Player2.EW = -3
END IF
bouger$ = INKEY$
SELECT CASE bouger$
CASE « p »
LOCALISER 12, 3
COULEUR 15
IMPRIMER « Jeu en pause, appuyez sur espace pour continuer »
TANDIS QUE INKEY$ WEND
LIGNE (10, 44)-(310, 144), BF 2,
CASE « q »
GOTO quit
"Joueur1 changement de mouvement
AFFAIRE « 8 »
Player1.ns = -3
AFFAIRE « 6 »
Player1.EW = 3
AFFAIRE « 2 »
Player1.ns = 3
AFFAIRE « 4 »
Player1.EW = -3
AFFAIRE « 5 »
Player1.EW = 0
Player1.ns = 0
« changement player2 en mouvement
AFFAIRE « i »
Player2.ns = -3
CASE « l »
Player2.EW = 3
AFFAIRE «, »
Player2.ns = 3
CASE « m »
Player2.ns = 3
CASE « j »
Player2.EW = -3
CASE « k »
Player2.EW = 0
Player2.ns = 0
END SELECT
GOTO un
Goal.1 :
LOCALISER 14, 2
COULEUR 9
IMPRIMER « Goal! »
Player1.score = player1.score + 1
TANDIS QUE INKEY$ WEND
GOTO nouveau
Goal.2 :
COULEUR 4
LOCALISER 14, 35
IMPRIMER « Goal! »
Player2.score = player2.score + 1
TANDIS QUE INKEY$ WEND
GOTO nouveau
cesser de fumer :
LOCALISER 12, 6
COULEUR 4
IMPRESSION « Game Over »
LOCALISER 13, 6
IMPRIMER "vous voulez rejouer ? o/n"
FAIRE
y.n$ = INKEY$
BOUCLE jusqu'à ce que y.n$ = « y » y.n$ OR = « n »
IF y.n$ = « y » THEN
GOTO startover
END IF