Hi I am building a game on Android Studio however I have used a new animation (a sea mine that glows different colours) there is 7 frames in the animation and I have used animations before and I have compared this one to the last one but my game keeps getting trapped in a loop when it reaches said animation. I know this is a processing forum but I was wondering if anyone could help. This is the section of code that is causing me bother. Ill post the whole code if you ask and think that will help.
long mineElapsed = (System.nanoTime()-mineStartTime)/1000000;
if(mineElapsed>2000)
{
System.out.println("making mine");
//first mine always goes down the middle
mine.add(new seamine(BitmapFactory.decodeResource(getResources(),R.drawable.seamine),(int)WIDTH + 10,(int)(rand.nextDouble()*(HEIGHT)), 46,43,7));
//resetTimer
mineStartTime =System.nanoTime();
}
so basically a knew mine should be drawn every 2 seconds. I have used print line to see if it gets in the loop. but instead of every 2 seconds it prints line loads and loads. Interestingly when I remove the animation line of code everything works perfect (except of course the mine animation isn't there)\
Any ideas?