Skip to content

Conversation

@MiCurry
Copy link
Contributor

@MiCurry MiCurry commented Oct 20, 2025

This is a simple example of how to create a split screen example using Camera2D and uses the PyMunk physics engine.

In the example, we create two cameras, and change their viewports to be half of the screen. When drawing the scene, we loop through each camera and draw our scene, then in update() we center the cameras on the players. We also use the default camera to draw a divider.

It also contains other useful examples, such as zooming out the camera, and resizing the split-screens when the window is resized.

@MiCurry MiCurry marked this pull request as draft October 20, 2025 18:35
@MiCurry MiCurry force-pushed the example/camera2d_splitscreen branch 2 times, most recently from abbce1b to b4aa726 Compare October 20, 2025 19:27
This is a simple example of how to create a split screen example using Camera2D
and uses the PyMunk physics engine.
@MiCurry MiCurry force-pushed the example/camera2d_splitscreen branch from b4aa726 to 9c52854 Compare October 20, 2025 19:38
@MiCurry MiCurry marked this pull request as ready for review October 20, 2025 20:00
@MiCurry
Copy link
Contributor Author

MiCurry commented Oct 20, 2025

I wanted to suggest this example as I believe a split screen example would be popular. This example might be better instead if it uses the simple physics engine and if uses the same 'map' as the other examples in the Camera section (e.g. Sprite-move-scrolling).

Happy to change it to use the simple physics engine, and make any other changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant