Movement

Hello there. I´m new at developing games with java, so this may sound a silly question but i think you can give me a hand on this.

I have created a simple game with a 3/4 perspective but the movement is done by using a grid. Every character, artifact, wall, floor, etc is in a cell of a matrix. When the main character moves it moves one square. This works, but i want to make the movements more detailed, if you know what i mean. I want to show a smooth movement of my character and the monsters in the labertynth.

Without knowing what you’re really doing, a simple thing you could do is to find the world (screen?) X,Y coordinates of your character before and after the movement and interpolate between them. That is, if startX = 10 and endX = 20, break it in -for example- five steps and move your character in the X direction (endX-startX)/steps = (20-10)/5 = 2 units in each time tick. The tick should happen periodically in some kind of game update - the more often you call it, the faster your character will move. An easy way to do this without having to worry much about losing “ticks” is to use a TimerTask in a Timer with Timer.schedule(TimerTask task, long delay, long period).