Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
How to detect if water can flow through grid?
Post Body

I'm prototyping a game like Pipe Mania (win '98) and I'm trying to figure out a way to detect if the pipes are all positioned/rotated correctly so the water can flow through, from start to finish.

The game will reside in a grid, with each tile being a pipe.

My first idea was to use a raycast from the "tap" and send it through each pipe (i.e grid piece) and if it makes it from the start to the end point, the user has assembled the pipes correctly.

The pipes can be either:

  • Vertical
  • Horizontal
  • T section
  • Cross section
  • 90° joint

Is this idea even possible? If not, what other ways could I approach this?

I'm not looking for code here, just suggestions, psudo code and ideas.

Thanks in advance.

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
11,300
Link Karma
1,289
Comment Karma
10,011
Profile updated: 1 day ago
Posts updated: 8 months ago
Indie

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago