Pacman game with grid and custom character

Im making a pac-man game but with my own character(.png of the character’s run cycle), I’m using a grid to make the maze barriers but cant get my sprite’s walk cycle to appear on the grid, is there even a way to use custom sprites? or is there an easier way to make object barriers for the map?

Have you checked the examples that come with Processing?
Examples > Topics > Animation

couldn’t you just swap through all stages of walking in intervals of x milliseconds?