SpriteCollision()

Syntax

Result = SpriteCollision(#Sprite1, x1, y1, #Sprite2, x2, y2)
Description
Tests if the two sprites are overlapping.

Parameters

#Sprite1 The first sprite to test.
x1, y1 Coordinates of the first sprite, in pixels.
#Sprite2 The second sprite to test.
x2, y2 Coordinates of the second sprite, in pixels.

Return value

Nonzero if the two sprites are overlapping, zero otherwise.

Remarks

This routine compares the rectangular areas around the sprites, giving a very fast but not very accurate function (depending on the shapes of your sprites). Very useful for fast arcade games. Zoomed sprites are also supported.

For a more exact collision check use SpritePixelCollision().

See Also

SpritePixelCollision()

Supported OS

All

<- SpriteBlendingMode() - Sprite Index - SpriteDepth() ->