Example #1
0
    def __init__(self, centerx, lowy, *groups, game, Text, triggerposition):
        """
        Default Constructor

        Keyword Arguments:
        - centerx: The horizontal center of the text
        - lowy: The low side of the text, relative to position of the player.
        - *groups: A collection of sprite groups to add the item to.
        - game: The game istance.
        - Text: The text that has to be written on the help tip.

        Returns:
        - Nothing
        """
        """self.font = pygame.font.Font(pjoin("resources",
                                           "fonts",
                                           "TranscendsGames.otf"),
                                     24)"""
        self.surfimg = animatedText(Text)
        self.triggerposition = triggerposition
        self.img = self.surfimg.surface
        self.size = self.img.get_rect()
        self.x = centerx - (self.size.width/2)
        self.y = lowy - (self.size.height*game.gravity)
        MobilePlatform.__init__(self, self.x, self.y, *groups, game=game,
                                surface=self.img)
        game.helptxts.add(self)
        self.age = 300
Example #2
0
    def __init__(self, x, y, *groups, game):
        """
        Default Constructor

        Keyword Arguments:
        - x: The horizontal position of the top-left corner of the sprite
        - y: The vertical position of the top-left corner of the sprite
        - *groups: A collection of sprite groups to add the item to
        - game: The game istance

        Returns:
        - Nothing
        """
        self.img = pygame.image.load(
                    pjoin("resources",
                          "sprites",
                          "player.png")).convert_alpha()
        if game.config["Video"]["permanentbodies"]:
            self.update = self.dummyUpdate
        else:
            self.age = 300.
            self.update = self.realupdate
        MobilePlatform.__init__(self, x, y, *groups, game=game,
                                surface=self.img)