Skip to content

Instantly share code, notes, and snippets.

View linhns's full-sized avatar

Nguyen Son Linh linhns

View GitHub Profile
@linhns
linhns / game.py
Created April 8, 2025 08:48
How to make an async game loop in Pygame
import asyncio
import pygame
class Game:
def __init__(self):
pygame.init()
self.window = pygame.display.set_mode((640, 480))
self.clock = pygame.time.Clock()
self.running = True