Detecting upwards movement Java

+1 Alex Sweps · September 26, 2014
I am creating an android game and so far I have my player moving around and jumping but I want the player to move across the x access only while he is moving upwards. Is there a quick way to check if the player is moving up? Something like if (y == up) else if(y == down)? 


Any help would be appreciated. 




Post a Reply

Replies

Oldest  Newest  Rating
0 Alex Sweps · September 27, 2014
Thanks for the reply. As usual as soon as I ask for some help the solution comes to me...

I made it so it it slowly increments the x position only when the energy loss is greater than the y speed. So basically while the player is moving up in a jump it will also go across the x axis and once the energy loss kicks in and pushes the player down it stops moving across.  
+1 Pere Garau Burguera · September 26, 2014
If you provide us your code so we can see how you did the movement, we may be able to help you and give a more precise solution ;)
  • 1

Java / Android Development

107,246 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator