Add a split screen example using Camera2D#2789
Add a split screen example using Camera2D#2789MiCurry wants to merge 2 commits intopythonarcade:developmentfrom
Conversation
abbce1b to
b4aa726
Compare
This is a simple example of how to create a split screen example using Camera2D and uses the PyMunk physics engine.
b4aa726 to
9c52854
Compare
|
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! |
|
@MiCurry I think I'd like to see a non pymunk version with a similar map maybe, but there's no such thing as too many examples really, so there's no reason we can't keep the existing one too. Perhaps the existing one in this PR gets renamed to like |
@Cleptomania that sounds like a good idea. I'll see if I can make an additional example without pymnk for us! |
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
viewportsto be half of the screen. When drawing the scene, we loop through each camera and draw our scene, then inupdate()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.