So I am currently developing an Android game for a school project, and there is no ending to the game, it just goes on forever. I want to make it a time dependent game where if the player survives a certain amount of time, the game ends and says “Congratulations” and shows a dialog box with a button that once pressed, closes out the game. I know about the AlertDialog.Builder class and I saw somewhere that an activity can be closed by a finish() method, so anyone that can elaborate how to implement this in my game class would be very helpful, all efforts so far have just made the game crash.
Share
1 Answer