lordmauve / lordmauve/pgzero

Feature proposal: world built-in

Open
#361 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
611
Forks
211
PR merge metrics
No merged PRs in 30d

Description

pgzero is currently very suited to making games that take up only a single screen.

I propose the addition of a _world_ built-in to allow easy management and realization of games with content outside of a single screens space.

As a first idea, I think _world_ could be an object of a class _World_ which has two main features. A set of position offsets for X and Y and a list of Actors. The X and Y offsets would allow the "camera position" to move by changing the absolute X and Y positions of everything in the world. The X and Y positions of each individual actor in the world would instead refer to their position in the world. This is realized by having the world be drawn with _world.draw()_. This function would go through each actors, change their position by the world offset, call _.draw()_ on them and then change their position back.

This would obviously be quite unperformant so a change to the _.draw()_ function with an optional parameter or a modified new function to draw at a specific position could allow more optimized drawing for lots of actors in the world.

I'm happy to get any feedback or ideas on this. I think something along these lines could really expand what's easily possible with pgzero. A natural expansion might see the world being rotatable.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing Actor drawing behavior and the proposed World/world.draw() interface described in the issue. Define how X and Y camera offsets, world-positioned Actors, and drawing at specific positions should work; the feature is done when games can manage and render content beyond a single screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.