Creating a split screen game
This recipe will introduce the DoubleSceneSplitScreenEngine
class, most commonly used in games which allow multiple players to play their own instance of a game on each half of the display. The DoubleSceneSplitScreenEngine
class allows us to provide each half of the device's display with its own Scene
and Camera
objects, giving us full control over what each half of the display will see.
Getting started…
Please refer to the class named SplitScreenExample
in the code bundle.
How to do it…
Setting up our game to allow two separate Scene
objects requires us to take a slightly different approach when initially setting up the BaseGameActivity
class. However, once we have set up the separate Scene
objects, managing them is actually very similar to if we were dealing with only one scene, aside from the fact that we've only got half of the original display space per scene. Perform the following steps to gain an understanding of how to set up the DoubleSceneSplitScreenEngine...