Learn Create Your Own Split Screen

Next Page

As always with coding, there's lots of different ways to achieve an outcome.

We're going to restructure our approach slightly. Either way is valid, but this new approach will be closer in structure to how we'll go about it in Javascript.

Instead of a forever loop creating new clones, we'll make each new clone also create the next clone.


At first glance, you might think this produces only one bat at a time, but since each bat lasts for a few seconds, and since each bat starts the next clone within a second at most, you readily end up with two or three, or more, bats existing at the same time.