I'm making a 2d fighting game with sprites. All the animation is done and everything.
I used KeyListener for user input but I'd like to replace them with a bot of some kind that randomly chooses to attack in various way until opponent is dead or timer runs out.
The only moves that can be made are attack moves so I need a bot that presses one of those moves randomly.
How do I go about replacing KeyListener with a RNG that loops random attacks until round ends?
In a listener you are waiting for an event to fire, a key is pressed in a KeyListener, so basically your code path there is dead until the event fires. You need to replace that event with a different event, probably a timer as you suggested, which takes an ActionListener.
Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH