You can search on google “processing smooth character movement” to find more similar posts. The code in this post worked great for me.