How to Make a Puzzle Bubble? :/

RubiyoooRubiyooo Member Posts: 163
edited April 2012 in Working with GS (Mac)
Hi guys how are you?

I am making a bonus stage for my game.
But it´s very difficult to me do a ball than when i shoot these will be destroyed when 3 balls collide.

I try with 2 atributes.
-hits
-numberofball

But the second ball (hits=1) collide with the first ball(hits=1). The second ball collide with the same first ball.
Then ball 1=hits2 <> ball2=hits2

But when to the third ball hits with firt ball or second ball . Never produce a destroy because the ball 1 collided with ball 2 in the second shoot.
And never can to revolved this with the ball actor and their attributes.

Anybody can help me?

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2012
    You need to have a boolean attribute on each ball called self.hit set to false. In the ball actor's rules, do When collide with actor of type/tag ball AND self.hit is false, change attribute game.hits to game.hits+1 and change attribute self.hit to true.

    I'm not sure about the calculation though, because if ball1 hits ball2, game.hits will increase by 2, and then if ball1 hits ball3, game.hits will increase by 1. You'll have to work with that to get it right.

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

  • RubiyoooRubiyooo Member Posts: 163
    edited April 2012
    Nothing i do it too but without boolean attribute to game.hit

    Capture -> http://dl.dropbox.com/u/6352083/Captura de pantalla 2012-04-12 a la(s) 23.26.46.png

    And all balls put "3" when two balls collide -> http://dl.dropbox.com/u/6352083/Captura de pantalla 2012-04-12 a la(s) 23.29.52.png
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Can you zip your game file and send it to me via a dropbox link?

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

  • MotherHooseMotherHoose Member Posts: 2,456
    @Rubiyooo
    what is happening with your rules:
    the first behavior … changes a condition that fires your rules …
    when that condition is changed … the computer stops processing that rule

    try:
    Rule: when
    Event: overlaps/collides with actor of type: ball
    -Rule: when
    --Attribute: self.hit is false
    --changeAttribute: self.hit To: true
    --Otherwise: changeAttribute: self.hits To: self.hits+1

    image MH
  • RubiyoooRubiyooo Member Posts: 163
    @Rubiyooo
    what is happening with your rules:
    the first behavior … changes a condition that fires your rules …
    when that condition is changed … the computer stops processing that rule

    try:
    Rule: when
    Event: overlaps/collides with actor of type: ball
    -Rule: when
    --Attribute: self.hit is false
    --changeAttribute: self.hit To: true
    --Otherwise: changeAttribute: self.hits To: self.hits+1

    image MH
    I do not understand... Do you want to say that?
    http://dl.dropbox.com/u/6352083/Captura de pantalla 2012-04-13 a la(s) 11.02.19.png

    A behaviour in another behaviour WTF!! :O
  • MotherHooseMotherHoose Member Posts: 2,456
    edited April 2012
    yes that is it! … @Rubiyooo

    a rule within another rule … the terminology for this is a 'nested' rule

    you wrote it perfectly! … did you try it out? … did it work?

    image MH
  • RubiyoooRubiyooo Member Posts: 163
    Yes @motherhoose And does not works :(

    p.d my nick is rubiyOOO no rubiyOO ;)
  • MotherHooseMotherHoose Member Posts: 2,456
    edited April 2012
    edited this typo with your name … sorry about that!

    try … turning off other rules … to just test that one

    image MH
  • RubiyoooRubiyooo Member Posts: 163
    edited April 2012

    quick demo: http://www.mediafire.com/?4u5usjfwi7w2z57

    image MH
    Nothing because your demo only count hits an actor. But i need with two or more balls :S

    http://www.youtube.com/embed/dFdipgvMUu0
  • MotherHooseMotherHoose Member Posts: 2,456
    sorry … @Rubiyooo … that demo was a general example of nested Rules

    looking at your video … try on the ballActor

    Rule: when
    Event: overlaps/collides with ball
    -Rule: when
    -Attribute: self.hits = 1
    --changeAttribute self.hits To: 2
    -Rule: when
    -Attribute: self.hits = 2
    --changeAttribute self.hits To: 3

    ==
    to eliminate constant scrolling in the actorPane …
    the actors that work correctly can be moved to the bottom of that pane …
    and the actor you are working with can be dragged to the top …
    quickest way is Home > Actors … and drag them around

    image MH
  • RubiyoooRubiyooo Member Posts: 163
    Nothing doesn´t work u_u
Sign In or Register to comment.