Problem with 2 key pressed.

desaferreira.paolo@free.frdesaferreira.paolo@free.fr Member Posts: 0
edited October 2012 in Working with GS (PC)
Hello,

I just started a 2D game, it's a platform shooter like Super Probotector on snes or Toki on Mame Arcade !

i added an actor called "player"
i added some attributes, "no_input" , "input_right" , "input_left" , "input_right_down" , "input_right_up" , "input_left_down" , "input_left_up" , "input_down" , "input_up" for have a total control for each direction with differents attributes.

i started to add rules in a group with all attributes.

this is my logic :

1) If there no input detected and the bolean attribut "no_input" is set to true, play idle animation and stop move.
2) If values "Input_left" and "input_right" are set together to "true" set idle animation and stop to move [that is for fix the problem of right and left arrow down together] 1 but that doesn't works and i have trouble, i don't know why [PB1]
3) If right key is down, change bolean attribut "no_input" to "false" and "input_right" to "true". Else bolean attribut "No_input" to true and "Input_right" to "false"
4) If bolean attribut "Input_right" is set to "true" move player to the right with walk animation "MOVE BEHAVIOR NOT ADDED YET"
5) If left key is down, change bolean attribut "no_input" to false and "input_left" to "true". Else bolean attribut "No_input" to "true" and "Input_left" to "false"
6) If bolean attribut "Input_left" is set to "true" move player to the left with walk animation "flipped" "MOVE BEHAVIOR NOT ADDED
7) If right down and down key is down, change bolean attribut "no_input" to "false" and "input_right_down" to true. Else bolean attribut "no_input" to true and "input_right_down" to "false"
8) If bolean attribut "Input_right_downt" is set to "true" move player to the right with walk crouch animation" MOVE BEHAVIOR NOT ADDED [same x speed like walk animation]

So this is my 2 problem :

1) Firstly, when right and left key, i have trouble animation and move bug, i would like :

-right and left arrow down = no action and idle animation
-right arrow (actor move to the right) and during move the player pressed the left direction, so 2 key down but in this order right after left. i would like stop move actor, and change walk animation to idle animation in right direction
-left arrow (actor move to the left) and during move the player pressed the right direction, so 2 key down but in this order left after right. i would like stop move actor and change walk animation to idle animation in left direction.

2) my another and last problem for the moment,

i have a similar problem with Right and down key down, normaly when this 2 keys is down, the actor need to play the walk crouch animation and move to the right direction, but actually the animation walk crouch have trouble with walk animation,

if a person can help me it's will be great.
thank for your answer.



Sign In or Register to comment.