After trying keang's method you could try this if you find it easier.
Code:Public class t1 implements Runnable() { Int curentTime = 0; Random rand1 = new Random(); Int time1 = 1+rand1.nextInt(100);//the upper limit of time time1 = time1*1000; // we want to use seconds not milis Public void Run(){ while(curentTime>100000) { //put code to check if time1 == curentTime.. This can also be applied to other timers // put code to draw circles if needed Thread.sleep(1000); CurentTime+= 1000; } } }
But if i were you i'd use keangs way since mine looks a little too complicated![]()




Reply With Quote