Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sprite neighbors

Author
Message
Lourg
20
Years of Service
User Offline
Joined: 20th Dec 2003
Location:
Posted: 24th Jul 2007 17:16
I was wondering if some would could help me with the following problem.

Right now I have created a game that will be usings tiles as sprites. A player clicks on a new tile button the tile appears and I now have it set for the tile to move the length of the sprite in a grid patturn. What I'm trying to do is have the sprite tell what sprite is next to it with out colliding with the tile. There are roads on each tile but not all tiles have roads leading off the tile each direction. So I need to be able to have each tile road connect and not let the player break the rules. I though about using some form of numbering system. A zero would be no road and a one would be a road. So if a tile was N1,E0,S0,W1 meaning the north and west side of the tile had a road and east and south did not have a road. I could connect this tile to another tile that had N1,E0,S1,W0. Any thoughts would be great.

I would show a code sippet but I don't have the program on this computer and my code is broken in to 8 different files.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Jul 2007 17:22
Take a look at my Railrider code in Program Announcements (stickied). It does exactly this.

Login to post a reply

Server time is: 2024-11-26 12:20:56
Your offset time is: 2024-11-26 12:20:56