warhammerdude20
08-06-2004, 03:48 AM
hey,
i have been making very simple games for java for awhile now but i have come across yet another problem.
all the games i made just had about 3 or 4 objects that needed collision detection... so i just put it in the while loop in the run() method of the applet.
well that worked out fine but as i am getting more in to a more advanced game it is starting to get messy(and slower). i intend to have alot of collisions in this game. then i look at a game like mario 64 and think that they couldnt have checked for collisions in every step. so i figured there is some way to write a listener(like a mouse listener or a key listener) that could wait for some variables to equal something then trigger the action.
i have searched far and wide(on the web..) for how to do this but i have found nothing.
is the only way to detect collisions in an infinite loop or is there another way?
thx :cool: :thumbsup:
i have been making very simple games for java for awhile now but i have come across yet another problem.
all the games i made just had about 3 or 4 objects that needed collision detection... so i just put it in the while loop in the run() method of the applet.
well that worked out fine but as i am getting more in to a more advanced game it is starting to get messy(and slower). i intend to have alot of collisions in this game. then i look at a game like mario 64 and think that they couldnt have checked for collisions in every step. so i figured there is some way to write a listener(like a mouse listener or a key listener) that could wait for some variables to equal something then trigger the action.
i have searched far and wide(on the web..) for how to do this but i have found nothing.
is the only way to detect collisions in an infinite loop or is there another way?
thx :cool: :thumbsup: