How to constrain an actors position to other actors

jack.zainudin@live.comjack.zainudin@live.com Member Posts: 25
edited July 2013 in Working with GS (Mac)
How do I constrain y and x position to another images?

Comments

  • I'm making a sniper app and what to put an actor in the centre of the scope, I also want the actor to stay in the centre of the scope as the scope moves around, How would I do this?
  • -Timo--Timo- Member Posts: 2,313
  • -Timo--Timo- Member Posts: 2,313
    make 2 real attribute and call them x scope and y scope
    and say in the scope
    constrain attribute
    constrain game.x scope to self.positon.X
    constrain attribute
    constrain game.y scope to self.position.Y

    and say in the other actor
    constrain attribute
    constrain self.position.X to game.x scope
    constrain attribute
    constrain self.position.Y to game.y scope

    good luck!
  • -Timo--Timo- Member Posts: 2,313
    make 2 real attribute and call them x scope and y scope
    and say in the scope
    constrain game.x scope to self.positon.X
    constrain game.y scope to self.position.Y

    and say in the other actor
    constrain self.position.X to game.x scope
    constrain self.position.Y to game.y scope

    good luck!
  • jack.zainudin@live.comjack.zainudin@live.com Member Posts: 25
    edited July 2013
    Yes I know I have made many discussions but I need to know how you constrain an actors x and y coordinantes to another characters, also what behaviours do I click on, I need detailed instructions, also I'm using this on Windows.
  • Peter_OlafsonPeter_Olafson Member Posts: 301
    edited July 2013
    You asked this on July 10th and got detailed answers. GS management then asked you not to post messages that just say please help. They also asked you not to post multiple threads on the same topic.

    You asked this question on July 11th and got detailed answers.

    In an earlier post about the basics of GS it was recommended you read the GS cookbook.

    Now, it's the 12th. And you are posting a "Please Help!!" post again. And asking the same question you've had answered twice.

    Perhaps if you'd tell us what you'd like us to say differently this time than the detailed instructions you've been given or a solution other than reading the cookbook and watching tutorials on Youtube, we could help you.
  • Yes, I apoligise for continually posting this, so in detail, I'm making a sniper app and I would like to put an actor in the centre of the scope of the sniper, anyways I was wondering how I would acomplish this, many people tell me that I need to constrain then to self position it to the scopes, but I don't know what I need to click to achieve this.
  • adlaimadlaim Member Posts: 68
    زين الدين

    اطرح سؤالك بالعربي لو سمحت و بحاول أساعدك ..

  • نعم، أنا apoligise لنشر هذا باستمرار، لذلك بالتفصيل، أنا جعل التطبيق قناص وأود أن وضع فاعل في وسط نطاق قناص، على أي حال كنت أتساءل كيف سيكون acomplish هذا، كثير من الناس قل لي أنني بحاجة إلى تحد ثم إلى موقف الذات إلى نطاقات، ولكن أنا لا أعرف ما أنا بحاجة للنقر لتحقيق ذلك.
  • adlaimadlaim Member Posts: 68
    لم افهم شيء ، انت لست عربي ؟
  • I have read the cookbook but I'm still confused
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    Merged the two (or was it more?) discussions.

    Please don't make multiple discussions on the same topic. If you don't understand an answer, ask for clarification in the same thread.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited July 2013
    It sounds like you are at the very beginning of learning GameSalad and the way it is set up. You might be interested in some basic videos on how to make a game with the Windows version of GameSalad Creator. I would suggest you watch the series of videos that Dr. Roberto Joseph (known as @CulturePlay in the forums) created. He used the Windows version of GS creator. Part 1 of his video on how to make the breakout game can be found here:



    I suggest you watch all 11 of the short videos (and actually do the steps) before you ask more questions. You will get a much better response form the community if you can ask specific questions and can demonstrate that you can do basic things (like drag a constrain behavior into the behavior list, or create a game level attribute).
  • I'm making a sniper app and I would like to put an actor in the centre of the scope of the sniper, anyways I was wondering how I would acomplish this, many people tell me that I need to constrain then to self position it to the scopes, but I don't know what I need to click to achieve this.
  • -Timo--Timo- Member Posts: 2,313
    do you know how to make a attribute?
    make 2 real attributes and call them xScope and yScope (or whatever)
    go into the scope and make 2 behaviors called constrain attribute
    1: constrain game.xScope to self.position.x
    2: constrain game.yScope to self.position.y

    go into the other actor (the actor that has to be in the centre op the scope) and also make here 2 behaviors called constrain attribute
    1: constrain self.position.x to game.xScope
    2: constrain self.position.y to game.yScope

    this should work :) good luck! if you need more help you can PM me!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited July 2013
    Merged yet another discussion with the original.

    Please, please, stop making multiple discussions on the same topic.

    If you don't know how to do what @timolarpre1998 instructed, you need to go back and view the basic videos I suggested. They use the windows version of GS Creator and will teach you how to use Creator to do basic things like making attributes and using the constrain behavior. (Did I mention the video series uses the Windows version of GS Creator?)
  • adlaimadlaim Member Posts: 68
    edited July 2013
    =))
Sign In or Register to comment.