Created
August 1, 2015 16:29
-
-
Save ABeltramo/5a59d60c7978d96bd1a9 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
| Timer groundTimer = new Timer(); //Istanzio un ground timer | |
| private Runnable runnable = new Runnable(){ | |
| public void run() { | |
| groundTimer.tick(); //Eseguo la tick del timer | |
| } | |
| }; | |
| //Avvio l'esecuzione del runnable ogni secondo | |
| private final int interval = 1000; // 1 Second | |
| private Handler handler = new Handler(); | |
| handler.postAtTime(runnable, System.currentTimeMillis()+interval); | |
| handler.postDelayed(runnable, interval); | |
| //Creo l'engine | |
| Engine eng = new Engine(groundTimer); | |
| //... | |
| //Aggiungo i vari timer aggiuntivi | |
| //... | |
| eng.start(); //Avvio l'esecuzione |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment