How do I fix when pressing "A" key and "Shift" key at same time Idle goings the wrong way

0 favourites
  • 1 posts
From the Asset Store
Random Maze Generator with Door & Key System - tutorial capx
  • As you can see it the tittle of this i am haveing problems with the key if anyone could help me fix my code that would be amazing! here is the file to my game well Im just trying to get left and right to work with shift so

    If D key Pressed do walk but if D key and Shift key Pressed Do run witch is working for D key but not for the A key so what i mean when I click "D key and Space key" reilly fast it moves forwards and does run but then in it does idle "It does it the right way" but when i do "A key and space key" it does the littel run animation and goes left but when it comes to the idle it goes the wrong way it goes the way D key is meant to how do i fix + if you find anymore bugs in my game PLEASE LET ME know

    HEre is the game code

    [Run/Walk Left]

    ----+ Keyboard: ⇧ is down

    --------+ Player: [X] Is Ready2Run

    --------+ Player: [X] Is Running

    ---------> Player: Set Mirrored

    ---------> Player: Set Ready2Run to True

    ---------> Player: Start Timer "Ready2Run" for 0.25 (Once)

    --------+ System: Else

    --------+ Player: Is Ready2Run

    --------+ Player: [X] Is Running

    ---------> Player: Set Mirrored

    ---------> Player: Stop Timer "Ready2Run"

    ---------> Player: Set Running to True

    ----+ Player: On Timer "Ready2Run"

    -----> Player: Set Mirrored

    -----> Player: Set Ready2Run to False

    ----+ Keyboard: On A released

    ----+ Player: Is Ready2Run

    ----+ Player: Is Running

    -----> Player: Set Ready2Run to False

    -----> Player: Set Mirrored

    -----> Player: Set Running to False

    ----+ Player: Is Running

    ----+ System: Trigger once

    -----> Player: Set animation to "Run" (play from beginning)

    -----> Player: Set Not mirrored

    -----> Player: Set Platform maximum speed to 200

    -----> Player: Set Platform vector X to 200

    ----+ Player: [X] Is Running

    ----+ System: Trigger once

    -----> Player: Set animation to "walk" (play from beginning)

    -----> Player: Set Mirrored

    -----> Player: Set Platform maximum speed to 200

    ----+ Player: Platform On moved

    -----> Player: Set animation to "Walk" (play from beginning)

    -----> Player: Set Mirrored

    --------+ Player: Is Running

    ---------> Player: Set animation to "Run" (play from beginning)

    ---------> Player: Set Mirrored

    ----+ Player: Platform On stopped

    -----> Player: Set animation to "Idle" (play from beginning)

    ----+ Keyboard: A is down

    -----> Player: Simulate Platform pressing Left

    -----> Player: Set Mirrored

    [Run/Walk Right]

    ----+ Keyboard: On D pressed

    --------+ Player: [X] Is Ready2Run

    --------+ Player: [X] Is Running

    ---------> Player: Set Ready2Run to True

    ---------> Player: Start Timer "Ready2Run" for 0.25 (Once)

    ---------> Player: Set Not mirrored

    --------+ System: Else

    --------+ Player: Is Ready2Run

    --------+ Player: [X] Is Running

    ---------> Player: Stop Timer "Ready2Run"

    ---------> Player: Set Running to True

    ---------> Player: Set Not mirrored

    ----+ Player: On Timer "Ready2Run"

    -----> Player: Set Ready2Run to False

    -----> Player: Set Not mirrored

    ----+ Keyboard: On D released

    ----+ Player: Is Ready2Run

    ----+ Player: Is Running

    -----> Player: Set Ready2Run to False

    -----> Player: Set Running to False

    -----> Player: Set Not mirrored

    ----+ Player: Is Running

    ----+ System: Trigger once

    -----> Player: Set animation to "Run" (play from beginning)

    -----> Player: Set Platform maximum speed to 330

    -----> Player: Set Platform vector X to 200

    -----> Player: Set Not mirrored

    ----+ Player: [X] Is Running

    ----+ System: Trigger once

    -----> Player: Set animation to "Idle" (play from beginning)

    -----> Player: Set Platform maximum speed to 200

    -----> Player: Set Not mirrored

    ----+ Player: Platform On moved

    -----> Player: Set animation to "Walk" (play from beginning)

    --------+ Player: Is Running

    ---------> Player: Set animation to "Run" (play from beginning)

    ---------> Player: Set Not mirrored

    ----+ [DISABLED] Player: Platform On stopped

    -----> [DISABLED] Player: Set animation to "Idle" (play from beginning)

    -----> [DISABLED] Player: Set Not mirrored

    ----+ Keyboard: D is down

    -----> Player: Simulate Platform pressing Right

    -----> Player: Set Not mirrored

    [Right/Left,Idle]

    ----+ Keyboard: On ⇧ released

    ----+ Keyboard: A is down

    -----> Player: Set animation to "Walk" (play from beginning)

    -----> Player: Set Mirrored

    ----+ Keyboard: On ⇧ released

    ----+ Keyboard: D is down

    -----> Player: Set animation to "Walk" (play from beginning)

    -----> Player: Set Not mirrored

    ----+ Keyboard: ⇧ is down

    ----+ Keyboard: A is down

    -----> Player: Set animation to "Run" (play from beginning)

    -----> Player: Set Mirrored

    ----+ Keyboard: ⇧ is down

    ----+ Keyboard: D is down

    -----> Player: Set animation to "Run" (play from beginning)

    -----> Player: Set Not mirrored

    ----+ Keyboard: On D released

    -----> Player: Set animation to "Idle" (play from beginning)

    -----> Player: Set Not mirrored

    ----+ Keyboard: On A released

    -----> Player: Set animation to "Idle" (play from beginning)

    -----> Player: Set Mirrored

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)