Archived

This topic is now archived and is closed to further replies.

Tron Clone Collision Detection

This topic is 5656 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m making a two-player Tron game and I have a two part question about collision detection. Should I use an array to track what positions a certain cycle has been to and then scan the array each time I get ready to draw a cycle? This seems really inefficient as the longer the game is played the more checks will be required that will generally slow the game down. -OR- Should I just try and determine if giving that light cycle 1 is at position x1 and y1 whether or not either cycle (1 or 2) has been to that position by checking the color value of the pixels at that screen area? That being done: Should I check the value of where the cycle WILL be .vs. where the cycle IS before instituting this check? I think I should check where the cycle will be (Which, of course, means I should adjust the value of the determining vector based upon the current direction of the cycle). I''m writing this as a DOS based game using VC++ V1.52. Thanks. (Yeah, I realize that I might have answered some of my own questions (or, at the least, they''re blatently obvious now).)

Share this post


Link to post
Share on other sites
Hi,

I recently wrote my own Tron clone in Windows, and the way I checked for a crash was as follows:

1. I had an array which stored all the information of the arena, i.e. walls, where players have been wtc.

2. Each time the light cycle was to move, I checked the array one in front of where the cycle would be, for example if the bike was at 20, 20 and travelling right, I would check 21, 20

3. If there was a wall or another players "tail" already there, then the player exploded.

This seemed to work fairly well, and the game would never slow down due to arrays becoming larger or anything like that.

Hope this helps!

Share this post


Link to post
Share on other sites