Skip to content

Instantly share code, notes, and snippets.

View MrArnaudMichel's full-sized avatar
🇫🇷
Focusing

Arnaud Michel MrArnaudMichel

🇫🇷
Focusing
View GitHub Profile
@MrArnaudMichel
MrArnaudMichel / add_speaker_in_pygame_dialogue.md
Created July 31, 2024 12:51
Ajouter une animation aux orateurs avec pygame

Ajouter une animation aux orateurs avec pygame

Pour ajouter une animation aux orateurs, il faudra modifier le code source de dialogue.py.

Modifier les paramètres de DialogueScreen

  1. Pour ajouter une animation aux orateurs, il faudra modifier le __init__ de DialogueScreen pour ajouter un paramètre speakers: list[str] = [] qui contiendra les noms des orateurs qui ont déjà parlé.

Voilà à quoi ressemblera le __init__ de DialogueScreen après modification :

@MrArnaudMichel
MrArnaudMichel / add_logo_to_pygame_game.md
Created July 30, 2024 12:12
Ajouter un logo à un jeu fait avec Pygame

Ajouter un Logo à un Jeu fait avec Pygame

Pour ajouter un logo à votre jeu pygame vous devez d'abord connaitre le chemin entre votre script (ou le working directory) et le fichier contenant votre logo.

Puis après avoir crée votre fenêtre (pygame.display.set_mode(width, height))) vous pouvez ajouter un logo grace à:

pygame.display.set_icon(pygame.image.load("chemin vers votre image"))

De la même manière vous pouvez ajouter un titre à la fênetre:

@MrArnaudMichel
MrArnaudMichel / CHANGE_MAP_ANIMATION.md
Last active July 19, 2024 12:48
Add change map animations

Animation on change map

map.py

Imports :

add:

  • from sql import SQL
  • from tool import Tool
from termcolor import colored
def error(message: str, show_emoji: bool = True) -> None:
"""
Prints an error message.
Args:
message (str): The error message
show_emoji (bool): Whether to show the emoji

Description

[Detailed description of the changes introduced by this PR]

Issue

[Reference to the issue or task associated with this PR, if any]