MakeCode Games!

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

← Back to extensions

Raycasting 3D Render

Transforms your 2D tilemaps and sprites into a first-person 3D/2.5D raycasted world with jumping, heights, camera controls, and multi-directional animations.

set Sprite floating pixels

Problem it solves

You want a flying bird, floating coin, or hovering drone to stay elevated above the ground in 3D space.

What this block does

Sets the base floating height (Z-offset) in pixels for a sprite, with an optional smooth transition duration.

The block

Block ID: rcRender_setZOffset

set Sprite %spr=variables_get(mySprite) floating %offset pixels|| duration $duration=timePicker|ms  block

Parameters

NameTypeDefaultMeaning
spriteSpritemySpriteThe sprite to elevate.
offsetnumber8Floating elevation in pixels (positive is up, negative is down).
durationnumber0Time in milliseconds to glide to the new height (0 for instant).

Returns

void — Nothing.

Example

let coin = sprites.create(img`.`, SpriteKind.Food)
Render.setZOffset(coin, 8, 0)

Add the extension

Add github:The-Code-Zone/Raycasting-pxt-extension to your project, or open: Import Raycasting-pxt-extension.