As I have said in my previous questions, I'm still new to Java. I'm developing a tile-based game in Java. The movement is on a grid. I'm at the stage where I'm implementing character movement.
My plan was to use the code which I pasted in this question. However, this didn't work, and I was told I should use SwingWorker.
Being a problem solver, I've been thinking about this over the day, and I had a thought. I could achieve the same effect by doing things a bit differently.
I mentioned that I had a timer that went off every 20 milliseconds, calling a repaint.
My idea was that I could have a method call before the repaint in the event for the timer, which would move all of the people 1 unit nearer to their destination (next square/tile). Would that sort of thing work? Later on in the game, there may be 100 or so people. Would 20ms be enough time to loop through all the people and move them one unit closer to their destination? Is 20ms too short a time? Am I just making no sense at all?
Your opinions / answers / thoughts are welcome :)