Match 3 mini game

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Sehaf
Regular
Posts: 58
Joined: Thu Feb 25, 2010 9:22 pm
Projects: Demon Lord & Yuki Academy
Deviantart: Sehad
Location: Sweden
Contact:

Match 3 mini game

#1 Post by Sehaf »

So, another problem. This time I'm trying to make a somewhat minigame with a simplified version of match 3 game. The code I'm doing is as follow:

Code: Select all

    class Boxx(object):
        def __init__(self, color="None", row=0, line=0, **kwargs):
            self.color = color
            self.row = row
            self.line = line
            
        def seedBoard(self):
            i = 1
            x = 1
            while i<=7:
                while x<=7:
                    box_[i][x] = renpy.random.choice(['red', 'blue', 'yellow', 'green', 'pink'])
                    x+=1
                i+=1
            
            
            
        def checkBoard(self):
            i = 1
            x = 1
            while i<=7:
                while x<=7:
                    if box_[i][x] == "red":
                        checkvalue += 1
                        if checkvalue == 3:
                            box_[i][x] = renpy.random.choice([ 'blue', 'yellow', 'green', 'pink'])
                    if box_[i][x] == "blue":
                        checkvalue += 1
                        if checkvalue == 3:
                            box_[i][x] = renpy.random.choice([ 'yellow', 'green', 'pink'])
                            
                    #etc....
                    
                    x+=1
                i+=1

It does not appear to work the way I want and perhaps I'm waaay of in what I'm doing. Though if someone know what went wrong, pleas lend some help ^_ ^
I'm a GameMaker!
My Portfolio: http://www.bluepipestudio.com

Post Reply

Who is online

Users browsing this forum: No registered users