Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] jupp, even another problem! :D

This topic is 5231 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

well, this time, I have some problems with the mouse motion listener, my game is *really* slowing down when I move the mouse, it''s strange, because it does not slow down when I press the mouse button or when I control the game by using the keyboard is there any method I forget to use or something? (like to syncronice all the three events or something) becouse all I do now is addlistener and removelistener.. Hans-Petter

Share this post


Link to post
Share on other sites
Advertisement
I''m not sure if you have connected an object to the movement of the mouse, eg. like a space jet or something but the only reason I can think of (not seing your code) is that the program is trying to repaint at the speed that the mouse is moving. You can move the mouse to a specific point much faster that you can get there by pressing the keys.

What are you trying to do?

Share this post


Link to post
Share on other sites
I got it to work now, but it''s strange, it works fine when I save the position in a static variable, and then copy this value to my class:

void mousemove()
xpos = event.x;
}

and then in the game loop:
sprite.xpos = xpos;

-----

why does it slow down when I save the value directly to the class:

void mousemove()
sprite.xpos = event.xpos;
}

---------------


Hans-Petter

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!