Smooth Tile by tile movement

Im having trouble with “smooth” tile by tile movement. I’ve got the basics down but on the very first one it stops after it reaches its point and continues on smoothly. I was wondering if thats because of the way I check if a key is pressed or if its the movement itself. Both the keyboard class and the player class are down below. I was hoping someone could help me with this issue. Thank you :).


package net.gasquake.game.input;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class Keyboard implements KeyListener {

	public int keyDown, keyUp;
	
	public boolean keyDown(int k) {
		if (k != this.keyDown) {
	      return false;
	    }
	    this.keyDown = 0;
	    return true;
	}
	
	public boolean keyUp(int k) {
		if (k != this.keyUp) {
	      return false;
	    }
	    this.keyUp = 0;
	    return true;
	}
	
	public void keyPressed(KeyEvent e) {
		this.keyDown = e.getKeyCode();
	}
	  
	public void keyReleased(KeyEvent e) {
		this.keyUp = e.getKeyCode();
	}
	  
	public void keyTyped(KeyEvent e) {}
	
}


package net.gasquake.game.entities;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import net.gasquake.game.Zaffre;
import net.gasquake.game.entities.core.Entity;

public class Player extends Entity {

	private boolean lockedMovement = false;
	private int oldX, oldY;
	
	public Player(int x, int y, Zaffre zaffre) {
		super(x, y, zaffre);
		w = 64; h = 64;
	}
	
	public void update() {
		if (oldX == x || oldY == y) {
			if ((x % 64 == 0 && y % 64 == 0)) {
				lockedMovement = false;
				dx = 0; dy = 0;
			}
		}
		if (this.oldX != this.x) {
			this.oldX = this.x;
		}
		if (this.oldY != this.y) {
			this.oldY = this.y;
		}
		if (!lockedMovement) {
			if (zaffre.getKeyboard().keyDown(KeyEvent.VK_LEFT)) {
				dx = -4;
				lockedMovement = true;
			}
			if (zaffre.getKeyboard().keyDown(KeyEvent.VK_RIGHT)) {
				dx = 4;
				lockedMovement = true;
			}
			if (zaffre.getKeyboard().keyDown(KeyEvent.VK_UP)) {
				dy = -4;
				lockedMovement = true;
			}
			if (zaffre.getKeyboard().keyDown(KeyEvent.VK_DOWN)) {
				dy = 4;
				lockedMovement = true;
			}
			if (zaffre.getKeyboard().keyUp(KeyEvent.VK_LEFT)) {
				dx = 0;
			}
			if (zaffre.getKeyboard().keyUp(KeyEvent.VK_RIGHT)) {
				dx = 0;
			}
			if (zaffre.getKeyboard().keyUp(KeyEvent.VK_UP)) {
				dy = 0;
			}
			if (zaffre.getKeyboard().keyUp(KeyEvent.VK_DOWN)) {
				dy = 0;
			}
		}
		move(dx, dy);
	}
	
	public void render(Graphics g) {
		g.setColor(Color.white);
		g.fillRect(x, y, w, h);
	}

}

Can anyone tell me how to remedy this problem? Thanks btw I hope I made this thread correctly. Im new.