예제 #1
0
    def display(self) -> None:
        """Procédure d'affichage de la cellule"""

        Display.drawCircle(pos=self.pos,
                           color=self.color,
                           radius=self.radius,
                           base_pos=Camera.pos)
예제 #2
0
    def display(self) -> None:
        """Permet d'afficher la créature"""

        if Creature.ALLOW_SKINS:
            Display.drawImg(img=self.img,
                            pos=self.pos,
                            radius=self.radius,
                            base_pos=Camera.pos)
        else:
            Display.drawCircle(pos=self.pos,
                               color=self.color,
                               radius=self.radius,
                               base_pos=Camera.pos)


        Display.drawText(text=self.name,
                         size=self.radius*0.75,
                         color=self.opposite_color,
                         pos=self.pos,
                         base_pos=Camera.pos)
예제 #3
0
    def display(self) -> None:
        """Affichage du buisson"""

        c = Color.linearGradient(Color.BUSH_COLOR_FULL,
                                 Color.BUSH_COLOR_DEAD,
                                 1-(self.health-1)/(Bush.BASE_HEALTH-1))

        for i in range(self.health):
            # Les pics du buisson
            angle = i/self.health*2*math.pi + self.angle

            offset = Vect2d(math.cos(angle), math.sin(angle))*Bush.RADIUS*(1+Bush.SHARPNESS/3)

            Display.drawTriangle(pos=self.pos + offset,
                                 color=c,
                                 radius=Bush.RADIUS*Bush.SHARPNESS,
                                 angle=2*math.pi/self.health*i + self.angle,
                                 base_pos=Camera.pos)

        # Le cercle du buisson
        Display.drawCircle(pos=self.pos,
                           color=c,
                           radius=Bush.RADIUS,
                           base_pos=Camera.pos)