ifiller game logic problem

timer .5
if overlap with other balls
(empty)
otherwise: change size h to h*1.1, change size w to w*1.1

works great and stops expanding when it hits another actor


but if i do
touch is pressed:
timer .5
if overlap with other balls
(empty)
otherwise: change size h to h*1.1, change size w to w*1.1

it keeps expanding forever

whats wrong with my logic??

Comments

  • quique13quique13 Member Posts: 99
    With the first formula you put the expand when its not touching an actor change the otherwise "otherwise: change size h to h*1.1, change size w to w*1.1" to the if overlaps with other balls...

    you are telling it that when it does not overlap or collides with the balls keep expanding

    Thats all i can get out of this..
    hope this helps
  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    thats correct, i want it to stop expanding when it meets another actor...
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's a little hard to tell from the way you wrote the rules where your Otherwise statement is. Can you post a screenshot? To do so, upload the screenshot to a file-sharing service and then post the URL as follows (without the $ symbol):

    <$img src="URL">

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

  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    image
  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    that doesnt work...
    when touch is pressed it keep expanding even when colliding/overlaping with another actor "wall"
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2013
    Hmm... works for me. My guess is that you have some collision issues. Check actor layers and self.moveable. How do you know they are actually colliding? Have you tried Log Debugging Statements to see if the collision is being recognized?

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

  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    figured it out
    actor must be the motion to coliding with anything, with out motion it doesnt recognize the collision/overlap. aka if the ball and the wall are stationary it will not work, even if the ball is set to colide with he wall and it sizes up an d touches or overlaps while both have no movement

    stationary actors should still recognize a collision or overlap with other actors right??
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    At least one actor in a collision must be set to moveable. If both actors have moveable unchecked, the collision won't register.

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

  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    I'm not talking about movable and unmovable.. I know that on movable turns physics off

    The problem is both actors have movable checked, but neither one have movement as in zero velocity x zero velocity y for both actors, it's just expanding and does not register a collision
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2013
    Okay, I get it now. I've never thought about actors' collisions when neither are moving but one or both are changing in size. You may need a workaround. The first thing I thought of (though far from perfect) is to have an invisible actor that moves back and forth within the boundaries of the visible non-moving actor and then to check for collision with the invisible actor.

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Demo:

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    And if you are using circular actors, you could just have the invisible actor rotate in place and it will detect collisions without any "movement."

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

  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    im just gonna have the actor bounce about the screen and then expand while they move, weird to have to work around the collisions of still actors tho
  • DanDaMan123DanDaMan123 Member Posts: 216
    try putting the "if touch is pressed"-rule inside the otherwise part with the change width and height inside that. I think that what you had before didn't work because when you touch it, "touch is pressed" becomes true so it moves on to the timer inside that rule. That timer is executed infinitely so even if the touch is released the computer never has a time to check that because it is stuck in the timer loop
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @DanDaMan123 Can you post a screenshot of your rules? I don't think that's the problem. Take a look at the demo I posted. If you delete the collider actor and change the collision rule to Actor 2, it still doesn't work.

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

  • DanDaMan123DanDaMan123 Member Posts: 216
    oh my mistake I thought the issue was that it kept growing after the finger let go
Sign In or Register to comment.