I'm attempting to make a counter that counts to multiples of 5 keypresses, then spawns a box.
it's stored in the world class, and it does not do what it says it's going to do (which is spawn 2 enemies at multiples of 5 keypresses.
when i use the method in the player superclass it gives me an error saying you can't use the methods there. i know that's because you can't reference a world method that A: spawns a new object in a player object, and B:the methods are not defined in the class.
A little help making this work would be amazing Thanks in advance
public void keyspawn()
{
int keycount = 0;
int multy = 1;
if (Greenfoot.isKeyDown("left")|| Greenfoot.isKeyDown("up") || Greenfoot.isKeyDown("right"))
keycount++;
if (keycount == 5*multy)
{spawnfall();
spawnrand();
multy++;}
}

