How do I check multi win lines on a slot machine?

0 favourites
  • 4 posts
From the Asset Store
Check preview, download and add value to your games.
  • Hi folks, I'm close on this, but I just can't seem to wrap my head around it.

    I have a slot machine I'm working on, I have a simple straight across win line, now I'm adding multi lines and its doing my head in!

    I think I need something like an array to hold the winlines, and an array for the reel items. I think I need to go through the win lines, and if the same number appears in the reel items, and my count gets up to 3 matches etc, then its good. Except I can't get my head around how to architect it (and accommodate multiple line wins too)

    Here's an example image of a-the win lines array, and b: A sample value of the array that is holding all the items on display. Finally c: In case you want to see what it looks like :)

    The actual project so far.

    Can someone help me out, even with pseudo code to get my head around it :)

    Thanks

    Tagged:

  • So you want to detect different line configurations, like this?

    Working with arrays in C3 is not an easy task and if you want to check for 20 different line configurations, this will be a huge PITA..

    I would probably do this with sprites and overlapping checks.

    Create a new sprite with all line configurations, each in a separate frame - blue line on my screenshot. Lets call it Detector. Define correct collision polygons, following the line. Then simply place Detector on top of your set of pictures and pick all pictures overlapping it. You can then analyse picked pictures from left to right and check if they form a winning combination.

    Then change Detector frame to the next one, and repeat the whole process for all frames.

    Make sure collision polygons for pictures are not very big, otherwise diagonal lines may overlap wrong pictures.

  • Yes, exactly that.

    Oh boy, I'm glad I posted then :P I believe I get what your referring to, so I'll give it some thought and a whirl and see what I can figure out.

    Thanks for the insight, and different perspective.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Another example:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)