def __init__(self): pygame.init() #self.screen_size = pygame.display.list_modes()[0] Application.__init__(self) #pygame.display.toggle_fullscreen() self.ships = ShipGroup(self.max_ships) self.xplos = ExplosionGroup() self.screen_bounds = bounds = self.screen.get_rect() dc_height = 40 self.dc_font = pygame.font.Font(None, 30) self.dc_bounds = Rect(0, bounds.height - dc_height, bounds.width, dc_height) self.game_bounds = Rect(0, 0, bounds.width, bounds.height - dc_height) spawn_area = self.game_bounds.inflate(-self.game_bounds.width/4, -self.game_bounds.height/4) self.spawners = [ TieSpawner(1000, self.ships, self.game_bounds, spawn_area), YWingSpawner(2000, self.ships, self.game_bounds) ] self.detonator = Detonator(self.game_bounds, self.xplos) for spawner in self.spawners: spawner.spawn() Ship.death_count = DeathCount() self.current_weapon = MiniExplosionsWeapon(self)
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.ships = Group() self.spawners = [ TieSpawner(2000, self.ships, self.bounds) ]
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.ships = Group() self.spawners = [ShipSpawner(2000, self.ships, self.bounds)]
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.ships = ShipGroup(self.max_ships) self.spawners = [TieSpawner(2000, self.ships, self.bounds)]
def __init__(self): pygame.init() #self.screen_size = pygame.display.list_modes()[0] Application.__init__(self) #pygame.display.toggle_fullscreen() self.ships = ShipGroup(self.max_ships) self.xplos = ExplosionGroup() self.screen_bounds = bounds = self.screen.get_rect() dc_height = 40 self.dc_font = pygame.font.Font(None, 30) self.dc_bounds = Rect(0, bounds.height - dc_height, bounds.width, dc_height) self.game_bounds = Rect(0, 0, bounds.width, bounds.height - dc_height) spawn_area = self.game_bounds.inflate(-self.game_bounds.width / 4, -self.game_bounds.height / 4) self.spawners = [ TieSpawner(1000, self.ships, self.game_bounds, spawn_area), YWingSpawner(2000, self.ships, self.game_bounds) ] self.detonator = Detonator(self.game_bounds, self.xplos) for spawner in self.spawners: spawner.spawn() Ship.death_count = DeathCount() self.current_weapon = MiniExplosionsWeapon(self)
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.ships = ShipGroup(self.max_ships) self.spawners = [ TieSpawner(2000, self.ships, self.bounds), YWingSpawner(2000, self.ships, self.bounds) ]
def __init__(self): #initialize Application Application.__init__(self) self.bounds = self.screen.get_rect() #won't produce more than max_ships self.ships = ShipGroup(self.max_ships) #Sprite Group, makes sprite fxn (collision) easier self. spawners = [ TieSpawner(1000, self.ships, self.bounds), YWingSpawner(2000, self.ships, self.bounds)] self.xplos = ExplosionGroup()
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.ships = ShipGroup(self.max_ships) self.xplos = ExplosionGroup() Explosion.group = self.xplos self.spawners = [ TieSpawner(1000, self.ships, self.bounds), YWingSpawner(2000, self.ships, self.bounds) ]
def __init__(self, options): pygame.init() pygame.display.set_mode(settings.SCREEN_SIZE) pygame.display.set_caption(settings.CAPTION) self.nick = options["nick"] self.addr = options["addr"] self.port = options["port"] self.factory = NetworkControllerFactory(self) Application.__init__(self, ConnectingState)
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.ships = ShipGroup(self.max_ships) self.bullets = ShipGroup(self.max_ships) self.xplos = ExplosionGroup() self.score = 0 self.player = Player(400, 560, 20, 20, self.bounds, (255, 255, 255)) Explosion.group = self.xplos self.spawners = [TieSpawner(1000, self.ships, self.bounds), YWingSpawner(2000, self.ships, self.bounds)]
def __init__(self, device): self.bus = dbus.SystemBus() self.msg_manager = MessageManager(self.stop) self.device = device wlan_mac_addr = self.msg_manager.net_manager.get_wlan_hw_address() self.device_name = '{} ({})'.format(device, wlan_mac_addr[-8:]) Application.__init__(self, self.bus, self.device_name) self.msg_manager.start(self.vsp_svc.tx) self.init_ble_service() self.net_stat = NetStat(self.ConnectionStatsChanged) self.lte_stat = LTEStat(self.ConnectionStatsChanged)
def __init__(self): Application.__init__(self) self.screenRect = self.screen.get_rect() self.minDt = 200 self.enemyGroup = Group() self.enemyGroup.add(BasicEnemy(100,100,0,1,self.screenRect,80)) self.bulletGroup = Group() self.player = Player(self.screenRect) self.playerGroup = GroupSingle(self.player) self.playerWeaponType = 1 self.playerFired = False self.playerMoveX = 0 self.playerMoveY = 0 self.playerMoveFlag = False
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.shipGroup = Group() self.playerBulletGroup = Group() self.bulletGroup = Group() self.enemySpawners = [ ShipSpawner(5000, self.shipGroup, self.bounds), ShipSpawner(10000, self.shipGroup, self.bounds, LeetEnemy) ] self.enemySpawners[1].setOrigin(40,40) self.player = Player() self.playerGroup = pygame.sprite.GroupSingle(self.player) self.playerFired = 0,0
def __init__(self): Application.__init__(self) pygame.key.set_repeat(100,100) self.gameover = False self.kills = 0 self.ships = Group() self.bullets = Group() self.player_bullets = BulletGroup(10) self.spawners = [ BadGuySpawner(100, self.ships, self.bounds, self.bullets), FastGuySpawner(250, self.ships, self.bounds, self.bullets), MadGuySpawner(300, self.ships, self.bounds, self.bullets)] self.player = Player(self.screen_size[0]/2, self.screen_size[1]-25, 0, 0, self.bounds, self.player_bullets) self.killed_text = UpdateText("Killed: ", self.kills, (self.screen_size[0]-100, self.screen_size[1]-25), 30) self.lives_text = UpdateText("Lives: ", self.player.lives, (10, self.screen_size[1]-25), 30)
def __init__(self, sound=1, server='', galaxy='', empire='', password='', shipBattle=None, glow=1): self.shutdownFlag = Event() props = WindowProperties() props.setTitle('%s (Game = %s)' % (windowtitle, galaxy)) base.win.requestProperties(props) Application.__init__(self, server=server, galaxy=galaxy, empire=empire, password=password, shipBattle=shipBattle, glow=glow) self.pandapath = Filename.fromOsSpecific(self.path).getFullpath() self.imagePath = self.pandapath + '/images/' self.soundPath = self.pandapath + '/sounds/' self.modelPath = self.pandapath + '/models/' self.sound = sound self.finalcard = None self.glowCamera = None self.glowOn = True if glow: self.setupGlowFilter() self.gameLoopInterval = Func(self.gameLoop) self.gameLoopInterval.loop() self.createSounds() self.playMusic()
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.ships = ShipGroup(self.max_ships) self.xplos = ExplosionGroup()
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect()
def __init__(self): Application.__init__(self) self.bounds = self.screen.get_rect() self.player = Player(380, 740, 6, 6, self.bounds)