def __init__(self, surface): self.game_name = "Dodge the Fangirls" self.author = "Charone Monteiro Tavares" self.gamedisplay = surface self.conf = config_handler.ConfigHandler() self.misc = misc_helper.MiscHelper() self.game_width = int(self.conf.get_value("game", "width")) self.game_height = int(self.conf.get_value("game", "height")) self.bg, self.bg_rect = self.misc.load_background( os.path.join("games", "dodge_fangirls", "data", "achtergrondfoto.png")) self.Player = player.Player(self.game_width * 0.45, self.game_height * 0.9, 43, 55, os.path.join("games", "dodge_fangirls", "data", "cbCHARACTER.png")) self.enemy4 = enemy.Enemys(random.randrange(0, self.game_width), -500, 196, 57, os.path.join("games", "dodge_fangirls", "data", "OBSTACLE4.png"), 4) self.enemy3 = enemy.Enemys(random.randrange(0, self.game_width), -300, 140, 57, os.path.join("games", "dodge_fangirls", "data", "OBSTACLE3.png"), 3) self.enemy2 = enemy.Enemys(random.randrange(0, self.game_width), -700, 92, 57, os.path.join("games", "dodge_fangirls", "data", "OBSTACLE2.png"), 2) self.enemy1 = enemy.Enemys(random.randrange(0, self.game_width), -100, 45, 57, os.path.join("games", "dodge_fangirls", "data", "RiCHARACTER.png"), 1) self.sprite_group = pygame.sprite.Group() self.sprite_group.add(self.Player, self.enemy1, self.enemy2, self.enemy3, self.enemy4) self.enemies = [self.enemy1, self.enemy2, self.enemy3, self.enemy4] self.score = self.Player.score
def __init__(self): self.conf = config_handler.ConfigHandler() self.misc = misc_helper.MiscHelper() self.configuration = self.conf.get_section("save") self.always_save_to_disk_mode = False self.save_location = self.configuration["save_location"] self.per_month_basis = bool(self.configuration["per_month_basis"])
def __init__(self): pygame.sprite.Sprite.__init__(self) self.misc = misc_helper.MiscHelper() self.conf = config_handler.ConfigHandler() self.game_width = int(self.conf.get_value("game", "width")) self.game_height = int(self.conf.get_value("game", "height")) self.image, self.rect = self.misc.load_image(os.path.join("games", "Galaxy_Trespassers", "data", "wall.png")) self.image.set_colorkey((0, 0, 0)) self.rect.centerx = self.game_width / 2 self.rect.bottom = self.game_height
def __init__(self, image, speed, score): pygame.sprite.Sprite.__init__(self) self.misc = misc_helper.MiscHelper() self.conf = config_handler.ConfigHandler() self.game_width = int(self.conf.get_value("game", "width")) self.game_height = int(self.conf.get_value("game", "height")) self.image, self.rect = self.misc.load_image(image) self.image.set_colorkey((0, 0, 0)) self.rect = self.image.get_rect() self.radius = int(self.rect.width / 3) self.rect.x = random.randrange(0, self.game_width - self.rect.width) self.rect.y = random.randrange(-600, -100) self.speedy = speed Enemy.score = score
def __init__(self, surface): self.main_menu_items = ["PLAY", "QUIT"] self.game_names = [ "DRON", "Galaxy Trespassers", "Race", "Dodge the Fangirls" ] self.rectangles = {} self.currently_drawn = "" self.font = pygame.font.init() self.font = pygame.font.SysFont("Verdana", 15) self.surface = surface self.conf = config_handler.ConfigHandler() self.misc = misc_helper.MiscHelper() self.bg, self.bg_rect = self.misc.load_background( os.path.join("menu", "background.jpg"))
def __init__(self): self.conf = config_handler.ConfigHandler() self.misc = misc_helper.MiscHelper() self.sftp_section = self.conf.get_section("SFTP") self.domain = self.sftp_section["domain"] self.port = int(self.sftp_section["port"]) self.username = self.sftp_section["username"] self.password = self.sftp_section["password"] self.remote_dir = self.sftp_section["remote_dir"] self.use_pub_key = bool( self.sftp_section["use_pub_key_authentication"]) self.http_path = self.sftp_section["http_path"] self.notification_content = self.sftp_section[ "notification_clipboard_content"] self.ssh_conn = paramiko.SSHClient()
def __init__(self, x, y, w, h, img): pygame.sprite.Sprite.__init__(self) self.X = x self.Y = y self.W = w self.H = h self.image = pygame.image.load(img) self.rect = self.image.get_rect() self.rect.x = self.X self.rect.y = self.Y self.conf = config_handler.ConfigHandler() self.game_width = int(self.conf.get_value("game", "width")) self.game_height = int(self.conf.get_value("game", "height")) self.changeX = 0 self.misc = misc_helper.MiscHelper() self.score = 0
def __init__(self, init_pos, init_rot, bike_colour, init_direction, surface): pygame.sprite.Sprite.__init__(self) self.config = config_handler.ConfigHandler() self.log = log_helper.LogHelper() self.misc = misc_helper.MiscHelper() self.image, self.rect = self.misc.load_image( os.path.join(os.getcwd(), "games/DRON/data/motorbike.png")) self.rotate(3, 0) self.colour = bike_colour self.surface = surface self.rect.x += init_pos[0] self.rect.y += init_pos[1] self.speed = 5 self.dead = False self.direction = init_direction self.rotation_done_for = init_direction self.drawn_line = []
def __init__(self, x, y): pygame.sprite.Sprite.__init__(self) self.misc = misc_helper.MiscHelper() self.conf = config_handler.ConfigHandler() self.game_width = int(self.conf.get_value("game", "width")) self.game_height = int(self.conf.get_value("game", "height")) self.bullet, self.rect_bullet = self.misc.load_image( os.path.join("games", "Galaxy_Trespassers", "data", "bullet.png")) self.explosion, self.rect_explosion = self.misc.load_image( os.path.join("games", "Galaxy_Trespassers", "data", "explosion.png")) self.image = self.bullet self.rect = self.rect_bullet self.image.set_colorkey((0, 0, 0)) self.rect.centerx = x self.rect.bottom = y self.speedy = -12 self.spawn_time = pygame.time.get_ticks() self.hit = False
def __init__(self, init_position, init_direction, bike_colour, surface): pygame.sprite.Sprite.__init__(self) self.misc = misc_helper.MiscHelper() self.surface = surface self.image, self.rect = self.misc.load_image( os.path.join(os.getcwd(), "games/DRON/data/motorbike.png")) self.rect.x = init_position[0] self.rect.y = init_position[1] self.rotation_done_for = init_direction self.direction = init_direction self.speed = 4 self.colour = bike_colour self.dead = False self.direction_changed = 0 self.line = [(self.rect.x, self.rect.y, 10, 10)] # Because the original direction is 1 we need to append 15 so that the player doesnt die in 1sec kek self.hitbox = (self.rect.x + 15, self.rect.y, 2, 2) self.rotate(0, init_direction)
def __init__(self): pygame.sprite.Sprite.__init__(self) self.misc = misc_helper.MiscHelper() self.conf = config_handler.ConfigHandler() self.game_width = int(self.conf.get_value("game", "width")) self.game_height = int(self.conf.get_value("game", "height")) self.image_stationary, self.rect_stationary = self.misc.load_image( os.path.join("games", "Galaxy_Trespassers", "data", "player_flying.png")) self.image_flying, self.rect_flying = self.misc.load_image( os.path.join("games", "Galaxy_Trespassers", "data", "player_flying.png")) self.image = self.image_stationary self.rect = self.rect_stationary self.rect.centerx = self.game_width / 2 self.rect.bottom = self.game_height - 20 self.speedx = 0 self.added_speed = 8.5 self.dead = False self.killed = 0
def __init__(self, surface): self.game_name = "DRON" self.game_author = "Mitchel van Hamburg" self.conf = config_handler.ConfigHandler() self.game_width = int(self.conf.get_value("game", "width")) self.game_height = int(self.conf.get_value("game", "height")) self.surface = surface self.misc = misc_helper.MiscHelper() self.log = log_helper.LogHelper() self.bg, self.bg_rect = self.misc.load_background( os.path.abspath("games/DRON/data/floor_small.png")) self.bike = MotorBike((20, self.game_height // 2), 1, (255, 0, 0), self.surface) self.opponent = MotorBike( (self.game_width - 50, self.game_height // 2), 3, (0, 255, 0), self.surface) self.sprite_group = pygame.sprite.Group() self.sprite_group.add(self.bike, self.opponent) self.score = len(self.bike.line)
def __init__(self): self.conf = config_handler.ConfigHandler() self.misc = misc_helper.MiscHelper()
import argparse import os from subprocess import run from plugins import plugin_handler from handlers import config_handler from helpers import misc_helper misc = misc_helper.MiscHelper() conf = config_handler.ConfigHandler() # To setup a initial configuration file in case there is none # TODO: Find out if there's a better way to handle this. if not misc.is_file(os.path.expanduser("~/.config/ShareL/config.ini")): conf = config_handler.ConfigHandler() parser = argparse.ArgumentParser(prog="ShareL", description="Upload files to a remote host") parser.add_argument( "--edit-conf", help="Edit the configuration of the program (uses the $EDITOR variable)", dest="ec") parser.add_argument("--sftp", help="Uploads a file to an SFTP host", dest="sftp", nargs=1) parser.add_argument("--imgur", help="Uploads a file to imgur", dest="imgur", nargs=1) parser.add_argument("--ipfs",