SpriteCollidedEx

Top  Previous  Next

Syntax

UINT = SpriteCollidedEx(sprite1 as POINTER,x1 as INT,y1 as INT,frame1 as INT,sprite2 as POINTER,x2 as INT,y2 as INT,frame2 as INT)

Description

Tests for collisions between sprites

Parameters

sprite1 - A sprite pointer

x1, y1 - The position of the first sprite

frame1 - The image frame of the first sprite

sprite2 - A sprite pointer

x2, y2 - The position of the second sprite

frame2 - The image frame of the second sprite

Return value

TRUE if the sprites are colliding, FALSE otherwise.

Remarks

The collision test is always done in pixel perfect mode. The internal position and frame of the sprites is not used or modified by this function. The same sprite pointer can be used for both sprites allowing virtual testing. Image frames for sprites are zero based.

See Also: SpriteCollided

Example usage

IF SpriteCollidedEx( goodguy, ggX, ggY, ggF, badguy, bgX, bgY, ggF)
    EndGame()
ENDIF