Implementation of tetris game in java