Random Achievement system

How would I create an achievement system so when I kill an X amount of random enemies in a random X amount of time.

Hi @Gyrosis ,

Welcome to the forum! :wink:

What code do you have so far? Have you thought about some solutions or have ideas on how to solve this problem?

Do you already have a player that can kill enemies and an achievement system?

I don’t fully understand, but you could do something like:

int till = millis() + random(30,60)*1000; //random time in millisecond, which is between 30 and 60 secodns away
int neededScore = random( (till-millis()) * 0.1, (till-millis()) * 0.2);
//you have to kill between 1 and 2 enemies every 10 seconds untill time runs out.
boolean chechDone(int till, int neededScore, int score) {
   returned(score>=neededScore && millis()<till);
}