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 attribute

Problem it solves

You want to manually set an enemy's vertical gravity, height position, or upward velocity in 3D.

What this block does

Updates vertical 3D physics attributes (ZOffset, ZPosition, ZVelocity, or ZAcceleration) for a given sprite.

The block

Block ID: rcRender_setSpriteAttribute

set Sprite %spr=variables_get(mySprite) %attribute = %value block

Parameters

NameTypeDefaultMeaning
sprSpritemySpriteThe sprite to modify.
attrRCSpriteAttributeThe 3D attribute to change (ZOffset, ZPosition, ZVelocity, or ZAcceleration).
valuenumberThe numerical value to assign.

Returns

void — Nothing.

Example

let mySprite = sprites.create(img`.`, SpriteKind.Player)
Render.setSpriteAttribute(mySprite, RCSpriteAttribute.ZOffset, 4)

Add the extension

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