Making a PyGame

in #coding10 days ago (edited)


image.png

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()
Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

Upvoted! Thank you for supporting witness @jswit.

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.030
BTC 60191.28
ETH 3302.01
USDT 1.00
SBD 2.36