CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: Pipe Game

  1. #1
    Join Date
    Aug 2012
    Location
    Ukraine, Odessa
    Posts
    19

    Pipe Game

    Hi, all. I have written a game called pipes. You can see this game here http://home.earthlin...rn/pipegame.htm.I did a check for a connection between the pipes. The line of pipes coming from the centre works correctly. But I cant do a check for a disconnection of pipes. When the way to center is broken, others pipes must lost their connection with the center. The code you see below is a check for a connection of central pipes. For object |.

    Code:
    field [i, j].down = 1;
    field [i, j].top = 1;
    field [i, j].right = 0;
    field [i, j].left = 0;
    
    if ((field [i, j - 1].down == 1 && field [i, j].top == 1) && ((field [i, j - 1].flag == false && field [i, j].flag == true) || 
    (field [i,j-1].flag == true && field [i,j].flag == false) || (field [i,j - 1].flag == true && field [i,j].flag == true))) {
    
    field [i, j].flag = true;		
    field [i, j - 1].flag = true;						                                                                                                                                                                              
    cx.Cells [i + 2, j -  1 + 2].BackgroundColor = ConsoleColor.Blue;							 
    cx.Cells [i + 2, j + 2].BackgroundColor = ConsoleColor.Blue;}
    I attached my game to a topic.
    Pipe Game.rar

    P.S. Sorry for my bad English.
    Last edited by Pahanuch; September 3rd, 2012 at 04:32 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured