Jump to content
  • Advertisement

Archived

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

Afterlife

Checking all touching(?adject?) table members, heelp

This topic is 6308 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

There''s a 2d table, from which I need to check all the members that are in contact to the middle member. The default value of a table "member" is 0. And if the middle one is 1 I need to go all directions and see how far the members with value 1 go and record them.
  
._._._._._.
|0|0|1|0|1| <= this 1 is not to be recorded to a table of the same type
|0|0|1|0|0|
|1|1|1|1|0| (<= the cheking should start here)
|0|0|1|0|1| <= this one neither, but the rest are
|0|0|1|0|0|
.-.-.-.-.-.
  
Hope you got the idea. (The reason for this is simple; roof. When the player is under a roof tile all adject roof tiles and including the one the player is standing under will not be displayed.) I''ve tried this many times, but I can''t even get the first line right (bugs bugs and more bugs). Could someone please demonstrate me a general logic to do this? (some code examples would be nice, because code is probably my main enemy here, not necessarily the logic) Thanks

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!