Click quickly on the “left” and “right” arrow keys of the keyboard to build up strength and then press the “space” bar to release the hammer. The stronger you hit, the more points you get…
Source
http://www.thomasandfriends.com/usa/Thomas.mvc/Games (via Wayback Machine)