Thread: Bejeweled

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    4
    <<split from https://cboard.cprogramming.com/showthread.php?t=57880>>

    i need to do the same game, Bejeweled, can you help me with this? The code below of Bubba it's a little buggy.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I have a great idea if it's buggy. Fix it. That post was not intended to be the end all be all of how to code bejeweled.

    Do some research.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    What is Bejeweled?

    I looked at Bubba's program, but it didn't look like a game, to me??

  4. #4
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    Quote Originally Posted by Adak
    What is Bejeweled?
    Its a browser puzzle game. Type it into google and you will see.

    Quote Originally Posted by Bubba
    I have a great idea if it's buggy. Fix it. That post was not intended to be the end all be all of how to code bejeweled.

    Do some research.
    IMHO theres nothing wrong with the OP's question. At least he took the time to search the board first, and in all fairness the code he found had more errors in it than you could shake a stick at. Not to mention it did not do anything.

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    The code was in response on how to display a bejeweled type game. I'm not going to sit here and attempt to defend a 4 year old post. For those of you who actually read the original thread I was simply showing a way he 'might' - key word - 'might' go about displaying items. I wrote the code while writing the post and I'm sure it was buggy but it was never intended to be bulletproof. It was simply a shove in the right direction.

    I'm so sorry that I didn't just write the whole game so someone could copy it later.

    Posts: 676 What is Bejeweled?

    I looked at Bubba's program, but it didn't look like a game, to me??
    Yeah it's not a game. I was showing one way to possibly render the text symbols or the entire board. So the concept is there but the code is quite honestly not meant to be an example of exactly what to do.
    Last edited by VirtualAce; 02-18-2008 at 05:53 PM.

  6. #6
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    np, all I was trying to say was that theres no need to take offence by the OP's question; I'm sure it was never intended as anything personal

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Sorry but quoting a 4 year old post and complaining about code that the OP obviously cannot write themselves is rude.

    Maybe I should ask 'How do I make my next 3D game?' and then cite all sorts of samples from various posts that don't fit my exact design.

    We like to see at least an effort here and thus far in this thread I've seen nothing.

  8. #8
    Registered User
    Join Date
    Feb 2008
    Posts
    4
    i don't have plenty of time, i'm in the last year at highschool, and my time is filled with extra curriculum activities. Thanks for help!

  9. #9
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    Back in my day extra curriculum was just that, extra, focus on your real curriculum and do your own homework.

  10. #10
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    ok

    help me out then and tell me how do i load for displaying a full image in c++ for DOS(v3.31). I need to show images in C++ DOS when playing Bejeweled. The images must be linked someway, in a way that i can randomise the 7 squares.

    I am searching 2 weeks now, and with no result!Sorry for my english, i'm in a hurry!

  11. #11
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    K

    Ok, problem solved. Now i have to make the algorithm for the table to automatic delete the 3 blocks horizontally/vertically in combination, to make the blocks from the upper line come down in the place of the deleted blocks and finally, to verify wether there are other blocks that are making a 3-consecutive combination after the replacements of the blocks. Any help is good.

  12. #12
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by Hisco View Post
    Ok, problem solved. Now i have to make the algorithm for the table to automatic delete the 3 blocks horizontally/vertically in combination, to make the blocks from the upper line come down in the place of the deleted blocks and finally, to verify wether there are other blocks that are making a 3-consecutive combination after the replacements of the blocks. Any help is good.
    You'll need to scan through each element of the table, both by rows and by columns, and see where any combo of 3 jewels in a row, might be found.

    Code:
    /*an example of a row based scan*/
    flag1 = flag2 = flag3 = 0;
    for(row = 0; row < NumberOfRows; row++)  {
       for(col = 0; col < NumberOfCols - 1; col++)   {
          if(table[row][col] == table[row][col+1])   {
             if(flag2 == 1)  {
                flag3 = 1;    //indicating you have 3 jewels in a row
                //add your "falling from the top rows down to the current row" code, here
                //remember to start with the current row, and "pull" the jewels down, otherwise
                //you'll not know what jewel to pull down after the first one, because you
                //over-wrote it's value already
                flag1 = flag2 = flag3 = 0; //ready to continue scan
             }//end of if
             
             if(flag1 == 1)
                flag2 = 1;   //indicating you have 2 jewels in a row
             else
                flag1 = 1;
          } //if table[row... ==...
          else
             flag1 = flag2 = flag3 = 0; //1st time no match, all three flags need to go back to zero
       }//col
    }//row
    This code is very untested, so be warned. I've never played Bejeweled, either. (Tried to, but it kept tell me it couldn't with my browser (Firefox).

    Good luck with your project.
    Last edited by Adak; 03-23-2008 at 11:13 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. making bejeweled
    By ahming in forum Game Programming
    Replies: 7
    Last Post: 10-17-2004, 11:05 PM