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.

create animations

Problem it solves

You want an enemy or character to show different sprites depending on which angle the player is viewing them from in the 3D world.

What this block does

Creates a directional animation package from 1 to 4 sets of animation frames. Directions are evenly distributed in clockwise order starting from facing left.

The block

Block ID: create_animation

interval$frameInterval=timePicker animates:$frames1=animation_editor|| $frames2=animation_editor $frames3=animation_editor $frames4=animation_editor block

Parameters

NameTypeDefaultMeaning
frameIntervalnumber150Time between animation frame flips in milliseconds.
frames1Image[]The first animation frames list (faces left by default).
frames2Image[]Optional second animation frames list (for right or front view).
frames3Image[]Optional third animation frames list (for right view in 4-way setup).
frames4Image[]Optional fourth animation frames list (for back view in 4-way setup).

Returns

Animations — A directional Animations object ready to assign to sprites.

Example

let anim = Render.createAnimations(150, [img`.`], [img`.`])
let enemy = sprites.create(img`.`, SpriteKind.Enemy)
Render.setSpriteAnimations(enemy, anim)

Add the extension

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