drawing and moving blocks for games in javascript browser