Written in my Paddle class:
The ability to speed up the Paddle's speed is working, but the timer for how long I can use it doesn't. Currently, when the Paddle touchs the PowerUp2 actor, the Paddle's movement is faster but it doesn't go back to the normal speed.
Please help me with the time thingy, and thank you!
private int speed = 8; private int p2time = 10; //field for how long this powerup can be use for private int speed = 8; public void act() { checkPUp2(); } public void checkPUp2() { if(isTouching(PowerUp2.class)) { //Increase paddle's speed Greenfoot.playSound("PowerUp Sound.wav"); removeTouching(PowerUp2.class); p2time--; if (p2time > 0) { speed = speed +10; } else if (p2time == 0) { speed = speed; } p2time = 10; } }