Skip to main content

EasyCells

EasyCells is a Python game development framework inspired by Unity. It allows you to create Items (equivalent to Unity's GameObjects), organize game logic into Levels (equivalent to Unity's Scenes), and add Components to define object behaviors and functionalities.

Project Structure

Your project should follow this structure:

your_game/
├── Levels/           # Game scenes
│   └── level1.py
├── Assets/           # Game resources
│   ├── Ui/
│   ├── Sounds/
│   └── image.png
└── main.py           # Entry point 

Initializing the Game

The Game class should be created in main.py:

from EasyCells import Game

if __name__ == '__main__':
    GAME = Game("level1")
    GAME.run()

Creating a Level

Levels are files inside the Levels/ folder. Each Level must contain two main functions:

  • init(game: Game): Initializes the objects in the Level.
  • loop(game: Game): Runs every frame.

Example of a basic Level:

from EasyCells import Game
from EasyCells.Components import Sprite, Camera

# Initialize Level objects
def init(game: Game):
    camera = game.CreateItem()
    camera.AddComponent(Camera())
  
    item = game.CreateItem()  # Every Item already has a Transform automatically
    item.AddComponent(Sprite("image.png"))

# Game loop
def loop(game: Game):
    pass

RPC (Remote Procedure Call) Example

EasyCells supports Remote Procedure Calls (RPC) to synchronize actions between the server and clients. Use the @Rpc decorator to mark functions that will be called remotely. See the example below with explanations for each SendTo option:

from EasyCells.NetworkComponents import Rpc, NetworkComponent, SendTo

class MyNetworkComponent(NetworkComponent):
    @Rpc(SendTo.ALL)
    def action_all(self):
        """Executed on all (ALL)."""
        print("RPC: Executed on all.")

    @Rpc(SendTo.SERVER)
    def action_server(self):
        """Executed only on the server."""
        print("RPC: Executed on the server.")

    @Rpc(SendTo.CLIENTS)
    def action_clients(self):
        """Executed on clients, except on the server."""
        print("RPC: Executed on clients.")

    @Rpc(SendTo.OWNER)
    def action_owner(self):
        """Executed only on the object owner client."""
        print("RPC: Executed on the owner client.")

    @Rpc(SendTo.NOT_ME)
    def action_not_me(self):
        """Executed on all except the sender."""
        print("RPC: Executed on all, except the sender.")

Conclusion

EasyCells allows for modular and organized game development. Use Levels to structure game stages, Items to represent game objects, and Components to add behaviors. If needed, synchronize actions over the network with RPC. Explore the framework to build your game in a simple and efficient way!

Metadata

Release files for EasyCells 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for EasyCells 0.1.6
File Size Uploaded
easycells-0.1.6.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for EasyCells 0.1.6
File Interpreter ABI Platform
EasyCells-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 57.3 kB

Release files / easycells-0.1.6.tar.gz

Download URL easycells-0.1.6.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a97b6419d3373ac68d37a811b1afe771fffbbea2f7978363c97c845af3fca6b5
BLAKE2b-256 checksum
How to use checksums
6594aa7edc4406505f94d4ee108c14b9be0cb917d0f9067e66291b6c8ba269a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / EasyCells-0.1.6-py3-none-any.whl

Download URL EasyCells-0.1.6-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39ca72d82820b0736b8c28947ee862c2e2048e3e7901d1bb515334df420f82bb
BLAKE2b-256 checksum
How to use checksums
95625baf3274f8a8322fec27337a1cb0d3e8bd491bdabd6cff0b15d6503e9b31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page