コード例 #1
0
ファイル: weapon_renderer.py プロジェクト: PyGG2/PyGG2
 def __init__(self):
     self.depth = 1
     self.weaponsprite = sfml.graphics.Sprite(
         function.load_texture(constants.SPRITE_FOLDER + "weapons/miniguns/0.png")
     )
     self.firingsprite = sfml.graphics.Sprite(
         function.load_texture(constants.SPRITE_FOLDER + "weapons/miniguns/2.png")
     )
コード例 #2
0
ファイル: weapon_renderer.py プロジェクト: Orpheon/PyGG2-1
 def __init__(self):
     self.depth = 1
     self.weaponsprite = sfml.Sprite(
         function.load_texture(constants.SPRITE_FOLDER +
                               "weapons/miniguns/0.png"))
     self.firingsprite = sfml.Sprite(
         function.load_texture(constants.SPRITE_FOLDER +
                               "weapons/miniguns/2.png"))
コード例 #3
0
    def __init__(self, window, manager):
        super(MainMenuHandler, self).__init__(window, manager)

        self.menubg = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "gameelements/menubackgrounds/%s.png" % random.randint(0,2)))
        self.menubg.x = 200
        self.color = tuple(self.manager.config.setdefault('menu_color', [0.7, 0.25, 0]))
        self.color = sfml.Color(self.color[0] * 255, self.color[1] * 255, self.color[2] * 255)
コード例 #4
0
    def __init__(self, window, manager):
        super(LobbyHandler, self).__init__(window, manager)

        self.menuitems = [
            ('Back to Main Menu', LobbyHandler.go_back),
            ('', None)
        ]

        self.menubg = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "gameelements/menubackgrounds/0.png"))
        self.menubg.x = 200
        self.menubg.x = 200
        self.color = tuple(self.manager.config.setdefault('menu_color', [0.7, 0.25, 0]))
        self.color = sfml.Color(self.color[0] * 255, self.color[1] * 255, self.color[2] * 255)

        self.sendbuf = b''

        self.lobbysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

        self.num_servers = -1
        self.servers_read = 0

        self.lobbysocket.connect((constants.LOBBY_HOST, constants.LOBBY_PORT))
        lobbyuuid = uuid.UUID(constants.LOBBY_MESSAGE_TYPE_LIST).get_bytes()
        self.protocoluuid = uuid.UUID(constants.GG2_LOBBY_UUID).get_bytes()
        self.send_all(lobbyuuid+self.protocoluuid)
        self.compatuuid = uuid.UUID(constants.PYGG2_COMPATIBILITY_PROTOCOL).get_bytes()
コード例 #5
0
 def __init__(self):
     self.depth = -1
     self.sprites = [
         sfml.Sprite(
             function.load_texture(
                 constants.SPRITE_FOLDER +
                 "ingameelements/sentryred/{0}.png".format(i)))
         for i in range(10)
     ]
コード例 #6
0
 def __init__(self):
     self.depth = 1
     self.currentindex = -1
     self.flamesprite = [
         sfml.Sprite(
             function.load_texture(constants.SPRITE_FOLDER +
                                   "projectiles/flames/{}.png".format(i)))
         for i in range(3)
     ]
コード例 #7
0
 def __init__(self):
     self.depth = -1
     self.base = sfml.Sprite(
         function.load_texture(constants.SPRITE_FOLDER +
                               "ingameelements/sentryred/11.png"))
     self.turrets = [
         sfml.Sprite(
             function.load_texture(
                 constants.SPRITE_FOLDER +
                 "ingameelements/sentryturrets/{0}.png".format(i)))
         for i in range(3)
     ]
     self.turning = [
         sfml.Sprite(
             function.load_texture(
                 constants.SPRITE_FOLDER +
                 "ingameelements/turretrotates/{0}.png".format(i)))
         for i in range(5)
     ]
