So I am making a platformer and the complexity of it is pretty absurd right now, what I mean by it, the main character has about 20 animations, each with 20+ frames and whatnot. I am trying to do some stunning pixel art, and so far I am quite happy everything is a smooth as you'd expect in a professionally done game. I have achieved this with the use of 120+ events just for the main character, and I have done my best to keep the the events as clean as possible, with a few nasty exceptions I felt I had to do because I could not see any solution, but I feel that after having gone through all that (and learned new things on the way), I am confident I can make it ever simpler.
I would like to start from scratch to see if I can make the events structure even smoother and avoid the massive headaches I encounter whenever a bug arises.
First of all I want to ask if the use of variables for input controls is the best way of doing this, so I write a list of events which determines each control state (up:0, Up:1, Left:0 Left:1 and so on), then I map each individual keyboard or joypad button to those variable events, that way I can control the movement and character interaction events using only variables instead of "key pressing" functions. I am asking if this is the best way because I have noticed that variables sometimes seems to react a little slower than direct input controls, I remember finding an issue which was caused by a variable not switching fast enough, then when I I changed it to a direct keyboard control the issue was gone.
I am also asking this because I am not sure how would I simulate "on press" with variables, I mean "is down" is pretty simple, the variable is either 0 or 1, but how do you register through variable "the moment they variable is switching to 1 from 0"?
I think this is all, thanks in advance and sorry about the long wall of text!