def __init__(self, master): # Prevent the app window from being resized master.resizable(False, False) self.banner = Banner(master) self.content = Content(master) # KEYBOARD SHORTCUTS SECTION master.bind('<Control-n>', lambda e: self.content.add_task()) # MENU BAR SECTION master.option_add('*tearOff', False) self.menubar = Menu(master) master.config(menu=self.menubar) # FILE MENU file = Menu(self.menubar) file.add_command(label='Test', command=lambda: messagebox.showinfo( title='Test', message='This is a test.')) file.add_command(label='Add Task', command=lambda: self.content.add_task()) file.entryconfig('Add Task', accelerator='CTRL+N') self.menubar.add_cascade(menu=file, label='File') # EDIT MENU edit = Menu(self.menubar) edit.add_command(label='Change Banner Color', command=lambda: self.banner.change_banner_color()) self.menubar.add_cascade(menu=edit, label='Edit')
def banner(request, player): response = HttpResponse(mimetype="image/png") try: p = Player.objects.filter(name__exact=player)[0] except: try: p = Player.objects.get(name=player) except: return render_to_response( '404.html', {'text': 'Player {0} Not Found'.format(player)}) try: c = p.clan.name if c.count('NoClan'): c = '' except: c = '' pstring = "{0} {1}".format(c, p.name) wkills = p.kill_set.filter(time__gte=get_timespan('weekly')[0]).count() dkills = p.kill_set.filter(time__gte=get_timespan('daily')[0]).count() b = Banner(name=pstring, kills=p.kills, wkills=wkills, dkills=dkills, deaths=p.deaths, gold=p.gold) b.write(response) return response
class PrintBanner(Print): def __init__(self, string): self.banner = Banner(string) def print_weak(self): self.banner.show_with_paren() def print_strong(self): self.banner.show_with_aster()
class PrinterBanner(Banner): def __init__(self, string): self.__banner = Banner(string) def print_weak(self): self.__banner.show_with_paren() def print_strong(self): self.__banner.show_with_aster()
def make_banner(self): """ Instatiate Banner object """ colors = self.flag.colors screen_size = self.screen_size self.banner = Banner(self.flag.name, screen_size) self.banner.scale_text(40) # we want the text to be 40 pixels tall self.banner.scale_logo(100) # and we want the logo to be 100 pixels tall self.banner.center_text()
def check_game_state(self) -> None: """Checks for cell capture and if the game is over.""" if self._captured_edge: cell1_captured, cell2_captured = False, False # Check to see if any cells were captured. If so, increment score # of current player for each cell captured. if self._captured_edge.cell1: cell1_captured = self._captured_edge.cell1.check_for_capture( self._current_player) if cell1_captured: self._game.increment_score(self._current_player) if self._captured_edge.cell2: cell2_captured = self._captured_edge.cell2.check_for_capture( self._current_player) if cell2_captured: self._game.increment_score(self._current_player) if cell1_captured or cell2_captured: self._scoreboard.update_score( self._current_player, self._game.get_score(self._current_player)) # Check to see if anyone won winners = self._game.check_for_winner() if winners: # If there are winners, display the banner and play again button self._banner = Banner( pg.Rect(0, 0, self._cfg.SCOREBOARD_WIDTH * 0.8, 100), LIGHT_GRAY) self._banner.draw(winners) self._game_over = True self._play_again_button = Button( (self._banner.centerx - 50, self._banner.bottom + 35), (100, 35), callback=self.new_game, text='Play Again?', visible=False) self._play_again_button.visible = True self._play_again_button.draw() else: # If no cells were captured, move to next player if not cell1_captured and not cell2_captured: self._scoreboard.set_inactive(self._current_player) self._current_player = self._game.next_player() self._scoreboard.set_active(self._current_player) self._captured_edge = None
def __init__(self, path, name, ext = '.hpp', inner = None, banner = None, guard_begin = None, guard_end = None, year = None, comment ='//', fill = None ) : Banner.__init__(self, year, banner,comment=comment) Guard.__init__(self,path,name,ext,guard_begin,guard_end) self.__inner = Headers.inner_text if (inner is None) else inner self.__comment = comment self.__fill = comment[0] if fill == None else fill
def main(): banner = Banner() parser = optparse.OptionParser( "Usage python email-gathering.py -u <target url> -f <file to save>") parser.add_option('-u', '--url', dest='target_url', type='string', help='Insert target url') parser.add_option('-f', '--file', dest='file_path', type='string', help='Insert destination file') (options, args) = parser.parse_args() target_url = options.target_url file_path = options.file_path if target_url == None: print parser.usage sys.exit(1) target_url = deque([target_url]) email_gathering = EmailHarvester(target_url) email_gathering.scrape_emails() email_gathering.print_emails() if file_path != None: email_gathering.save_to_file(file_path)
def __init__(self, path, name, ext = '.hpp', inner = None, banner = None, guard_begin = None, guard_end = None, year = None, comment ='//', fill = None ) : Nt2_base_infos.__init__(self) Banner.__init__(self, year, banner,comment=comment) Guard.__init__(self,path,name,ext=ext, guard_begin=guard_begin, guard_end=guard_end) self.__inner = Headers.inner_text if (inner is None) else inner self.__comment = comment self.__fill = comment[0] if fill == None else fill
def main(): print(Banner("GUESS THE NUMBER APP").content) calibrator = Calibrator(random.randint(0, 100)) prompt = Prompt() success = False while not success: calibration = calibrator.calibrate(prompt.input()) print(calibration.message) success = calibration.is_equal
def ready(self): self.lock_player_input() self.fighter[0].avatar.face(1) self.fighter[0].set_position((150, 190)) self.fighter[1].avatar.face(0) self.fighter[1].set_position((170, 190)) # make sure the default animation is played at start of fight [f.reset() for f in self.fighter] banner_x = 322 / 2 - (self.fight_image.get_rect().width / 2) fight_banner = Banner(self.fight_image, (banner_x, 100), 1000) fight_banner.avatar.callback = (self.release_input_lock, []) fight_banner.show() self.pre_run()
def read_config(file_path='config.csv'): """ >>> read_config('test_config.csv') #doctest: +ELLIPSIS [<banner.Banner object at 0x...>] """ with open(file_path, 'rb') as csv_file: lines = csv.reader(csv_file, delimiter=';') config = [Banner(line) for line in lines] return config
def banner(request,player): response = HttpResponse(mimetype="image/png") try: p = Player.objects.filter(name__exact=player)[0] except: try: p = Player.objects.get(name=player) except: return render_to_response('404.html',{'text':'Player {0} Not Found'.format(player)}) try: c = p.clan.name if c.count('NoClan'): c = '' except: c = '' pstring = "{0} {1}".format(c,p.name) wkills = p.kill_set.filter(time__gte=get_timespan('weekly')[0]).count() dkills = p.kill_set.filter(time__gte=get_timespan('daily')[0]).count() b = Banner(name=pstring,kills=p.kills,wkills=wkills, dkills=dkills, deaths = p.deaths) b.write(response) return response
def __init__(self, parent=None): super().__init__(parent) self.mBanner = Banner(self) self.mIntroTitle = QLabel(self) self.mIntroTitle.setFont(QFont("SegeoUI", 15, QFont.Light)) self.mIntroTitle.setWordWrap(True) self.mIntroTitle.setObjectName("IntroTitle") self.mIntroTitle.setText( "Put the right products on every shelf at every outlet to satisfy ever-evolving customer demands" ) self.mIntroDesc = QTextBrowser(self) self.mIntroDesc.verticalScrollBar().setStyleSheet( VSCROLL_STYLE.NARROW.value) self.mIntroDesc.setFrameShape(QFrame.NoFrame) self.mIntroDesc.setOpenExternalLinks(True) self.mLearnMore = LinkList(self, "Learn more") self.mLearnMore.setSpacing(20) self.mLearnMore.addLinkByText("Solution Overview", "https://deepcognition.ai/") self.mLearnMore.addLinkByText("Sample Data Specifications", "https://deepcognition.ai/") self.mLearnMore.addLinkByText("Arca Continental Case Study", "https://deepcognition.ai/") self.mLayout = QVBoxLayout(self) self.mLayout.setContentsMargins(0, 0, 0, 0) self.mLayout.addWidget(self.mBanner) self.mLayout.addWidget(self.mIntroTitle) self.mLayout.addWidget(self.mIntroDesc) self.mLayout.addWidget(self.mLearnMore, 0, Qt.AlignLeft | Qt.AlignTop) self.setObjectName("IntroFrame") self.setStyleSheet("#IntroFrame{background-color: white;}") self.setAutoFillBackground(True)
def run(self): """ Fungsi awal saat program dijalankan """ if (self._isDebug): print(s("Mode Debug Active")) if self._link is None: self.tanyaLink() cls() B = Banner() B.cetakbanner() cetakgaris("Pilih Resolusi Video") self._YT = YouTube(self._link) self._YT.check_availability self.infoVideo() print("") time.sleep(3) pilihan = self.resolusi() cek = Logs() if (not cek.cek()): print(s("%s" % prRed("Lokasi penyimpanan belum diset "))) cek.gantiPath() self._savePath = cek._path cls() B.cetakbanner() cetakgaris("Please Wait.. Downloading") try: if pilihan == 'video': super(DownloadYT, self).Downloaderffmpeg(self._Audio, self._Video, self._savePath) elif (pilihan == 'audio'): super(DownloadYT, self).DownloadMP3(self._Audio, self._savePath) else: raise ValueError("Error") except: print(s("Terjadi kesalahan!")) return sys.exit(prCyan("Terima kasih! ;) "))
def __init__(self, string): self.__banner = Banner(string)
# Cores R = '\033[1;31m' B = '\033[1;34m' C = '\033[1;37m' Y = '\033[1;33m' G = '\033[1;32m' RT = '\033[;0m' system('clear') print(f'{G}Checando por atualizacoes... {C}') run(["git", "pull"]) Banner() sleep(3) system('clear') print(f'''{G}*By PoisonBR {B} ██████╗██████╗ ███████╗{C}████████╗ ██████╗ ██████╗ ██╗ ███████╗ {B}██╔════╝██╔══██╗██╔════╝{C}╚══██╔══╝██╔═══██╗██╔═══██╗██║ ██╔════╝ {B}██║ ██████╔╝█████╗ {C} ██║ ██║ ██║██║ ██║██║ ███████╗ {B}██║ ██╔═══╝ ██╔══╝ {C} ██║ ██║ ██║██║ ██║██║ ╚════██║ {B}╚██████╗██║ ██║ {C} ██║ ╚██████╔╝╚██████╔╝███████╗███████║ {B} ╚═════╝╚═╝ ╚═╝ {C} ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝ {G}v1.1 Consulta de CPF gratis! {B}THX @Sr_M0h4mm3d_4li''')
def run(self): banner = Banner() while 1: self.main_menu.draw() self.main_menu.do_action()
from contextlib import contextmanager from banner import Banner EVENT_API_FIELD_TYPE = "type" EVENT_API_FIELD_CHALLENGE = "challenge" EVENT_API_REQ_TYPE_URL_VERIFICATION = "url_verification" EVENT_API_REQ_TYPE_EVENT = "event_callback" SLACK_APP_API_KEY = "xoxb-241837748225-MZ9SgESli64vpVtUbbkWTMJR" message_processor = MessageProcessor() app = Flask(__name__) banner = Banner() class UnsupportedRequestException(BaseException): pass def handle_errors(func): """Decorator for functions that take single request argument and return dict response.""" def error_handling_wrapper(req): try: response = func(req) print("Responding:", response) except UnsupportedRequestException: print("UnsupportedRequestException:", req) response = make_response("Unsupported request %s" % req, 400) except Exception as exc:
import mysql.connector from banner import Banner mydb = mysql.connector.connect(host="localhost", user="******", passwd="root", database="hksite") cur = mydb.cursor() cur.execute("select * from banner") users = cur.fetchall() banners = [] for user in users: banner = Banner(user[0], user[1], user[2], user[3], user[4]) banners.append(banner) print banner
client = paramiko.SSHClient() # 获取SSHClient实例 client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(hostname="122.51.155.8", username="******", password="******", port=22) # 连接SSH服务端 transport = client.get_transport() # 获取Transport实例 # 创建sftp对象,SFTPClient是定义怎么传输文件、怎么交互文件 sftp = paramiko.SFTPClient.from_transport(transport) file_name = file_name[:-1] for root, dirs, files in os.walk(file_name): path = '/home/ubuntu' + root.replace(file_name, '') + '/' if path == '/home/ubuntu//': path = '/home/ubuntu/' print('当前目录路径', path) # 当前目录路径 print('当前路径下所有非目录子文件', files) # 当前路径下所有非目录子文件 for i in files: print(path + i) print(root + '/' + i) sftp.put(root + '/' + i, path + i) sftp.close() # 关闭连接 client.close() if __name__ == '__main__': Banner().get_limitation() MovieList().start_crawl() MovieDetail().start_crawl()
class IntroFrame(QFrame): """ Customized widget derived from QFrame which contains placeholder for banner, app intro and app description as well as learn more app description widget is capable of both loading plain text and html file """ def __init__(self, parent=None): super().__init__(parent) self.mBanner = Banner(self) self.mIntroTitle = QLabel(self) self.mIntroTitle.setFont(QFont("SegeoUI", 15, QFont.Light)) self.mIntroTitle.setWordWrap(True) self.mIntroTitle.setObjectName("IntroTitle") self.mIntroTitle.setText( "Put the right products on every shelf at every outlet to satisfy ever-evolving customer demands" ) self.mIntroDesc = QTextBrowser(self) self.mIntroDesc.verticalScrollBar().setStyleSheet( VSCROLL_STYLE.NARROW.value) self.mIntroDesc.setFrameShape(QFrame.NoFrame) self.mIntroDesc.setOpenExternalLinks(True) self.mLearnMore = LinkList(self, "Learn more") self.mLearnMore.setSpacing(20) self.mLearnMore.addLinkByText("Solution Overview", "https://deepcognition.ai/") self.mLearnMore.addLinkByText("Sample Data Specifications", "https://deepcognition.ai/") self.mLearnMore.addLinkByText("Arca Continental Case Study", "https://deepcognition.ai/") self.mLayout = QVBoxLayout(self) self.mLayout.setContentsMargins(0, 0, 0, 0) self.mLayout.addWidget(self.mBanner) self.mLayout.addWidget(self.mIntroTitle) self.mLayout.addWidget(self.mIntroDesc) self.mLayout.addWidget(self.mLearnMore, 0, Qt.AlignLeft | Qt.AlignTop) self.setObjectName("IntroFrame") self.setStyleSheet("#IntroFrame{background-color: white;}") self.setAutoFillBackground(True) def setBannerIcon(self, icon): self.mBanner.setBannerIcon(icon) # var color should be a string value ends with semicolon(;), ex: rgba(0, 125, 225, 255); or white; def setBackgroundColor(self, color): self.mBanner.setBackgroundColor(color) def setBannerText(self, text): self.mBanner.setBannerText(text) def setBannerTextFont(self, font): self.mBanner.setBannerTextFont(font) # var color should be a string value ends with semicolon(;), ex: rgba(0, 125, 225, 255); or white; def setBannerTextColor(self, color): self.mBanner.setBannerTextColor def setBannerLinkText(self, text): self.mBanner.setBannerLinkText(text) def setBannerLinkFont(self, font): self.mBanner.setBannerLinkFont(font) # var color should be a string value ends with semicolon(;), ex: rgba(0, 125, 225, 255); or white; def setBannerLinkColor(self, color): self.mBanner.setBannerLinkColor(color) def setIntroTitleText(self, text): self.mIntroTitle.setText(text) def setIntroTitleFont(self, font): self.mIntroTitle.setFont(font) def setIntroTitleColor(self, color): self.mIntroTitle.setStyleSheet("#IntroTitle{color: " + color + "}") # set plain text as description def setIntroDescText(self, text): self.mIntroDesc.setText(text) # set html string rather than plain text def setIntroDescHtml(self, html): self.mIntroDesc.setHtml(html) # load html from a file instead of plain text def setIntroDescHtmlFile(self, filePath): file = QFile(filePath) if file.open(QIODevice.ReadOnly): stream = QTextStream(file) self.mIntroDesc.setHtml(stream.readAll()) file.close() else: fileInfo = QFileInfo(file) print("Failed to open: " + fileInfo.absolutePath() + "/" + fileInfo.fileName())
def __init__(self, string): self.banner = Banner(string)
class Dots: """Dots is the main object the encompasses the entire game. It is responsible for instantiating all graphics objects, the game object, the player objects, and managing game play.""" def __init__(self, screen, args): self._done = False self._clock = pg.time.Clock() self._screen = screen self._cfg = Config() self._game_over = False self._banner = None self._game = None self._scoreboard = None self._board = None self._current_player = None self._highlighted_edge = None self._cell_captured = False self._captured_edge = None self._play_again_button = None # Create the static components if 1 < len(args.p) < 5: self._players = [Player(p, get_color()) for p in args.p] else: raise Exception('Only two to four players are allowed') self.new_game() def new_game(self) -> None: """Creates a new game and resets all entities.""" if self._play_again_button: self._play_again_button.visible = False self._game = Game(self._players) self._scoreboard = Scoreboard(self._cfg.SCOREBOARD_ORIGIN, self._cfg.SCOREBOARD_SIZE, LIGHT_GRAY, self._game) self._board = Board(x_shift=0, y_shift=self._cfg.SCOREBOARD_HEIGHT + GAP_20) self._current_player: Player = self._game.current_player self._highlighted_edge: Edge = None self._cell_captured: bool = False self._captured_edge: Edge = None self._scoreboard.set_active(self._current_player) self._game_over = False def quit(self) -> None: """Set the done flag to True so the game can quit.""" self._done = True def run(self) -> None: """Run the main game play loop until commanded to quit.""" while not self._done: self._clock.tick(30) self.handle_events() self.check_game_state() self.draw() def handle_events(self) -> None: """Handle all game events.""" for event in pg.event.get(): if event.type == pg.QUIT: self._done = True if event.type == pg.MOUSEMOTION: if not self._game_over: edge = self._board.get_edge(event.pos) if edge: edge.handle_event(event) self._highlighted_edge = edge elif self._highlighted_edge: self._highlighted_edge.clear() elif event.type == pg.MOUSEBUTTONUP: if not self._game_over: edge = self._board.get_edge(event.pos) if edge and not edge.captured: edge.handle_event(event) if edge.captured: self._captured_edge = edge if self._play_again_button: self._play_again_button.handle_event(event) def check_game_state(self) -> None: """Checks for cell capture and if the game is over.""" if self._captured_edge: cell1_captured, cell2_captured = False, False # Check to see if any cells were captured. If so, increment score # of current player for each cell captured. if self._captured_edge.cell1: cell1_captured = self._captured_edge.cell1.check_for_capture( self._current_player) if cell1_captured: self._game.increment_score(self._current_player) if self._captured_edge.cell2: cell2_captured = self._captured_edge.cell2.check_for_capture( self._current_player) if cell2_captured: self._game.increment_score(self._current_player) if cell1_captured or cell2_captured: self._scoreboard.update_score( self._current_player, self._game.get_score(self._current_player)) # Check to see if anyone won winners = self._game.check_for_winner() if winners: # If there are winners, display the banner and play again button self._banner = Banner( pg.Rect(0, 0, self._cfg.SCOREBOARD_WIDTH * 0.8, 100), LIGHT_GRAY) self._banner.draw(winners) self._game_over = True self._play_again_button = Button( (self._banner.centerx - 50, self._banner.bottom + 35), (100, 35), callback=self.new_game, text='Play Again?', visible=False) self._play_again_button.visible = True self._play_again_button.draw() else: # If no cells were captured, move to next player if not cell1_captured and not cell2_captured: self._scoreboard.set_inactive(self._current_player) self._current_player = self._game.next_player() self._scoreboard.set_active(self._current_player) self._captured_edge = None def draw(self) -> None: """Draws the entire game to the screen.""" pg.display.flip()
import colors import os import threading import sys import time if __name__ == '__main__': try: # Do root or reboot! if os.geteuid() != 0: exit(colors.RED + "[!] Root privileges needed to run this script" + colors.DEFAULT) # Everyone loves banners b = Banner() b.show() net = Net() net.enable_forward() print(colors.WHITE + "[*] Available network interfaces:\n" + colors.DEFAULT) count = 0 for x in net.get_avail_interfaces(): print("\t" + str(count) + ") " + x) count += 1 ans = "" while not ans.strip().isdigit() or int(ans.strip()) > count: ans = input(colors.BLUE + "\nmitm" + colors.WHITE + ":" + colors.BLUE + "interface" + colors.WHITE + "> " +
def main(): print(Banner('hello app').content) print(Greeting(NamePrompt().input()).greet())
class Model(object): """ Class that holds the state of the entire game """ def __init__(self, cell_size = (40, 40), grid_size = (46, 20)): """Initialize the model. cell_size: Tuple of the dimension of each cell in pixels grid_size: Tuple of the dimensions of the grid in cells""" self.cell_size = cell_size self.grid_size = grid_size self.screen_size = (self.cell_size[0]*self.grid_size[0], self.cell_size[1]*self.grid_size[1]+160) self.endgame = False self.obstacles = [] self.cleared_obstacles = [] self.make_grid() self.choose_flag() self.make_colors() self.make_player() self.generate_level() self.make_darkness() self.make_banner() def make_grid(self): """Instantiate grid cells for game map. Creates a dictionary with keys that are cell coordinates with values that are cell objects""" self.grid_cells = {} cell_size = (self.cell_size) # cell size in pixels for i in range(self.grid_size[0]): # for the x cells for j in range(self.grid_size[1]): # for the y cells cell_coord = (i*self.cell_size[0], j*self.cell_size[1]+160) self.grid_cells[(i,j)] = Cell(cell_coord, (i, j)) def choose_flag(self): """Randomly choose which flag to play the game with.""" self.flag = Flag({ 1:"ace", 2:"alt-lesbian", 3:"bi", 4:"intersex", 5:"l-lesbian", 6:"nb", 7:"pan", 8:"poc", 9:"pride", 10:"trans", 11:"gqueer" }[random.randint(1, 10)]) def make_colors(self): """Instantiate Color objects for each color in the chosen flag and place in random cells """ self.color_objs = [] for color in self.flag.colors: x_cell = random.randint(0, self.grid_size[0]-1) y_cell = random.randint(0, self.grid_size[1]-1) cell_coord = self.grid_cells[(x_cell,y_cell)].cell_coord grid_coord = self.grid_cells[(x_cell,y_cell)].label self.color_objs.append(actors.Color(color, self.cell_size, cell_coord, grid_coord, self.grid_cells[grid_coord])) self.grid_cells[(x_cell,y_cell)].occupied = True self.grid_cells[(x_cell,y_cell)].type = 'color' def generate_level(self): """ Generates playable level """ #gets position of player for play path player_pos = self.player.get_draw_position() player_grid_pos = (math.floor((player_pos[0]-40)/self.cell_size[0]), math.floor((player_pos[1] - 160)/self.cell_size[1])) player_cell = self.grid_cells[(player_grid_pos)] #initializes order of goals for random playable path path_order_colors = self.color_objs random.shuffle(path_order_colors) path_order = [color.cell_in for color in path_order_colors] path_order.insert(0,player_cell) #generates path, places obstacles accordingly self.path = [] ind = 0 for i in list(range(len(path_order)-1)): #for i in range(2): zigzag_path = get_zigzag_path(self.grid_cells, path_order[ind], path_order[ind+1], 3) self.place_obstacles(zigzag_path, ind) if not ind == 0: for cell in zigzag_path: cell.type == 'none' self.path.extend(zigzag_path) ind += 1 def place_obstacles(self, path, ind): """ Generate obstacles in the grid path = list of Cell objects that comprise a path through the grid ind = number path that is currently being generated """ obstacle_types = self.flag.colors[:ind+1] for i in range(round(350/(len(self.flag.colors)))): # always place 350 obstacles x_cell = random.randint(0, self.grid_size[0]-1) y_cell = random.randint(0, self.grid_size[1]-1) while self.grid_cells[(x_cell, y_cell)].occupied: # re-randomize cells if chosen ones are occupied x_cell = random.randint(0, self.grid_size[0]-1) y_cell = random.randint(0, self.grid_size[1]-1) coord = self.grid_cells[(x_cell,y_cell)].cell_coord type = random.choice(obstacle_types) # randomly chooses this obstacle's type obstacle = actors.Obstacle((self.cell_size),coord,type) obstacle.make_groups(obstacle, self.obstacles) # add obstacle to group based on what the obstacle's type is self.grid_cells[(x_cell,y_cell)].occupied = True self.grid_cells[(x_cell,y_cell)].type = 'obstacle' def erase_obstacles(self, key = pygame.K_SPACE): """ Removes obstacles from self.model.obstacles while spacebar is held """ if pygame.key.get_pressed()[key] == 1: for color in self.player.collided_with: # iterates through list of colors that have been collided with for group in self.obstacles: # iterates through all groups of obstacles if group.type == color.color: # finds group that corresponds to color that was just touched self.obstacles.remove(group) self.cleared_obstacles.append(group) else: for group in self.cleared_obstacles: self.cleared_obstacles.remove(group) self.obstacles.append(group) def make_player(self): """ Instantiate Player object """ self.player = actors.Player((400, 400), self.screen_size, self.obstacles, self.color_objs) for i in range(14, 16): # range of x_coord cells where the player spawns for j in range(10,12): # range of y_coord cells where player spawns self.grid_cells[(i,j)].occupied = True # marks cells as occupied so that nothing else spawns there def make_darkness(self): """ Instantiate Darkness object """ self.darkness = actors.Darkness(self.player, (self.cell_size[0]*self.grid_size[0], self.cell_size[1]*self.grid_size[0])) def make_banner(self): """ Instatiate Banner object """ colors = self.flag.colors screen_size = self.screen_size self.banner = Banner(self.flag.name, screen_size) self.banner.scale_text(40) # we want the text to be 40 pixels tall self.banner.scale_logo(100) # and we want the logo to be 100 pixels tall self.banner.center_text() def make_endscreen(self): """ Instantiate Endscreen object """ self.endscreen = EndScreen(self.flag.name, (1920, 1080))
def __init__(self, string): #super().__init__(string) self.__banner = Banner(string)
def __init__(self, string): Banner.__init__(self, string)