This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import pygame | |
def collide(rects : list[pygame.Rect] , rect : pygame.Rect) -> list[pygame.Rect]: | |
""" | |
Cette fonction sert à lister les rectangles qui touche la hitbox du joueur | |
""" | |
collided = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
text = "" | |
ponctuation = ['?', '...', '..', '.', ':', '"', "'", '!', ';', ',', '/', '&'] | |
with open(sys.argv[1], mode='r', newline='') as reader: | |
for line in reader.readlines(): | |
for c in line.strip(): | |
if c not in ponctuation: | |
text += c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
pygame.init() | |
window_size = pygame.Vector2(1920, 1080) * 2/3 | |
screen = pygame.display.set_mode(window_size) | |
surf = pygame.image.load("image_path").convert_alpha() | |
surf = pygame.transform.scale_by(surf, 2/3) |