How to stop actor from moving towards the touched position

Hi,

Im working on a game where the main actor moves to the position where I touch on the screen. Its working good.
On screen, I have a button where when it is pressed, it will spawn a bomb actor behind the main actor's current position. That is also workiing as intended. But everytime I press the button, the main actor move towards the touch on screen where in my case it moves to the position of the button. How can I disable or stop the actor from moving towards the button?

Thanks in advance

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2013
    ...
  • ganeshjiwa51ganeshjiwa51 Member Posts: 12
    Sorry if my question was not clear enough. Im new to forums.
    Let me explain the scenerio.

    I have an actor called Hero who moves to the position where the screen is touched. and I have another actor which works as a button and its called ThrowBomb. ThrowBomb's function is to spawn a bomb at the current position of the actor. ThrowBomb button is placed at the bottom left corner of the screen. so I want to the Hero to be able to throw bombs while moving if the ThrowBomb button is pressed.

    Example if Hero is moving from position A to B, and if the ThrowBomb button is pressed, the Hero should throw a bomb while moving towards B.

    at the moment, im able to get the Hero to throw bomb at the current position the Hero is. but everytime I press the ThrowBomb button, the Hero moves towards the ThrowBomb button. my problem is, I dont want the Hero to move towards the ThrowBomb button and just continue to position B.

    Thanks.
  • harrywatsonharrywatson Member Posts: 61
    Hey!

    Make the bomb 'false' when 'hero' = touch is released and
    'bomb' 'true' when touch is pressed. ??

    Other than that you can make an attribute or several attributes.

    I'm new at gamesalad but I'm finding you need to make rules for
    an actor NOT to do things. So..

    If you want an actor to do something.. make rules-attributes-values...
    so that it cannot help but do the actions you want and only those actions.

    If harry goes to the supermarket = he does not go to the pub
    = he does not go to work = he does not go swimming = he does not
    watch a movie. Harry gets to the the supermarket THEN.

    harry.home=true he does not go to the pub
    = he does not go to work = he does not go swimming = he does not
    watch a movie he does not go to the supermarket.
    harry.home = true constrain change attribute / XY etc. harry.home=true

    no supermarket, no pub, no swimming, no work, no movie, harry.home=true.


    That might not be useful but good luck keep working.

    H






  • ganeshjiwa51ganeshjiwa51 Member Posts: 12
    Thanks harrywatson.

    I have managed to fix it. thanks again
  • harrywatsonharrywatson Member Posts: 61
    You're welcome, well done.
Sign In or Register to comment.