Skip to content

raylib.CheckCollisionRecs

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Check collision between two rectangles

Parameters

Parameter Default Value Note
rec1
rec2

Return value

Condition Return Value
(always) number

Notes

Example

player = {x:100, y:100, width:50, height:50}
enemy  = {x:130, y:120, width:50, height:50}
if raylib.CheckCollisionRecs(player, enemy) then print "Collision detected!"

Clone this wiki locally