Skip to content

Zenkai Opcode SetCollisionRect

Johnathon edited this page Sep 20, 2026 · 2 revisions

SetCollisionRect

Sets a collision rectangle (blocking region) on the current map.

Syntax

SetCollisionRect(x1, y1, x2, y2)

Parameters

x1
Integer
Left edge of the rectangle, in world pixels.

y1
Integer
Top edge, in world pixels.

x2
Integer
Right edge, in world pixels.

y2
Integer
Bottom edge, in world pixels.

Remarks

Sets a collision rectangle (blocking region) on the current map. The four values are the rectangle's corners, not a width and height: every use in the game passes them that way (for example SetCollisionRect(240, 352, 272, 384), followed by RemoveRectFromMask2 with the same values).

Examples

Minimal illustrative encoding (synthetic, not from a real ROM script):

0x00, N           // PushByte(x1)
0x00, N           // PushByte(y1)
0x00, N           // PushByte(x2)
0x00, N           // PushByte(y2)
0x02, 0x47        // Step -> BytecodeVM_SetCollisionRect

See Also

Applies To

Game Notes
Legacy of Goku 2 Supported

Clone this wiki locally