Exemple #1
0
def main():
    pygame.init()
    gui.tiles.convert_all()

    players = [("Matt",True,False),("Dan",True,False),("Amy",True,False),("Maya",True,False)]
    game = GUI_Game(screen)
    for i,player in enumerate(players):
        name = player[0]
        ai = player[1]
        invert = player[2]
        if name is not None:
            if ai:
                game.players.append(GUI_AI_Player(i,name,screen))
            else:
                game.players.append(GUI_Player(i,name,screen,invert))

    if len(game.players)>=2:
        game.setup()

#        for player in game.players:
#            for i in range(3):
#                player.goods.append(CornBarrel())
#                player.goods.append(IndigoBarrel())
#                player.goods.append(SugarBarrel())
#                player.goods.append(TobaccoBarrel())
#                player.goods.append(CoffeeBarrel())
#            player.buildings.append(Wharf(1))
#            player.buildings.append(SmallMarket(0))
#            player.buildings.append(CoffeeRoaster(1))
#            player.buildings.append(SugarMill(1))
#            player.buildings.append(SmallIndigoPlant(1))
#            player.buildings.append(SmallWarehouse(1))
#            player.buildings.append(LargeWarehouse(1))
#            player.coins = 99
        game.draw(0)
        game.start()

        game.draw(0)
        game.start()
        game.draw_scores()
        valid_input = False
        while not valid_input:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    valid_input = True
                elif event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_ESCAPE:
                        valid_input = True
Exemple #2
0
def main():
    pygame.init()
    gui.tiles.convert_all()
    if android:
        android.init()
        android.map_key(android.KEYCODE_BACK, pygame.K_ESCAPE)

    start_screen = Start_Screen(screen)
    start_screen.draw()
    players = start_screen.get_player()

    #players = [("Matt",False,False),("Dan",True,False)]
    game = GUI_Game(screen)
    for i,player in enumerate(players):
        name = player[0]
        ai = player[1]
        invert = player[2]
        if name is not None:
            if ai:
                game.players.append(GUI_AI_Player(i,name,screen))
            else:
                game.players.append(GUI_Player(i,name,screen,invert))

    if len(game.players)>=2:
        game.setup()
        game.draw(0)
        game.start()
        game.draw_scores()
        valid_input = False
        while not valid_input:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    valid_input = True
                elif event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_ESCAPE:
                        valid_input = True
Exemple #3
0
from text_player import *
from engine.game import Game
from ai.ai_player import Random_Player
from gui import tiles

tiles.convert_all()
game = GUI_Game(screen.get_size())
#game = Game()
#game.players.append(Random_Player(0,"Matt"))
#game.players.append(Random_Player(0,"Amy"))
#game.players.append(Random_Player(0,"Dan"))
game.players.append(GUI_Player(0,"Matt",screen))
game.players.append(GUI_Player(1,"Amy",screen))
game.players.append(GUI_Player(2,"Dan",screen))

game.setup()
from engine.barrels import *
from engine.plantations import *
from engine.buildings import *
for player in game.players:
    for i in range(3):
        player.goods.append(CornBarrel())
        player.goods.append(IndigoBarrel())
        player.goods.append(SugarBarrel())
        player.goods.append(TobaccoBarrel())
        player.goods.append(CoffeeBarrel())
#    player.buildings.append(Wharf(1))
    player.buildings.append(SmallMarket(0))
    player.buildings.append(CoffeeRoaster(1))
    player.buildings.append(SugarMill(1))
    player.buildings.append(SmallIndigoPlant(1))