Fallen at the first fence...

gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
edited November -1 in Working with GS (Mac)
Hi all, glad to be posting for the first time here! Although I joined September last year, I've not really studied GS until now. I think it's terrific, with its hidden power in a seemingly straightforward interface. I've been working through a few introductory examples tonight, and seem to have "fallen at the last fence" though. I don't know if it's something I'm doing wrong (although for the life of me I can't see what that could be) or there's a bug about, don't know...

OK: really straightforward first excercise for me: moving a single graphic up and down with the arrow keys. Created Rule: Actor receives event: key up keyboard, is down. Added behaviour: Accelerate: Direction 90 deg., Acc. 300, Relative to actor. In Otherwise: Constrain Attribute: self.Motion. Linear Velocity.X to 0. Same with Y. Test it, it is fine, moving cleanly upwards.

Option copy the whole lot, set it for Down key, Accelerate Direction 270 deg. Test it and both up and down, the graphic jerks up or down one pixel at a time, really slowly...

Has anyone any idea what's going on please?

""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    gyroscope said:
    Hi all, glad to be posting for the first time here! Although I joined September last year, I've not really studied GS until now. I think it's terrific, with its hidden power in a seemingly straightforward interface. I've been working through a few introductory examples tonight, and seem to have "fallen at the first fence" though. I don't know if it's something I'm doing wrong (although for the life of me I can't see what that could be) or there's a bug about, don't know...

    OK: really straightforward first excercise for me: moving a single graphic up and down with the arrow keys. Created Rule: Actor receives event: key up keyboard, is down. Added behaviour: Accelerate: Direction 90 deg., Acc. 300, Relative to actor. In Otherwise: Constrain Attribute: self.Motion. Linear Velocity.X to 0. Same with Y. Test it, it is fine, moving cleanly upwards.

    Option copy the whole lot, set it for Down key, Accelerate Direction 270 deg. Test it and both up and down, the graphic jerks up or down one pixel at a time, really slowly...

    Has anyone any idea what's going on please?

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • hrsmediahrsmedia Member Posts: 522
    If you want to move an actor up and down probably be better to use move instead of accelerate.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    it's your otherwise logic. You are telling GS that if the up key is down move up OTHERWISE (which means if ANYTHING else, including down arrow, is going on constrain to zero) don't move. You need to get rid of the otherwise and it will work. Currently when you press the down arrow you are telling GS 2 opposite things. The first rule says "hey, the up arrow is not pressed so constrain to 0. The next rule is" saying down arrow is pressed so move down." You are currently telling GS to do two opposite things.

    CLick support at the top of the page and study the wiki. There is a lot of good stuff in it.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi guys, thanks for the replies, appreciated.

    I'll just mention here: I edited my post and it duplicated it rather than amended it; strange...

    HassGames: I had a cursory glance through the behaviours list and must have missed that one; I'll experiment with that.

    scitunes: nicely explained; I understand your logical explanation. I'll check out the wiki.

    I learned the way I did it from a video on the Support page (Create a Game From Scratch Part 1). Maybe I misunderstood, don't know.

    Thank you both again!

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • quantumsheepquantumsheep Member Posts: 8,188
    Glad you got this sorted, and welcome to the forum.

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Thanks, quantumsheep! I guess I'll be haunting this forum with quite a few questions over the coming months, but I'll try my best to solve them on my own first...

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I wasn't trying to lecture you about using the wiki. Feel free to ask away on the forums - it just may be quicker to find it in the wiki than to wait for someone here.

    good luck!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi scitunes, no worries at all, I know you weren't trying to lecture me! I've gone through much more of the Support material this morning, and a lot of stuff has clicked, but inevitably I've collected a few questions to post. Your good self and others have been helpful already, which is appreciated; the GS Forum seems a most helpful and friendly place.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.