CodeBase - Camera collisions using the distance formula

Return to the CodeBase listing

Category: Collision

Version: 1.0

0
0

Information

Uploaded: 14th Nov 2005 13:16

Modified: 1st Jan 1970 01:00

Author:  GMX

Summary

This function will return whether a specified object is "colliding" with the camera. This allows for not having to type the distance formula again and again and is good for FPS games.

Full Description

In reality, there is no collision checked between the camera and the object, but rather the distance between the object specified (objname) and the camera point is figured by the function. Then it checks to see if the distance is under the threshold amount. If so, it returns 1. So you could easily type<br /> <br /> if cameracollision enemyobject,50 then delete object playerobject<br /> <br /> as an example.<br /> <br /> It's not too spectacular but it saves lots of typing.

Comments

No comments yet.