excuse me,
im doing atomix game and there is something that i can do as an extra thing which is while the atom moves i see it moving no just disappearing and showing in the next position?
thx :)
ahmed.sofi
0
Newbie Poster
Recommended Answers
Jump to PostKeep a separate thread or timer that updates the state of your objects and calls repaint() on the AWT event queue to refresh them.
This is referred to as a game loop or animation loop.
Jump to PostTake a look at the following post: http://www.daniweb.com/forums/post1146173.html#post1146173
Your movement code can't be running on the event queue because that will block repaints until your code is done. You have to update in one thread and repaint in another.
Jump to PostDid you look at the post that I linked?
All 9 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
ahmed.sofi
0
Newbie Poster
ahmed.sofi
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
ahmed.sofi
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
ahmed.sofi
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.