コード例 #8
0
ファイル: hud_renderer.py プロジェクト: Orpheon/PyGG2-1
 def initialize(self, renderer, game, state, character_id, spritepath):
     character = state.entities[character_id]
     if character.team == constants.TEAM_RED:
         team = "0"
     else:
         team = "1"
     self.hudsprite = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "huds/ammo/"+spritepath+"/"+team+".png"))
     self.background_bar.location = self.bar.location
     self.background_bar.color = sfml.Color(0, 0, 0, 255)
     self.bar.color = sfml.Color(217, 217, 183, 255)
コード例 #9
0
ファイル: map_renderer.py プロジェクト: 0xluis/PyGG2
 def set_map(self, mapname):
     # Get all the layers of the background
     self.bgs = []
     layer_list = os.listdir("maps/"+mapname+"/background")
     layer_list.sort()
     for layer in layer_list:
         self.bgs.append(sfml.Sprite(function.load_texture("maps/"+mapname+"/background/"+layer)))
     
     # Scale all maps 6x
     for background in self.bgs:
         background.ratio = sfml.system.Vector2(6, 6)
コード例 #10
0
    def __init__(self):
        self.depth = 0
        self.sprites = [
            sfml.Sprite(
                function.load_texture((constants.SPRITE_FOLDER +
                                       "characters/heavyreds/%s.png" % i)))
            for i in range(4)
        ]

        self.spriteoffset = (14, 30)
        self.spriteoffset_flipped = (26, 30)
コード例 #11
0
 def initialize(self, renderer, game, state, character_id, spritepath):
     character = state.entities[character_id]
     if character.team == constants.TEAM_RED:
         team = "0"
     else:
         team = "1"
     self.hudsprite = sfml.Sprite(
         function.load_texture(constants.SPRITE_FOLDER + "huds/ammo/" +
                               spritepath + "/" + team + ".png"))
     self.background_bar.location = self.bar.location
     self.background_bar.color = sfml.Color(0, 0, 0, 255)
     self.bar.color = sfml.Color(217, 217, 183, 255)
コード例 #12
0
ファイル: map_renderer.py プロジェクト: Orpheon/PyGG2-1
    def set_map(self, mapname):
        # Get all the layers of the background
        self.bgs = []
        layer_list = os.listdir("maps/" + mapname + "/background")
        layer_list.sort()
        for layer in layer_list:
            self.bgs.append(
                sfml.Sprite(
                    function.load_texture("maps/" + mapname + "/background/" +
                                          layer)))

        # Scale all maps 6x
        for background in self.bgs:
            background.ratio = sfml.system.Vector2(6, 6)
コード例 #13
0
ファイル: hud_renderer.py プロジェクト: Orpheon/PyGG2-1
    def __init__(self, renderer, game, state, character_id):
        self.sprite_location = (10, renderer.view_height - 75)
        character = state.entities[character_id]
        my_class_type = type(character)
        my_class_number = str(function.convert_class(my_class_type))
       
        self.hudsprite = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "huds/characterhud/"+ my_class_number + ".png"))

        self.health_box_background = None
        self.health_box = None

        self.health_text = HealthText()
        self.health_text.health_location = (56, renderer.view_height - 52)
        self.health_text.health_size = (36, 36)
コード例 #14
0
    def __init__(self, renderer, game, state, character_id):
        self.sprite_location = (10, renderer.view_height - 75)
        character = state.entities[character_id]
        my_class_type = type(character)
        my_class_number = str(function.convert_class(my_class_type))

        self.hudsprite = sfml.Sprite(
            function.load_texture(constants.SPRITE_FOLDER +
                                  "huds/characterhud/" + my_class_number +
                                  ".png"))

        self.health_box_background = None
        self.health_box = None

        self.health_text = HealthText()
        self.health_text.health_location = (56, renderer.view_height - 52)
        self.health_text.health_size = (36, 36)
コード例 #15
0
ファイル: map_renderer.py プロジェクト: TazeTSchnitzel/PyGG2
 def set_map(self, mapname):
     self.bgs = [sfml.Sprite(function.load_texture(("maps/"+ mapname[i] + ".png"))) for i in range(8)]
     for background in self.bgs:
         background.ratio = sfml.system.Vector2(6, 6)
