Help with casino-like game scoring condition detection

Hello everyone,

I decided to try and create a casino-like game as a passion project. I wont be releasing this public, but I really enjoy the creation process, so I have committed some time to it. I am currently in the process of creating the game logic that will randomize the grid and check for scoring conditions.

While I have managed to do the randomization thing, I cant seem to find an efficient way to check if there are any scoring conditions. I want to have about 10 different items that can score if at least 3 of them are adjacent to each other. I wont go into detail on how I have implemented the randomization logic, since I am willing to change the entire thing if it enables me to detect scoring conditions.

btw my grid is 5x3
Imgur

Thanks for your time!

You need to determine what are the winning line combinations. On a slot game it will show these lines, typically each in a different color, when you choose how many lines to play. These lines go from one position on a reel to the next position.

So your logic simply has to check each reel position in order to see if a winning combination is present on any of those lines (and all lines can count at the same time). So simply keep a list of lines with the positions in the grid that represent those lines. Typically, any combination has to start on the left side until you hit a reel that doesn’t have a winning symbol and that determines how much that line wins.

If you implement scatter wins you check the whole matrix for the scatter symbols.

Hope that helps you.

Mike

The thrill of playing at an online casino in Australia is unmatched, especially with the wide variety of games available. From slots to roulette and live dealer games, Australian online casinos offer something for every player. However, with the convenience of online gambling comes the responsibility of choosing a trusted platform. A reliable online casino will be licensed by Australian or international regulatory bodies, ensuring that the games are fair and your personal information is secure. Make sure the casino has a good reputation by checking player reviews and looking for any certifications, such as eCOGRA, which guarantees fairness and safety. Also, consider the available payment methods; trusted platforms offer secure and convenient options for deposits and withdrawals. Always verify that the casino provides customer support in case you need assistance. By selecting a trustworthy online casino, you can focus on enjoying your favorite games with peace of mind, knowing that your gaming experience is safe. For more information, it is better to visit a website.

I’d go with a basic approach. Ask each item in the grid: do I have an identical item in the grid position to my left and right? or to my top/ bottom? Then just iterate the same for the entire grid.

It’s not the “most” efficient, I’m sure some mathematical wiz will have answer for it, but it’s easy to build and understand, and in the context of a 5 x 3 grid, the CPU nowadays will simply shrug and give you the result instantly.

However, before getting there you also need to consider: what if you have 4 in a row? or 5 in a row? in a 5x3 grid those are possible. Will you potentially be counting them twice? or is 4 or 5 in a row going to give better score? What if you have a cross? Or an L shape? This is the kind of stuff that you see in Bejeweled games. Again, you can cram in all the kinds of checks you can think of and as long as you’re not leading down an endless loop of iterations, you can still expect to get answers instantly.

If you have 10 unique items, there’s also a chance that there is insufficient material. (If there’s only 2 of the “apple” item in the entire grid, you know there’s no way you will have matches).