示例#1
0
    def __init__(self):
        self.buttons = []
        self.menu = Menu()
        self.gui = GUI()
        self.bg = None
        pygame.init()

        self.screen = pygame.display.set_mode((160 * 4, 144 * 4))
        pygame.display.set_caption("Suscribete a BettaTech!")

        clock = pygame.time.Clock()
        clock.tick(60)

        self.initPokemonStats()
        #Attacks
        #Button(500, 500, 100, 40, 'Attack', self.makeTurn)
        self.pokemon1.attacks = [
            Attack("Cabezazo", 11, PHYSICAL, 10, 90, 100),
            Attack("Hidrobomba", 10, SPECIAL, 10, 110, 100)
        ]
        self.pokemon2.attacks = [
            Attack("Ala de Acero", 10, PHYSICAL, 10, 85, 100)
        ]
        self.loadResources()
        print('Resources loaded succesfully')
        #Start battle
        self.battle = Battle(self.pokemon1, self.pokemon2)

        self.stopped = False
        print('Initialization finished')
示例#2
0
文件: dbops.py 项目: mthak/classmojo
 def get_meta():
     mylist = []
     print Battle().to_mongo()
     for data in Battle.objects[:10]:
         mylist.append(json.loads(data.to_json()))
         print data.to_json()
     if mylist is None:
         return jsonify("404 not found")
     return mylist
示例#3
0
文件: dbops.py 项目: mthak/classmojo
    def post_meta(payload):
        print "payload ::", payload

        date = datetime.now()
        my_timezone = timezone('US/Pacific')
        date = my_timezone.localize(date)
        date = date.astimezone(my_timezone)
        print "date is ", date

        battle = Battle(Developer_Issues=payload['Developer_Issues'],
                        Issues_Resolved=payload['Issues_Resolved'],
                        Issues_Pending=payload['Issues_Pending'],
                        Component_Failures=payload['Component_Failures'],
                        Component_Issues=payload['Component_Issues'],
                        Jiras=payload['Jiras']
                        # Date_Updated=date
                        )
        battle.save()
示例#4
0
文件: main.py 项目: Nogthings/pykemon
    while not command:
        tmp_command = input("What should " + pokemon.name + " do?").split(" ")
        if len(tmp_command) == 2:
            print(tmp_command)
            try:
                if tmp_command[0] == DO_ATTACK and 0 <= int(
                        tmp_command[1]) < 4:
                    command = Command({DO_ATTACK: int(tmp_command[1])})
            except Exception:
                pass
    return command


#Start battle

battle = Battle(pokemon1, pokemon2)

while not battle.is_finished():
    #Main pokemon battle loop
    #First ask for the commands
    command1 = ask_command(pokemon1)
    command2 = ask_command(pokemon2)

    #Generate new turn
    turn = Turn()
    turn.command1 = command1
    turn.command2 = command2

    if turn.can_start():
        # Execute turn
        battle.execute_turn(turn)