This is a short demo about moving a character. The controls are as follows: W or Up = Moves player Up S or Down = Moves player Down A or Left = Moves player Left D or Right = Moves player Right
[READ ME] This demo uses four variables, Up, Down, Left, and Right corresponding with the Up, Down, Left, and Right or W, A, S, and D keys respectively. These variables can be modified to output "True" upon the press of any key desired. For example, one could use the letters U, J, H, and K instead of W, S, A, and D. Upon startup, each variable is set to a state of "False" and the Control sprite tests to see if any of those keys is pressed. If one is pressed, the Control sprite will change the respective variable to "True" for as long as the key is pressed. The Player sprite now detects if any direction variables are True and if so begins to move itself in the corresponding direction until the key is no longer pressed, changing the variable to false, and exiting the event. There is also a "Step" clock included which currently serves no purpose. The variable will add to itself until it reaches 30, upon which it will reset to 0 and count to 30 again. This demo isn't as efficient as it could be. If you find ways to optimize this method, feel free to remix the demo and please inform me of anything you feel could be improved!