Published: 23 Jun 2024 › Updated: 23 Jun 2024
Making A PyGame
I was trying to make Pong but instead...
I learned how to make a PyGame window.
I'm always interested in help and in learning.
import pygame as lunar
import sys as starlight
# Initialize lunar
lunar.init()
# Constants
LUNAR_SURFACE_WIDTH = 800
LUNAR_SURFACE_HEIGHT = 600
MOON_COLOR = (0, 0, 0) # Dark Moon background
# Create the lunar surface
surface = lunar.display.set_mode((LUNAR_SURFACE_WIDTH, LUNAR_SURFACE_HEIGHT))
lunar.display.set_caption('Moon Pong')
# Main lunar loop
orbiting = True
while orbiting:
for event in lunar.event.get():
if event.type == lunar.QUIT:
orbiting = False
# Fill the background
surface.fill(MOON_COLOR)
# Update the lunar surface
lunar.display.flip()
# Quit lunar
lunar.quit()
starlight.exit()
Leave Making A PyGame to:
Read more #hive-188262 posts
Best Posts From Moon
We have not curated any of paulmoon410's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Moon
- # PeakeCoin Server & Bot Downtime Update
- PeakeBot - Windows Installer
- Peakario Guys - Javascript Game
- pek_pimp.py - Liquidity
- pek_pimp.py - PeakeCoin Strategy
- profit_strategies.py - Dynamic Profit
- uni_pek.py Trading Bot - Cancellation Addition
- PeakeSino Payout Script
- Just A Snow Day...
- PEKSino - Betting Logic