Last active
March 10, 2024 19:04
-
-
Save dorktoast/8a6c3f3a000a77e8d55138feaf97b217 to your computer and use it in GitHub Desktop.
Could this be the smalled possible game engine?
This file contains hidden or 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
| # MinimalEngine | |
| # Creates a block of pixels. If the game is running, refresh the pixels. | |
| # It's up to you, the game creator, to creae the logic that decides what pixels to draw. | |
| # Good luck. | |
| import pygame | |
| import sys | |
| # Initialize Pygame | |
| pygame.init() | |
| # Set up the display | |
| screen = pygame.display.set_mode((800, 600)) | |
| # Game loop | |
| while True: | |
| for event in pygame.event.get(): | |
| if event.type == pygame.QUIT: | |
| pygame.quit() | |
| sys.exit() | |
| # Game logic goes here | |
| # Refresh the screen | |
| pygame.display.flip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment