# \[Extension\] arcade-split-screen

**URL:** <https://forum.makecode.com/t/extension-arcade-split-screen/14970>\
**Category:** Show & Tell\
**Tags:** extension\
**Created:** [August 17, 2022, 10:32pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970 "2022-08-17T22:32:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [August 17, 2022, 10:32pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/1 "2022-08-17T22:32:18Z")

</div>

Hey folks!

Here’s a little extension that @danger_kitty asked @jwunderl and I to whip up on stream today:

```auto
riknoll/arcade-split-screen

```

> **[GitHub - riknoll/arcade-split-screen: MakeCode Arcade extension that adds...](https://github.com/riknoll/arcade-split-screen)**
>
> MakeCode Arcade extension that adds split screen camera support - GitHub - riknoll/arcade-split-screen: MakeCode Arcade extension that adds split screen camera support

This adds one block that lets you enable split screen for your multiplayer game.

![splitscreen](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/938d32b4a384033054f0b828fc7bdcbb1ff0186a.gif)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [August 17, 2022, 10:34pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/2 "2022-08-17T22:34:10Z")

</div>

@jwunderl I also added the tilemap camera boxing you mentioned and made it so that this renders at z-index 99

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [August 17, 2022, 11:11pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/3 "2022-08-17T23:11:46Z")

</div>

One thing to note when using this – flags / etc set based on the camera - in particular, stay in screen, autodestroy (projectiles), bounce on wall when there is no tilemap - will still be based off the ‘real’ screen, so if you e.g. spawn projectiles for ‘player 2’ they might just … disappear if you don’t turn off autodestroy.

(also @richard I think you need to guard existence of realCamera.sprite and tilemap – I’m getting a null pointer exception when pressing b to enter split screen mode here without both those being set: [https://makecode.com/\_FAKPeTEVj3H3](https://makecode.com/_FAKPeTEVj3H3))

---

<div class="post-metadata">

**Author:** ![danger\_kitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/danger_kitty/32/32006_2.png) [@danger\_kitty](https://forum.makecode.com/u/danger_kitty)\
**Post date:** [August 17, 2022, 11:11pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/4 "2022-08-17T23:11:59Z")

</div>

Cool!

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [August 18, 2022, 12:22am UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/5 "2022-08-18T00:22:16Z")

</div>

this sounds great for 2-player games made in the future!

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [August 18, 2022, 4:11pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/7 "2022-08-18T16:11:44Z")

</div>

Wow! This Is Just What I Need For My Splatoon Game!

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [August 18, 2022, 4:22pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/8 "2022-08-18T16:22:16Z")

</div>

@jwunderl fixed!

---

<div class="post-metadata">

**Author:** ![isoffline](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/isoffline/32/8791_2.png) [@isoffline](https://forum.makecode.com/u/isoffline)\
**Post date:** [August 18, 2022, 8:12pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/9 "2022-08-18T20:12:55Z")

</div>

Can i have the link of youre game in the gif

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [August 18, 2022, 8:18pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/10 "2022-08-18T20:18:36Z")

</div>

@isoffline here you go!

> **[splitscreen demo](https://arcade.makecode.com/66629-31960-05105-39180)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

It’s not particularly exciting, just a barebones platformer.

---

<div class="post-metadata">

**Author:** ![isoffline](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/isoffline/32/8791_2.png) [@isoffline](https://forum.makecode.com/u/isoffline)\
**Post date:** [August 18, 2022, 8:54pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/11 "2022-08-18T20:54:52Z")

</div>

Thank you Very much i need it because i keep getting errors and i need this to plagiarize uhm um i meant to get idea from here

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [August 18, 2022, 8:55pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/12 "2022-08-18T20:55:31Z")

</div>

@isoffline not plagiarism at all! Feel free to do whatever you want with that code

---

<div class="post-metadata">

**Author:** ![SCREEE123](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@SCREEE123](https://forum.makecode.com/u/SCREEE123)\
**Post date:** [August 22, 2022, 2:54pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/13 "2022-08-22T14:54:41Z")

</div>

I’ve tried to make a 2 player race game with this and I got the block and looked at the gif coding but I cant seem to get it working

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [August 22, 2022, 4:33pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/14 "2022-08-22T16:33:21Z")

</div>

@SCREEE123 can you share a link to your code?

---

<div class="post-metadata">

**Author:** ![danger\_kitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/danger_kitty/32/32006_2.png) [@danger\_kitty](https://forum.makecode.com/u/danger_kitty)\
**Post date:** [August 23, 2022, 5:24pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/15 "2022-08-23T17:24:58Z")

</div>

Right now I am making a small 2 player game with this

---

<div class="post-metadata">

**Author:** ![SCREEE123](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@SCREEE123](https://forum.makecode.com/u/SCREEE123)\
**Post date:** [August 25, 2022, 4:29pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/16 "2022-08-25T16:29:41Z")

</div>

here it is

> **[racer (not complete)](https://arcade.makecode.com/58200-93204-61187-33493)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

i added the 3D render extension looking for a 2 screen block and didn’t need it

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [August 25, 2022, 4:37pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/17 "2022-08-25T16:37:10Z")

</div>

@SCREEE123 this extension is not compatible with the raycasting extension. I’m not super sure why, but I’d have to peek at the raycasting extension to figure that out. @AqeeAqee what z-index do you render on?

In the meantime, here is your project without the raycasting extension:

> **[racer (no raycasting)](https://arcade.makecode.com/47886-67839-58558-67147)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [August 26, 2022, 9:25pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/18 "2022-08-26T21:25:51Z")

</div>

Hi @richard !

To takeover sprites( and baseSprite including Renderable) and prevent them from drawing in 2d mode, I removed them from the currentScene, once they are created. So nothing will be drawing when calling game.currentScene().render() with realScreen and realCamera, and the same result with fakeScreen and fakeCamera. What we got is rendered by raycasting ext., and a black strip drawn by split screen ext.

BTW, I almost missed this post, if you didn’t mention me. Love this wonderful extension, pretty codes, so valuable for 2 players game. Thanks!

Hi @SCREEE123 !  
This raycasting ext. is drawing directly to the screen, and not considered split screen when designing. So it is not compatible with split screen mode yet. And I am not think I will fix this, cause:

- The 3D mode will not performance well if render twice for both players.
- This would be not necessary if only working in 2D mode, so just remove it pls.

These are just my thingking by now, any suggestions are welcome!

---

<div class="post-metadata">

**Author:** ![SCREEE123](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@SCREEE123](https://forum.makecode.com/u/SCREEE123)\
**Post date:** [August 29, 2022, 4:22pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/19 "2022-08-29T16:22:36Z")

</div>

thanks, i got the raycasting thinking it would work but it didn’t seem to as you say

---

<div class="post-metadata">

**Author:** ![soloslayer](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@soloslayer](https://forum.makecode.com/u/soloslayer)\
**Post date:** [January 24, 2023, 11:55pm UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/20 "2023-01-24T23:55:22Z")

</div>

could you make a camera for each screen for your online multiplayer function?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [January 25, 2023, 12:36am UTC](https://forum.makecode.com/t/extension-arcade-split-screen/14970/21 "2023-01-25T00:36:25Z")

</div>

@soloslayer that’s something we’re thinking about adding, but it’s impossible to do that from an extension today. It needs to be done in MakeCode itself

[Next page](https://forum.makecode.com/t/extension-arcade-split-screen/14970.md?page=2)
