Changing direction

SANDEEP410SANDEEP410 Member Posts: 46
edited May 2012 in Working with GS (Mac)
How to reverse direction of an actor.My enemies move left and when it hits a wall it should revers direction and start moving to right and so on

Best Answers

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    Accepted Answer
    lol
  • tenrdrmertenrdrmer Posts: 9,934
    edited May 2012 Accepted Answer
    Well i'll go ahead an accept an answer for you @SANDEEP410 please learn a bit of etiquette with that reject button. If I remember right you seem to not understand what it really should be used for. Which is completely off and worthless answers. To be honest @tshirtbooths answer at the start should not have been rejected either. it would also work just more complex.
  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    edited May 2012 Accepted Answer
    It was fixed, it just wasnt working because of a entirely different issue and because you didnt know about restitution. Not because his answer was incorrect.

Answers

  • SANDEEP410SANDEEP410 Member Posts: 46
    edited May 2012
    I have many walls, too hassel to make left and right wall.And its not the right way.What if left wall is left for one enemy and right for other enemy.
    Is there anyway to reverse direction of enemy
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    When Overlap collide with wall
    Change self.linearvelocity.x to (-self.linearvelocity.X)
  • SANDEEP410SANDEEP410 Member Posts: 46
    I did as tenrdrmer but now the problem is when enemy collides with wall his image starts wobbling.So if check mark fixed rotation option,then it bounces of the right wall properly but it gets stuck at the left wall
  • SANDEEP410SANDEEP410 Member Posts: 46
    I clicked reject button because my problem wasnt entirely fixed.Isnt it better than makeing new threads for extension of same problem
  • MotherHooseMotherHoose Member Posts: 2,456
    no walls … and no collide rules/behaviors… no constrains

    demo: http://www.mediafire.com/?mdzf7lrgpass08h

    image MH
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Not that this discussion needs to happen here, but I think the "Answered" status of questions leads people to reject answers so that their question can be listed as "Question" and they can generate more possible answers.

    I know I'm more likely to click on a thread that lists "Question" rather than "Answered" even though I know that without a check mark the answer hasn't been Accepted yet. I think we need a new designation... maybe "Replied" instead of "Answered" and then "Answered" with check mark when the original poster accepts an answer.

    @MotherHoose an impressive demo for a simple and useful concept.

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

Sign In or Register to comment.