We are creating a space game where random enemies appear and you shoot them but we need to add a loop somewhere does anyone no any easy loop like a time counter or something
// add instance field private int timer; // is act or method it calls timer = (timer+1)% /* max timer value */ ; if (timer == 0) /* execute code */