Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
Empty file added README.md
Empty file.
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
name = "5games"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"pygame-ce>=2.5.5",
]
24 changes: 24 additions & 0 deletions space shooter/code/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pygame

# general setup to initialize pygame and make sure everything run well
# always include this
pygame.init()
# create screen with dimensions provided in variables (uppercase cause constants)
WINDOW_WIDTH, WINDOW_HEIGHT = 1280, 720
display_surface = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))

running = True
# make code run until we want to close intentionally to open window
while running:
# event loop
for event in pygame.event.get(): # get events
# check for ui, keyboard, mouse inputs
if event.type == pygame.QUIT: # QUIT = closing the game (a constant)
running = False
# draw the elements of the game
display_surface.fill("purple")
# Take elements we run in while loop and draw them on the display surface
pygame.display.update()

# always write this after while loop- uninitializes everything
pygame.quit()
69 changes: 69 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.