Finish the game logic

I Finish the game logic


Now it just have a little bug.
(but it have not sound on now.)
But I don't have any idea to handle it.