def main(): game = Game( config.game['switches'], config.game['columns'], config.game['rows'], config.game['shapes_next_count'], config.game['fps'], config.game['countdown'], config.game['interval'], config.game['score_increments'], config.game['level_increment'], config.game['interval_increment'], config.game['rgb_matrix_hardware'], config.game['rgb_matrix_rows'], config.game['rgb_matrix_chain_length'], config.game['rgb_matrix_parallel'], config.game['rgb_matrix_pwm_bits'], config.game['rgb_matrix_brightness'], config.game['rgb_matrix_lsb_nanoseconds'], config.game['rgb_matrix_gpio_slowdown'], config.game['rgb_matrix_disable_hardware_pulsing'], config.game['rgb_matrix_rgb_sequence'], ) atexit.register(game.__exit__) game.start()
def main(): game = Game() game.start() while True: game.event() game.update() game.draw()
def main(): game = Game(config.game['leds'], config.game['switches'], config.game['countdown'], config.game['game_time'], config.game['score_increment']) game.start() atexit.register(game.__exit__)
def main(): game = Game( config.game['columns'], config.game['rows'], config.game['fps'], config.game['countdown'], config.game['interval'], config.game['score_increment'], config.game['level_increment'], config.game['interval_increment'], ) game.start() atexit.register(game.__exit__)
def play(): """Play the game.""" print("---- Game Setup ----") player_configs = [] num_players = int(input("HOW MANY PLAYERS?\t")) for player_num in range(1, num_players + 1): player_config = {} print(f"\nPLAYER {player_num}:") player_type = input("PLAYER TYPE (default to 'human'):\t") if player_type == '': player_config['player_type'] = None elif player_type not in ('human', 'computer'): invalid_player_type_err_msg = ( f"player_type must be either 'human' or 'computer'; found " f"player_type: '{player_type}'") raise ValueError(invalid_player_type_err_msg) else: player_config['player_type'] = player_type player_name = input("PLAYER NAME (default to generic name):\t") if player_name == '': player_config['name'] = None else: player_config['name'] = player_name player_configs.append(player_config) while True: print("\n\n===========================") print("-*- STARTING A NEW GAME -*-") print("===========================\n") game = Game(player_configs) game.start() new_game_confirmation = input("Start a new game? (y/n):\t") if new_game_confirmation != 'y': print("Thanks for playing!") break
from lib.game import Game from lib.main import MainMenuScene game = Game() game.start(MainMenuScene(game))
# -*- coding: utf-8 -*- # @autor: Felipe Ucelli # @github: github.com/felipeucelli # Módulo próprio from lib.game import Game if __name__ == '__main__': game = Game() game.start()
def main(stdscr): curses.curs_set(0) stdscr.nodelay(1) game = Game(stdscr) return game.start()
# -*- coding: utf-8 -*- # @autor: Felipe Ucelli # @github: github.com/felipeucelli # Built-in from tkinter import Tk # Módulo próprio from lib.game import Game if __name__ == '__main__': main = Tk() root = Game(main) root.start()
# -*- coding: utf-8 -*- import lib.logger # should be called first to set up logging configuration import profile from lib.game import Game g = Game() g.set_engine('sdl') g.set_mod('test') g.start()