I dont know whats wrong with my code, i have made a variable for the speed (called s) and i have an if statement for if
if pickup a speedUp, but it doesnt work. Here is my code:
int s = 4;
if (Greenfoot.isKeyDown("space")) {
move(s);
}
if (Greenfoot.isKeyDown("up")){
turn(-s);
}
if (Greenfoot.isKeyDown("down")) {
turn(s);
}
//ALS DE SPELER speedUP OPPAKT
if (!getIntersectingObjects(speedUp.class).isEmpty()) {
//WHY THIS DOESNT WORK?
s = 8;
}
