Problem performing certain tasks based on attribute

codematescodemates Member Posts: 112
edited November -1 in Working with GS (Mac)
I have 2 Actors
Spawner 1 - Randomly drops (starting from top) 4 different actors every 0.3 sec in random positions. This is based on TSB "Spawning Random Actors in Random Locations..." http://www.youtube.com/user/GameSaladCookbook#p/u/33/eViQjJNaBTw
For this I have an attribute called "RandomItem"

Spawner 2 - Attribute "RandomItemToMatch" Randomly display similar items from Spawner 2 and change every 5 seconds. This actor is only displayed in 1 a static location on the screen.

Both "RandomItem" and "RandomItemToMatch" are set to integers of 1-4 matching each items.

Everything is working in terms of Spawner 1 dropping and Spawner 2 displayed and rotating images on the screen.

The concept:
When RandomItem and RandomItemToMatch are the same and it collides with my actor (Toast Kitten's Fruit Ninja SlashParticle), it will explode, display a +1 and plays a correct sound.
When RandomItem and RandomItemToMatch are NOT the same and I press on it, it subtracts to my Lives.

Here's the problem. The concept doesn't always work. When I click on a match it sometimes thinks it's the same and works and sometimes subtracts a life.

Here's the rule I have set on the Item actors:

- Accelerate: Direction 270, Acceleration 100, Relative to Actor
- First Rule:
Actor colides with SlashParticle (Toast Kitten's Fruit Ninja sample) and Attribute game.RandomItem = game.RandomItemToMatch
o Play "correct" sound
o Destroy
o Spawn Explosion (another animated actor)
o Accelerate: Direction 90, Acceleration 100, and Relative to Actor
o Spawn Actor "+1" (basically a text image "+1"

- Second Rule (if not exact match):
Actor colides with SlashParticle (Toast Kitten's Fruit Ninja sample) and Attribute game.RandomItem (NOT=) game.RandomItemToMatch
o Play "incorrect" sound
o Change Attribute game.Lives to game.Lives-1

I think I got the rule concept down (or maybe not) but it doesn't seem to be working consistently.

Thanks for all the help and this great community!
Geoffrey

Comments

  • codematescodemates Member Posts: 112
    Hi,
    Anyone has any idea what I'm talking about or maybe I need to explain further? :)

    Thanks again.
Sign In or Register to comment.