def go_to_main_menu(): if self.profile_name_input.label.text: if self.profile_name_input.label.text[-1] == "|": profile_name = self.profile_name_input.label.text[:-1] else: profile_name = self.profile_name_input.label.text utils.set_scene(menu.Menu(profile_name, load=False))
def go_to_in_game(self): self.passed_profile.games_started += 1 self.passed_profile.save() utils.set_scene( game.Game( profile=self.passed_profile, multiplayer=self.multiplayer_option.label.text, map_size=self.map_size_option.label.text, game_speed=self.game_speed_option.label.text, temperature_volatility=self.temperature_volatility_option.label.text, humidity_volatility=self.humidity_volatility_option.label.text, altitude_volatility=self.altitude_volatility_option.label.text, ) )
import pygame from buffalo import utils def main(): while not utils.end: utils.scene.logic() utils.scene.update() utils.scene.render() utils.delta = utils.clock.tick( utils.FRAMES_PER_SECOND ) if __name__ == "__main__": if not utils.init( caption="Pong Tutorial", ): print("buffalo.utils failed to initialize") pygame.quit() exit() from menu import Menu utils.set_scene( Menu() ) main() pygame.quit()
def goToDebug(self): levelName = self.debugInput.label.text if levelName.endswith("|"): levelName = levelName[:-1] utils.set_scene(debug.Debug(levelName))
from buffalo import utils import menu import profile_creation import profile_selection def main(): while not utils.end: utils.scene.logic() utils.scene.update() utils.scene.render() utils.delta = utils.clock.tick( utils.FRAMES_PER_SECOND ) if __name__ == "__main__": if not utils.init(caption="Simple Kingdom Simulator", fullscreen=True,): print("Buffalo failed to initialize") pygame.quit() sys.exit() profiles = next(os.walk("profiles"))[2] if len(profiles) == 0: # Go to the profile creation Scene utils.set_scene(profile_creation.Profile_Creation()) elif len(profiles) == 1: # Load the only profile and go straight to the main menu utils.set_scene(menu.Menu(profiles[0], load=True)) elif len(profiles) > 1: # Go to the profile selection Scene utils.set_scene(profile_selection.Profile_Selection()) main() pygame.quit()
def go_to_main_menu(self): utils.set_scene(Menu())
def go_to_options(self): utils.set_scene(Options())
import pygame from buffalo import utils from main_menu import MainMenu def main(): while not utils.end: utils.scene.logic() utils.scene.update() utils.scene.render() utils.delta = utils.clock.tick( utils.FRAMES_PER_SECOND ) if __name__ == "__main__": if not utils.init( caption="Mganga", ): print("buffalo.utils failed to initialize") pygame.quit() exit() utils.set_scene( MainMenu() ) main() pygame.quit()
def go_to_new_game(): utils.set_scene(new_game.New_Game(self.profile))
def go_to_play(): utils.set_scene( Play() )
def go_to_profile_creation(): utils.set_scene(profile_creation.Profile_Creation())
def go_to_main_menu(): utils.set_scene(menu.Menu( profile_name=self.profile_option.label.text, load=True ))
def on_escape(self): del self.blasteroids utils.set_scene(Menu())
def goToDebug(self): utils.set_scene(debug.Debug())
def go_to_main_menu(self): utils.set_scene( Menu() )
def go_back_to_main_menu(self): utils.set_scene(menu.Menu(profile=self.passed_profile))
import pygame from buffalo import utils import menu def main(): while not utils.end: utils.scene.logic() utils.scene.update() utils.scene.render() utils.delta = utils.clock.tick( utils.FRAMES_PER_SECOND ) if __name__ == "__main__": if not utils.init( caption="Heistboys", fullscreen=True ): print('buffalo.utils failed to initialize') pygame.quit() exit() utils.set_scene( menu.Menu() ) main() pygame.quit()
def go_to_stats_and_acheivements(): utils.set_scene( stats_and_acheivements.Stats_And_Acheivements(self.profile) )
def go_to_select_character(self): utils.set_scene(SelectCharacter())
def go_to_profile_selection(): utils.set_scene(profile_selection.Profile_Selection(self.profile))
def go_to_menu(self): from menu import Menu utils.set_scene( Menu() )
import pygame from buffalo import utils from menu import Menu def main(): while not utils.end: utils.scene.logic() utils.scene.update() utils.scene.render() utils.delta = utils.clock.tick( utils.FRAMES_PER_SECOND ) if __name__ == "__main__": if not utils.init( caption='Adept', ): print('buffalo.utils failed to initialize') pygame.quit() exit() utils.set_scene( Menu() ) main() pygame.quit()
def go_to_in_game(): del self.bgblasteroids utils.set_scene(InGame())
# This class is only used when __name__ == "__main__" # It displays a default map def __init__(self): Scene.__init__(self) self.m = Map() def on_escape(self): sys.exit() def blit(self): self.m.blit(utils.screen) def update(self): pass def main(): while not utils.end: utils.scene.logic() utils.scene.update() utils.scene.render() utils.delta = utils.clock.tick( utils.FRAMES_PER_SECOND ) if __name__ == "__main__": if not utils.init(caption="Simple Kingdom Simulator", fullscreen=True,): print("Buffalo failed to initialize") pygame.quit() sys.exit() utils.set_scene(_MainScene()) main() pygame.quit()