Table of Contents

 
TestCollision
 

Purpose

Test a bound box collision between two sprite objects

 

Protoype

bool CSpriteMngr::TestCollision (string str_sprite_id1, string str_sprite_id2)
 

Parameters

sprite_id1 the ID of the first sprite object to test
sprite_id2 the ID of the second sprite object to test
 

Description

This function takes two sprite objects and compares their bounding boxes to see if they intersect. If they do, the function returns TRUE. If they don't, the function returns FALSE.

 

Use

CspriteMngr sprite;
if (sprite.TestCollision("man", "bullet"))
    // he's been hit!
 

Prev: TestBatchCollision