How do you stop 2 or more rules from conflicting?

I have stumbled into a big issue here where some of my rules are conflicting one another causing chaos..

Basically i have 4 actors that give clues to whether you have guessed the colour sequence correctly or not.

So currently i am distributing the rules through one of the actor.

Lets see if i can explain this properly cause it is kind of difficult to explain what exactly is going on.
There are 4 colours that you have to guess in the correct sequence. See the mastermind game. It is something like that. So when lets say you think yellow is the first colour in the sequence and if it is, the actor will turn into red after the round indicating that you have correctly guessed the colour and the order.
So currently i have the rules as follows

  1. When (you have correctly guessed the colour in the right position) and self.current state=0

Then change self.image into red actor
change self.current state to 1.

  1. When you have correctly guessed the colour in the right position) and self.current state=1

** In this case as the first actor giving the clue is already occupied, it will/supposed to move on to the next actor aka the next actor will now turn red as well**

Then change "background.actor2.image" to "red.png"

---This is the same for the next 2 actors

The issue is that when i execute this, ALL FOUR actors turn red at the same time when the 2nd,3rd and 4th actors are only supposed to turn red if the first actor IS ALREADY OCCUPIED. How do i solve this issue? Thanks for the help and ask questions below if you dont understand anything

Comments

  • stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
    edited June 2014

    so confused..you used words such as "occupied" which completely messed me up.
    However I think, the basic principle is when someone touches the correct actor in the sequence, the actor turns red , but all your actors turn red not just one?
    Forgive me if im wrong but id like to know if im correct so i can of help

    EDIT: @PBEmpire‌

    I think i see what you mean.
    If someone presses the second one in the sequence, but they haven't yet pressed the first one, the second one still changes?

    CONCLUSION:

    Are you saying that if the 2nd one in the sequence can be pressed if the 1st one isn't?

    or

    Are you saying that all four turn red when you press the first one in the sequence

    If issue #2

    Try using a timer when changing game.currentstate...
    i.e.


    After [0.5] seconds - Run to completion...

    change attribute [game.current state] to 1

    Sydney Swans 2014!!

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    Hi, I've a question as well, before I'll answer...

    How are the 4 actors selected and "given" their positions? (Dragged to 1st, 2nd, 3rd or 4th positions?)

    And here's a suggestion: if your game is based on, or similar to, Mastermind, where colours in a certain order are meant to be found, changing a colour in the right place to red would surely not aid the user at all... (the original colour(s) probably forgotten eventually)... so the suggestion is to indicate a different way for when a colour is in the correct place...

    And if that's done, what about the correct colour in the sequence of 4 but the wrong position(assuming the user has more than 4 colours to choose from)... then you'll need an indicator for that too... if you like that idea and the one before, I'll suggest a way to go about it, if you want.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • PBEmpirePBEmpire Member Posts: 676

    @Zhongapps i guess i messed your mind up lol. See this
    http://i1-news.softpedia-static.com/images/news2/Wizzard-Media-Acquires-Rights-for-Super-Mastermind-iPhone-App-2.png
    However in my case you only need to guess 4 not 5 as shown in the picture. And in thr picture, you can see that black is used to indicate that the "pin" or "colour" is placed in the correct position while white is used to indicate that it is the right colour but in the wrong position.

    However in my game, lets say when i place the correct colour in the second column, two pins turn red etc.

    Let me get a video indicating the problem
    @gyroscope‌

  • PBEmpirePBEmpire Member Posts: 676

    Anyone have any ideas? The timer thing didnt work as well. Does anyone want to take a look at the rules?

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    It is difficult to for me or anyone else to help you here because we've nothing to go on really. At least a vid. would help but ideally the rules would be v.helpful to see what's going on...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • PBEmpirePBEmpire Member Posts: 676

    @gyroscope‌ Here is the video

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Thanks for the vid, @PBEmpire‌

    I really like that ambient backing track! Did you compose it? If not, could you tell me who it is please?

    Right, to your game - there are a few approaches to this type of game as I'm sure you're aware... give me half an hour or so and I'll knock up a game file test for you but please be aware it might be a totally different approach from the one you're using at the moment.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • PBEmpirePBEmpire Member Posts: 676

    @gyroscope‌
    Thanks for your help!
    As for the soundtrack it is youtube's default soundtrack. You can find it when you upload videos to youtube.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    You're welcome & thanks re: soundtrack - didn't know that!

    I don't know why I thought the test file would only take half an hour... (should know better than that!) I've made a good start though but I'm now going out for a couple of hours.

    So I'll finish it when I get back... hope you're OK with the delay...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • PBEmpirePBEmpire Member Posts: 676

    @gyroscope‌ of course I am fine with that! Ya it's some complex logic there i guess. Anyway it's night here so not like it would have made a difference. Thanks again

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi again, here's my test file for you to check out for a Mastermind type game.

    You'll more than likely find that I've taken a different approach than you but hopefully it'll be useful for you to either amend your existing file or even start again with this one...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • PBEmpirePBEmpire Member Posts: 676

    @gyroscope Thats exactly what i have been looking for! Thanks!

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Glad it helped. :smile:

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.