コード例 #16
0
 def __init__(self):
     self.depth = 1
     self.needlesprite = sfml.Sprite(
         function.load_texture(constants.SPRITE_FOLDER +
                               "projectiles/needles/0.png"))
コード例 #17
0
ファイル: weapon_renderer.py プロジェクト: Orpheon/PyGG2-1
 def __init__(self):
     self.depth = 1
     self.weaponsprite = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "weapons/rocketlaunchers/0.png"))
     self.firingsprite = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "weapons/rocketlaunchers/2.png"))
コード例 #18
0
ファイル: character_renderer.py プロジェクト: Orpheon/PyGG2-1
    def __init__(self):
        self.depth = 0
        self.sprites = [sfml.Sprite(function.load_texture((constants.SPRITE_FOLDER + "characters/spyreds/%s.png" % i))) for i in range(4)]

        self.spriteoffset = (22, 30)
        self.spriteoffset_flipped = (33, 30)
コード例 #19
0
ファイル: character_renderer.py プロジェクト: nagn/PyGG2
    def __init__(self):
        self.depth = 0
        self.sprites = [sfml.Sprite(function.load_texture(("characters/scoutreds/%i.png" % i))) for i in range(4)]

        self.spriteoffset = (24, 30)
        self.spriteoffset_flipped = (35, 30)
コード例 #20
0
ファイル: character_renderer.py プロジェクト: nagn/PyGG2
    def __init__(self):
        self.depth = 0
        self.sprites = [sfml.Sprite(function.load_texture(("characters/engineerreds/%s.png" % i))) for i in range(4)]

        self.spriteoffset = (26, 30)
        self.spriteoffset_flipped = (36, 30)
コード例 #21
0
 def set_map(self, mapname):
     self.sprite = sfml.Sprite(function.load_texture("maps/" + mapname + ".png"))
     self.sprite.scale(6, 6)
コード例 #22
0
ファイル: projectile_renderer.py プロジェクト: PyGG2/PyGG2
 def __init__(self):
     self.depth = 1
     self.minesprite = sfml.graphics.Sprite(function.load_texture(constants.SPRITE_FOLDER + "projectiles/mines/1.png"))
コード例 #23
0
ファイル: sentry_renderer.py プロジェクト: 0xluis/PyGG2
 def __init__(self):
     self.depth = -1
     self.base = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "ingameelements/sentryred/11.png"))
     self.turrets = [sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "ingameelements/sentryturrets/{0}.png".format(i))) for i in range(3)]
     self.turning = [sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "ingameelements/turretrotates/{0}.png".format(i))) for i in range(5)]
コード例 #24
0
ファイル: character_renderer.py プロジェクト: PyGG2/PyGG2
    def __init__(self):
        self.depth = 0
        self.sprites = [sfml.graphics.Sprite(function.load_texture((constants.SPRITE_FOLDER + "characters/quotereds/%s.png" % i))) for i in range(4)]

        self.spriteoffset = (16, -1)
        self.spriteoffset_flipped = (16, -1)
コード例 #25
0
 def __init__(self):
     self.depth = 1
     self.currentindex = -1
     self.flamesprite = [sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "projectiles/flames/{}.png".format(i))) for i in range(3)]
コード例 #26
0
 def __init__(self):
     self.depth = 1
     self.bladesprite = sfml.Sprite(function.load_texture("projectiles/bladeprojectiles/0.png"))
コード例 #27
0
 def __init__(self):
     self.depth = 1
     self.weaponsprite = sfml.Sprite(function.load_texture("weapons/shotguns/0.png"))
     self.firingsprite = sfml.Sprite(function.load_texture("weapons/shotguns/2.png"))
コード例 #28
0
 def __init__(self):
     self.depth = 1
     self.bladesprite = sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "projectiles/bladeprojectiles/0.png"))
コード例 #29
0
ファイル: sentry_renderer.py プロジェクト: 0xluis/PyGG2
 def __init__(self):
     self.depth = -1
     self.sprites = [sfml.Sprite(function.load_texture(constants.SPRITE_FOLDER + "ingameelements/sentryred/{0}.png".format(i))) for i in range(10)]