MakeCode Games!

A fan-made community library of MakeCode Arcade games. Visit MakeCode Arcade to make a game!

← Back to extensions

Split Screen

Add split-screen multiplayer cameras and picture-in-picture camera view sprites to MakeCode Arcade games.

camera property

Problem it solves

You need to know where a specific player's camera is looking in the tilemap to spawn items nearby or check boundaries.

What this block does

Gets a coordinate property (such as X, Y, Left, Right, Top, or Bottom) from a split-screen camera.

The block

Block ID: splitscreen_getCameraProperty

camera $camera $property block

Parameters

NameTypeDefaultMeaning
cameraCameraCamera.Camera1Which camera to inspect
propertyCameraPropertyCameraProperty.XThe coordinate property to read (X, Y, Left, Right, Top, or Bottom)

Returns

number — The pixel position of the requested camera property.

Example

let camLeft = splitScreen.getCameraProperty(splitScreen.Camera.Camera1, CameraProperty.Left)
console.log(camLeft)

Add the extension

Add github:riknoll/arcade-split-screen to your project, or open: Import arcade-split-screen.