Help checking for actors

Doing a mastermind-like game here
Currently i have 4 circles lined neatly in a row. There are 10 different colours lined neatly in a column. Currently when i click on one of the colours and then the circle, a new actor, which is the same colour the the colour i have just clicked, spawns on top of the circle. So far so good. But now how do i ensure that only after all four of the circles are filled/ have a colour actor on top of it, i proceed to the next row? In other words how do i check if there is a actor on top of another actor? I tried using tables but i had no idea on how to start,

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited June 2014

    My recommendation would be not to spawn new actors but to change the images of the existing actors (although if you are destroying the original actors in each spot I suppose it doesn't really matter). That way you can use self attributes (or table cell values) to keep track of which actors have been used. One way to do this is to have a boolean attribute self.locked that gets changed to true when the color has been selected for that spot. You can set the touch is pressed rule to also require self.locked to be false. You'll also need to change an integer game attribute game.colorsChosen to game.colorsChosen+1. When that attribute is 4, you've completed a row and you can start the next row and reset the attribute back to 0.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • PBEmpirePBEmpire Member Posts: 676

    @tatiang the thing is the new actors that have spawned completely cover the old actor and the old actor destroys itself after this.

Sign In or Register to comment.