CodeBase - Simple tile-based collision

Return to the CodeBase listing

Category: Collision

Version: 1.0

0
0

Information

Uploaded: 7th Sep 2004 16:51

Modified: 1st Jan 1970 01:00

Author:  DARKGuy

Summary

This is a code snippet that could be used like a tile-based collision and movement system.

Full Description

Greetings!<br /> <br /> This is a code snippet that could be used like a tile-based collision<br /> and movement system. With just 4 objects (spheres) you can detect if<br /> there's a wall at your front, back, left and right respectively.<br /> <br /> I hope this code works useful for some of you.<br /> <br /> As the sync rate was in 60, I had to change the speed of movement to 0.5<br /> so it moved softly, and also to prove that also works without having the<br /> player to move tile-by-tile.<br /> <br /> If you use this code in your programs, please include my name in the<br /> credits / source code, it's all that I ask :).<br /> <br /> INFORMATION:<br /> <br /> OBJECT 1: PLAYER<br /> <br /> OBJECT 10-13: For detecting collisions in the 4 directions<br /> OBJECT 10: COLLISION LEFT<br /> OBJECT 11: COLLISION RIGHT<br /> OBJECT 12: COLLISION DOWN<br /> OBJECT 13: COLLISION UP<br />

Comments

No comments yet.