Ashish Posted February 7, 2018 Share Posted February 7, 2018 I am developing a game where my player has to look to see forward when I am pressing right arrow key. But how can I make it look reverse after pressing left arrow? I can create a sprite of reverse look but how can load that while pressing left and at the same time forward player should be destroyed? Link to comment Share on other sites More sharing options...
ismaPC95 Posted March 20, 2018 Share Posted March 20, 2018 You need create a new variable lastDirection. Then how this be execute 60 times per second in the update function, you need save each click and save the last direction. Finally you should compare if the last direction, was left or right and use one animation o another. (Previously created) Link to comment Share on other sites More sharing options...
Recommended Posts