Max move

IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
edited November -1 in Working with GS (Mac)
Hello, I made an actor with rule:

When attribute game.XXXX is true,
Constrain attribute: self.PositionX to: game.Mouse.Position.X

Everything is working fine, but I want this actor to move from 50 to 430 only, so player'd be unable to move this actor outside of screen. Could you please tell me how to do that?

Thank you.

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I don't have gs in front of me, but i think you could put that entire rule inside a master rule that says

    If self.Position > 50 and if self.positionx < 430

    Do this ( put your rule here )

    I think that'll work. You could also put that rule around your constrain attribute, that might be a better move.
  • PhoticsPhotics Member Posts: 4,172
    MarcinMakaj said:
    Hello, I made an actor with rule:

    When attribute game.XXXX is true,
    Constrain attribute: self.PositionX to: game.Mouse.Position.X

    Heh, this makes me disappointed. Did you read my Textbook?! Page 37 explains the Constrain behavior, but it also mentions how the Min and Max functions are related in certain situations. I think this might be one of those situations.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
  • PhoticsPhotics Member Posts: 4,172
    Basseman said:
    I'm going to buy your book now and it better be good ;)

    Ha ha... satisfaction is not guaranteed.
    ...but the feedback has been pretty good so far.

    Also, the ordering page is open for comments. Only CaptainChoco has commented. There's also a chat box on my website.
  • PhoticsPhotics Member Posts: 4,172
    Basseman said:
    Just kidding with you, i'm sure it's well worth every dollar.. Just paid, now i'm waiting....

    I see a new order. I'm assuming it's yours. It takes about 10 minutes for the credit card to clear. You should get an email with download information soon after that.
  • PhoticsPhotics Member Posts: 4,172
    MarcinMakaj said:
    Poland is poor country.

    You're from Poland?! Cześć!

    On the bright side, the Polish Zloty seems to be getting stronger when compared to the US dollar.. That probably hurts you if you're selling apps to the United States, but it's great news for buying American textbooks. HA HA!
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    Photics said:
    You're from Poland?! Cześć!

    :) Cześć. Używasz tylko translatora czy mówisz po polsku? ;)
    For non-polish speakers: Hi. Do you know polish or just using a translator?

    It reminds me arabian countries, where everybody can say: "cześć" and "jak się masz?" :)

    Do you know that I can buy food for about 39.4 years instead buying your book? ;P
  • hrsmediahrsmedia Member Posts: 522
    this prob work=

    if self.position.x < 240
    Constrain attribute self.position.x to max(game.mouse.position.x, 50)
    if self.position.x > 240
    Constrain attribute self.position.x to min(game.mouse.position.x, 430)
  • PhoticsPhotics Member Posts: 4,172
    MarcinMakaj said:
    Do you know polish or just using a translator?
    I do know some very basic Polish, but I used a translator to get those special accents. HA!

    I usually say "Co słychać" instead of "Jak się masz"

    Commove supports three languages. Polish is one of them.
    MarcinMakaj said:
    Do you know that I can buy food for about 39.4 years instead buying your book? ;P

    Ha ha, that seems unlikely. I am familiar with some food from Poland... mostly soup and Prince Polo chocolate bars.
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    Photics: if you (or anybody) wants to have polish translations from english (or just to check for mistakes) you can let me know :)

    Prince Polo is classic, almost as Grześki :P
Sign In or Register to comment.