This commit is contained in:
Thomas Forgione 2019-03-26 18:06:37 +01:00
parent 77174a8e42
commit aa5b65aecc
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 1 additions and 3 deletions

View File

@ -8,8 +8,6 @@ from tron.game import Game, PositionPlayer
from tron.window import Window
from tron.player import Direction, KeyboardPlayer, Mode
from ais.wallavoider import Ai
# This script shows how to create a game with human players and play it interactively.
# It shows how to create the game, to setup interactive controls for users, and
# to run the game while rendering it on a window with a reasonnable framerate.
@ -31,7 +29,7 @@ def main():
# default direction that will be to the right, and that will use the Z,
# Q, S and D keys.
# The last array defines the initial position of the player.
PositionPlayer(1, Ai(), [0, 0]),
PositionPlayer(1, KeyboardPlayer(Direction.RIGHT, Mode.ZQSD), [0, 0]),
# We create a second player that will use the arrow keys.
PositionPlayer(2, KeyboardPlayer(Direction.LEFT, Mode.ARROWS), [width - 1, height - 1]),