Skip to main content

A simple format with tools to help build games easily with pygame.

Project description

Pygstudio

A template to make games easier like what you see in game engines like Unity and Roblox.

How to use pygstudio

  • To create your own pygstudio project, type in your terminal: pygstudio create [NAME] or python -m pygstudio create [NAME] -o [DESTINATION]. This will make a new pygstudio template in your directory / destination.

What can you do with pygstudio?

  1. Easy configuration - Each file are provided with comments to help you guide in building your game. You can also edit the code if you don't like the code.
  2. Easy access - Your scripts can access various things like the globals, components and assets by putting these lines of code: import globals import components pygame.image.load("assets/mypicture.png") (an example of using assets). Example:
# scripts/npc.py
import pygame, random
import globals, components

for i in range(10):
    npc_character_image = pygame.image.load("assets/smol_npc.png")
    new_npc = components.characters.NPC(npc_character_image, (random.random() * 100, random.random() * 1000))   # NPC(image, position)
    globals.npcs.append(new_npc)
    new_npc.start_being_npc()
  1. Threaded scripts - Make a script easily by making a file/package inside the scripts directory.

Instead of this monstrosity:

import threading

def fire_function_every_3_seconds(): ...   # takes 15 lines of code
def handle_physics(): ...   # takes 300 lines of code 
def handle_network(): ...   # takes 258 lines of code

threading.Thread(daemon=True, target=fire_function_every_3_seconds).start()
threading.Thread(daemon=True, target=handle_physics).start()
threading.Thread(daemon=True, target=handle_network).start()

You can now put them in their separate files and they will be executed independently.

# scripts/loop.py
...     # the entire `fire_function_every_3_seconds` code
# scripts/physics.py
...     # the entire `handle_physics` code
# scripts/network.py
...     # the entire `handle_network` code

Template

The file structure of pygstudio follows (where NAME is your project name):

(Version 1.0)

[NAME]/
- [NAME].py
- globals.py
- engine.py
- script_manager.py
- assets/
- scripts/
- components/
    - __init__.py

About

Hello, I am only a developer making this project. If you wish to improve this project, you may fork this repository and add me in the credits of your repository. I will still continue improving this project but I cannot guarantee that I can repond to all your issues as I am only a student in a university.

This project is licensed.

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

pygstudio-1.0.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygstudio-1.0.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file pygstudio-1.0.3.tar.gz.

File metadata

  • Download URL: pygstudio-1.0.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pygstudio-1.0.3.tar.gz
Algorithm Hash digest
SHA256 095f23b906a64a8a9f16f67c572ecf04bba656a26ffe366fd7f1cd60f6470716
MD5 d809de2de8f9bac2613f6f31f09a6dd1
BLAKE2b-256 c5f2710b04c02f77161823f2f556908a0db537b58fad030f1b5cbac3f35e604b

See more details on using hashes here.

File details

Details for the file pygstudio-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pygstudio-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pygstudio-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d270fccb727a1c97d2d939a1741e13138a36f5c4923e6b6c1cc18390c0d625f1
MD5 bec8298ebbfe74ce6a87ee6fd19564c2
BLAKE2b-256 f470b430c9aa479f9cc540c439acee745943c37299f8c7f2f2bd3ca5e8a373cd

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