Use WASD to move to the treasure chest. You can push blocks into the water to create a path. Watch out for slimes, they will move toward you whenever you are standing straight across from them. Don't let them touch you!
In later levels, walk into a fireball to grab it, then click on a slime to shoot at it. You can only shoot straight up and down or to the side, not on diagonals.
Use the on-screen buttons to move into the treasure chest. Push blocks over water to create a new path. Watch out for the slimes, they move toward you whenever you are standing straight across from them!