Help ME :Path complete !! The ball can move faster now.,but How??

I am making a game where the ball moves along the path i create in the game.The game has a “start” and “goal”.I have to slide the puzzle pieces to make a path so that the ball can move to its GOAL.
Now,
I want to move the ball faster than usual ,when the path is completed,i.e START----->GOAL is made while the ball is still rolling on its way.
How to let the BALL know that the Path is complete and ,now it can move faster.

Please Help!!
ScreenShot is attached herewith for your aid.

1667459--104424--Gameplay.jpg

Well, I imagine you have a script that controls the tiles, and so has some logic to check if the path is complete. Also, I guess you have a script that manages the ball. So, your tile script just needs to tell the ball script that the path is complete. Scripts can find each other using GetComponent, or if the scripts are on different game objects using GameObject.Find(), or my linking them using the inspector. Then, if you are using physics to move the ball, just increase it’s velocity.

1 Like

Sir,Thanks for your rply…I want to know about the logic to confirm if the path is complete. If that mesage can be sent to the ball,then the work is done.

Your game looks like it has a 4x4 grid of tiles. So, assuming each tile is numbered, you can work out where these tiles have to be in order for the path to be complete. Perhaps the 4x4 grid is complete when top left to bottom right have the numbers 1…16 in increasing order. So you can then write a small routine which works out if the tiles are ordered correctly.

I think there will be more than 1 fixed way to make the path COMPLETE…,taking permutation and combination of" Path directions"into account…Please suggest a generic way so that It works for all levels.

You want me to come up with the design of a critical part of your game? I hope you’ll share some of the revenue with me. :slight_smile: Or when you complete your training your company/school will give me a bonus. :slight_smile: :slight_smile:

So, paths can connect edges of each tile. So, the tile top right has a path from the north edge to the south edge. It’s connected to a tile below with a edge from north to south as well. So, you can follow a path across the edge between them. Similarly, the tile one in from left on the bottom edge has a path from north to south. The tile above has no south connection, so these tiles are not connected. Start and end tiles are unusual in that they only have a single connection. Track these tiles, and see if you can follow paths from the start across tiles to the end. In your picture, start has a connection across it’s south edge.The tile to the south has a connection on it’s north and east edges. The tile to the east of that has a west and east connection. There is a tile with no connections to the east of that, so the path is not complete.

thnx for the logic //I am trying it out.