MakeCode Games!

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

← Back to extensions

Sprite Walls

Add solid wall collisions and pushable block physics between sprites or sprite kinds without needing tilemap walls.

stop when colliding

Problem it solves

You want an NPC, a heavy boulder, or an enemy to act like a solid wall so the player cannot walk straight through them.

What this block does

Sets up continuous collision checking between two sprites or sprite kinds so that the first sprite stops completely upon hitting the second sprite, treating it like a solid obstacle.

The block

stop $spriteA when colliding with $spriteB block

Parameters

NameTypeDefaultMeaning
spriteASprite | numbermySpriteThe moving sprite or SpriteKind that should be stopped.
spriteBSprite | numbermyEnemyThe obstacle sprite or SpriteKind acting as a solid wall.

Example

let player = sprites.create(img`.`, SpriteKind.Player)
let guard = sprites.create(img`.`, SpriteKind.Enemy)
controller.moveSprite(player)
CollisionHandler.handleSolidCollision(player, guard)

Add the extension

Add github:Sonicblaston62/Sprite-Walls to your project, or open: Import Sprite-Walls.