Created
September 27, 2018 08:37
-
-
Save bastienapp/2265a1adf9c127a3c3d9c8744b6c1957 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MainActivity { | |
| private int compteur = 5; | |
| public void onCreate() { | |
| Button event = findViewById(R.id.eventButton); | |
| event.setOnClickListener(new View.OnClickListener() { | |
| @Override | |
| public void onClick(View view) { | |
| // récupérer le nombre de point restant | |
| if (isDead(compteur)) { | |
| // Intent | |
| } | |
| } | |
| } | |
| } | |
| public boolean isDead() { | |
| compteur--; | |
| if (compteur < 0) { | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment