font = pygame.font.SysFont(None, 50) Places = [Imagination.PLACE(True)] Game = Imagination.Game(Places[0]) Main_menu = Imagination.Vertical_menu(Places[0], 150) keyboard = Main_menu.get_keyboard() keyboard.extend([(pygame.K_ESCAPE, "quit")]) Main_menu.add_option( Imagination.text_option(font, "Start", (255, 0, 0), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset()), True) Main_menu.add_option( Imagination.text_option(font, "Options", (0, 255, 0), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.add_option( Imagination.text_option(font, "Quit", (0, 0, 255), Main_menu, Imagination.Quit, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.set_options()
from Mind import Imagination import pygame screen = pygame.display.set_mode((800, 500)) pygame.init() font = pygame.font.SysFont(None, 50) Places = [Imagination.PLACE(True)] + [Imagination.PLACE()] Game = Imagination.Game(Places[0]) keyboard = Imagination.Keyboard(Imagination.ARROWS + Imagination.HIT + Imagination.RETURN + [(pygame.K_ESCAPE, "quit")], 1) definition = {"type": Imagination.text_option, "font": font, "pos_do": Imagination.joined([Imagination.ch_color((0, 0, 0)), Imagination.ch_pos((10, 0))]), "anti_pos_do": Imagination.reset()} Game.define(**definition) declaration = {"type": Imagination.Vertical_menu, "off": (-30, 0), "off_type": "%", "distance": 150, "keyboard": keyboard} Game.declare(**declaration) Main_menu = Game.set_from(places=Places[0]) Main_menu.set_from(True, text="Start", color=(255, 0, 0)) Main_menu.set_from(text="Options", color=(0, 255, 0), do=Imagination.link(Places[1])) Main_menu.set_from(text="Quit", color=(0, 0, 255), do=Imagination.Quit) Main_menu.set_options() Options = Game.set_from(places=Places[1], keyboard=keyboard) Options.set_from(True, type=Imagination.input_option, text="Sound", color=(255, 255, 0)) Options.set_from(text="Back", color=(255, 0, 255), do=Imagination.link(Places[0])) Options.set_options()
screen = pygame.display.set_mode((800, 500)) pygame.init() font = pygame.font.SysFont(None, 50) Places = [Imagination.PLACE(True)] + [Imagination.PLACE()] Game = Imagination.Game(Places[0]) Main_menu = Imagination.Vertical_menu(Places[0], 150) keyboard = Main_menu.get_keyboard() keyboard.extend([(pygame.K_ESCAPE, "quit")]) Main_menu.add_option(Imagination.text_option(font, "Start", (255, 0, 0), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset()), True) Main_menu.add_option(Imagination.text_option(font, "Options", (0, 255, 0), Main_menu, Imagination.link(Places[1]), pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.add_option(Imagination.text_option(font, "Quit", (0, 0, 255), Main_menu, Imagination.Quit, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.set_options() Main_menu.set_game(Game) Options = Imagination.Vertical_menu(Places[1], 150, keyboard=keyboard) Options.add_option(Imagination.text_option(font, "Sound", (255, 255, 0), Options, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset()), True) Options.add_option(Imagination.text_option(font, "Back", (255, 0, 255), Options, Imagination.link(Places[0]), pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Options.set_options() Options.set_game(Game) while Game.run(): if keyboard.keys["quit"]:
screen = pygame.display.set_mode((800, 500)) pygame.init() font = pygame.font.SysFont(None, 50) Places = [Imagination.PLACE(True)] Game = Imagination.Game(Places[0]) Main_menu = Imagination.Vertical_menu(Places[0], 150) keyboard = Main_menu.get_keyboard() keyboard.extend([(pygame.K_ESCAPE, "quit")]) Main_menu.add_option(Imagination.text_option(font, "Start", (255, 0, 0), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset()), True) Main_menu.add_option(Imagination.text_option(font, "Options", (0, 255, 0), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.add_option(Imagination.text_option(font, "Quit", (0, 0, 255), Main_menu, Imagination.Quit, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.set_options() Main_menu.set_game(Game) while Game.run(): if keyboard.keys["quit"]: Game.kill() screen.fill((255, 255, 255)) Game.blit() pygame.display.flip()
from Mind import Imagination import pygame screen = pygame.display.set_mode((800, 500)) running = True pygame.init() font = pygame.font.SysFont(None, 50) Main_menu = Imagination.Vertical_menu(Imagination.PLACE(True), 150) keyboard = Main_menu.get_keyboard() keyboard.extend([(pygame.K_ESCAPE, "quit")]) Main_menu.add_option(Imagination.text_option(font, "Start", (255, 0, 0), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset()), True) Main_menu.add_option(Imagination.text_option(font, "Options", (0, 255, 0), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.add_option(Imagination.text_option(font, "Quit", (0, 0, 255), Main_menu, pos_do=Imagination.ch_color((0, 0, 0)), anti_pos_do=Imagination.reset())) Main_menu.set_options() while running: if keyboard.keys["quit"]: running = False screen.fill((255, 255, 255)) Main_menu.blit() pygame.display.flip() pygame.quit()
Places = [Imagination.PLACE(True)] + [Imagination.PLACE()] Game = Imagination.Game(Places[0]) definition = { "type": Imagination.text_option, "font": font, "pos_do": Imagination.joined( [Imagination.ch_color((0, 0, 0)), Imagination.ch_pos((10, 0))]), "anti_pos_do": Imagination.reset() } Game.define(**definition) Main_menu = Imagination.Vertical_menu(Places[0], 150, off=(-30, 0), off_type="%") keyboard = Main_menu.get_keyboard() keyboard.extend([(pygame.K_ESCAPE, "quit")]) Main_menu.set_game(Game) Main_menu.set_from(True, text="Start", color=(255, 0, 0)) Main_menu.set_from(text="Options", color=(0, 255, 0),