[quote=misterooga;2332646]That’s if you are only talking about binary array… You can use rest of whatever is flash’s integer values.
Considering the pipes rotate in one direction, this is very easy.
You can say,
0 = empty space
1 = horizontal pipe
10 = elbow pipe
20 = cross pipe
then,
2 = horizontal pipe in vertical position
11 = elbow pipe from top to left
12 = elbow pipe from left to down
13 = elbow pipe from down to right
14 = elbow pipe from right to top
and you can even make use of other numbers…
111 = elbow pipe from top to left in blue color
211 = elbow pipe from top to left in yellow colour.
… so in the end, it’s all how you set the convention.
When you are checking if a path exist, you just have to check if one of the gas outlet is linked with, say, any pipe line with values greater than 100 or 200…etc.
So to use the array example above, following will be a winning combo
pipes:Array = [
[101, 0, 0, 1, 0, 0, 1, 0, 201],
[ 0, 0, 0, 1, 1, 1, 1, 0, 201],
[ 0, 0, 113, 101, 101, 101, 101, 101, 201],
[101, 101, 111, 1, 1, 1, 1, 1, 201],
[ 0, 0, 0, 0, 0, 0, 0, 0, 201],
[ 0, 0, 0, 0, 0, 0, 0, 0, 201]
];
[/quote]
Thanks for this reply , but its ok that you can place pipe of any size either “L” shape or “U"shape , but the problem is that whenevr you click on 'U” shape U should move and should not call “L” shape, here is my fla …chk it.
whenver you click on “I” shape “I” should move in corresponding direction and it should not call U shape …