Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    def __init__(self):
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
        self.ships = Group()

        self.spawners = [ TieSpawner(2000, self.ships, self.bounds) ]
Ejemplo n.º 3
0
    def __init__(self):
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
        self.ships = Group()

        self.spawners = [ShipSpawner(2000, self.ships, self.bounds)]
Ejemplo n.º 4
0
    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)]
Ejemplo n.º 5
0
    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)
Ejemplo n.º 6
0
    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) ]
Ejemplo n.º 7
0
    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()
Ejemplo n.º 8
0
    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) ]
Ejemplo n.º 9
0
    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)
Ejemplo n.º 10
0
    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)]
Ejemplo n.º 11
0
    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)
Ejemplo n.º 12
0
    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
Ejemplo n.º 13
0
    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
Ejemplo n.º 14
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)
Ejemplo n.º 15
0
 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()
Ejemplo n.º 16
0
    def __init__(self):
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
        self.ships = ShipGroup(self.max_ships)
        self.xplos = ExplosionGroup()
Ejemplo n.º 17
0
    def __init__(self):
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
Ejemplo n.º 18
0
 def __init__(self):
     Application.__init__(self)
     self.bounds = self.screen.get_rect()
     self.player = Player(380, 740, 6, 6, self.bounds)