No key pressed

Fafnir312Fafnir312 Member Posts: 161
edited November -1 in Working with GS (Mac)
I don't see a way to check if no key is pressed. Is there a way to set up a rule: "if no key is pressed then whatever"?
If I use "if key x is up then whatever" then key x has to be pressed first before registering as being up. I can work around it but this would be a useful feature (unless I'm just not seeing it).

Comments

  • harrioharrio Member Posts: 234
    what's cookin,

    what exactly are you trying to do/setup? someone may figure it out if you explain the purpose.

    noodles...
  • Fafnir312Fafnir312 Member Posts: 161
    Well, I was really excited about the finite state machine I built for player states and animations, but I was gone for several days and now that I'm looking at it again I'm afraid I'm going to have to completely redo it because I'm beginning to run into problems with it. As part of this FSM I had an idle state for the player when the player is barely moving, on the ground, and the direction keys are up. This works but only if all keys are pressed at least once. After that they register as being up.

    I think I'm just going to have to flowchart the whole thing and figure out exactly how I'm going to do this. If anyone has good ideas on creating/mapping out a FSM I'm all ears... er... eyes.

    On a plus note, my player character just killed her first bad guy! Yay! :P
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You can put in your rules:

    Rule: If key ??? is down
    --Change Attribute: game.aKeyIsDown = true
    Otherwise:
    --Change Attribute: game.aKeyIsDown = false
Sign In or Register to comment.