I am currently working on a game & at this stage I started implementing the Skill Wheel. I want it to appear whenever the 'k' key it toggled and disappear when others are pressed, but for some reason the wheel won't appear in my world.
public class MyWorld extends World { private boolean skillWheel_visible = false; private boolean keysPressed() { if(Greenfoot.isKeyDown("w") || Greenfoot.isKeyDown("a") || Greenfoot.isKeyDown("d")) return true; return false; } public void active_SkillW() { if(Greenfoot.isKeyDown("k")) if(!skillWheel_visible){ addObject(new WeaponWheel(), 300, 300); skillWheel_visible = true;} if(skillWheel_visible && keysPressed()){ removeObjects(getObjects(WeaponWheel.class));skillWheel_visible = false;} } public MyWorld() { super(600, 600, 1); //addObject(new WeaponWheel(), 300, 300); active_SkillW(); } }