Skip to main content

Easy to use game development library based on pygame

Project description

EZSGAME

ezsgame is a library that aims to make the process of creating and manipulating 2D graphics or game development simple, easy, fun, and comfortable as possible for the user.

Instalation

pip install ezsgame

Manual install

  • Download ezsgame.zip here

  • Clone the repository here

Sample

window = Window()

# current count value
current_value = [0]  # We use a list so the value can be modified from other scopes

container = Rect(
    Pos("center", "center"), Size("30%", "2/4"), styles=Styles(color="white", stroke=1)
)

counter_text = Text(
    f"Count is {current_value[0]}", 23, Pos(0, 0), parent=container
).center_at()  # This method centers the objects inside it's parent

# Let's make buttons to modify the count
increase_button = Rect(
    pos=Pos("right-center", "center"),
    size=Size(50, 50),
    styles=Styles(border_radius=[5], color="green"),
)


# Lets add an event listerner to the button
@add_event(event="click", object=increase_button)
def increase_count():
    # This method will only be called when `increase_button` is clicked
    current_value[0] += 1

    # We also need to update the text in the counter
    counter_text.update(text=f"Count is {current_value[0]}")


decrease_button = Rect(
    pos=Pos("left-center", "center"),
    size=Size(50, 50),
    styles=Styles(border_radius=[5], color="red"),
)


@add_event(event="click", object=decrease_button)
def decrease_count():
    # This method will only be called when `decrease_button` is clicked
    current_value[0] -= 1

    # We also need to update the text in the counter
    counter_text.update(text=f"Count is {current_value[0]}")


# Group everthing so you don't have to call draw method one-by-one
counter = Group(container, counter_text, decrease_button, increase_button)


while True:
    window.check_events()
    window.fill("black")

    # Draw the counter
    counter.draw()

    window.update()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezsgame-0.5.tar.gz (26.9 kB view details)

Uploaded Source

File details

Details for the file ezsgame-0.5.tar.gz.

File metadata

  • Download URL: ezsgame-0.5.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for ezsgame-0.5.tar.gz
Algorithm Hash digest
SHA256 1a948b2eeff477db47b3cb575724ba75fc1999e0f29bc1c411f653ad5af15267
MD5 58de3274964b54fb305d46795d0c7de3
BLAKE2b-256 193e2fa754d6c65f4b5cf3998dfff103ec58aa6425d93adffa87e7a22ddc43ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page