[java] jupp, even another problem! :D
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
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?
What are you trying to do?
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement