Getting started, got a bug, completely stuck!

swalkerswalker Member Posts: 29
edited May 2012 in Working with GS (Mac)
Hey, so i'm just getting started and am working through the Miguel DeQuadros book (really excellent book I must add). The problem is, I am stuck on something - I have set the left keyboard key to make the actor go left and the right key to make it go right, but BOTH keys make it go left and the right keyboard key just isn't working. Most frustrating! Can anyone help? I have worked through the exercise twice to make sure and I have followed it by the book, I just can't seem to figure this one out.

The keys definitely work on my machine and I am sure there isn't a bug in the software.

Thanks..

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    Accepted Answer
    Looking at the screenshot shows that your move behavior on the "move right" rule is set to move to the left. You need to change the setting "direction" to the opposite side of the radius for it to go right. So the key stroke is activating fine, it's just going left right now.
    haha I didnt even notice it I thought he meant both keys as in when both are pressed at the same time.

    Yep change the direction in the move behavior in your right rule to 0 and your good to go.

Answers

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Whats happening is when you press both keys, both move rules are fighting with each other for control. So do you not want the actor to move when you press both at the same time?

    If so have your move right rule when key right is down AND key left is up

    and your move left rule when key left is down AND key right is up
  • swalkerswalker Member Posts: 29
    cheers for this, i have tried variations around these, but the actor just won't move right. i have tried in two different rules or one. I have tried changing it from up and down as well, though in the book it says to leave both on down (as in actor receives event key right keyboard is down)

    here is a screen if this helps: http://postimage.org/image/oeh63pwa5/full/
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You see the plus sign at the top of the rules? Thats how you add more conditions to the same rule. So hit that on both rules. On the move right rule have the extra condition be when key left is up, and on the move left rule have the extra condition be when key right is up
  • natzuurnatzuur Member Posts: 304
    Looking at the screenshot shows that your move behavior on the "move right" rule is set to move to the left. You need to change the setting "direction" to the opposite side of the radius for it to go right. So the key stroke is activating fine, it's just going left right now.
  • swalkerswalker Member Posts: 29
    Yes@!*$£ haha...it works! :-)

    So, Natzuur and John - you were correct the direction for the right rule had to be set to zero and now it works fine. I should inform the author as he misses this in his book.
Sign In or Register to comment.