Hey!
As the title would suggest I'm currently trying to acces the variable "short qFlapping" defined in world in an Actor.
I tried using this but all I get is a NullPointerException.
Here's the relevant part of the code found in world:
Here's the relevant code found in the actor:
I also tried this but it also didn't work:
any possible help is highly appreciated!
public short qFlapping = 1;
public short getQFlapping()
{
return this.qFlapping;
} PipePark thisWorld = (PipePark) getWorld();
short qFlapping = thisWorld.getQFlapping();
if(Greenfoot.isKeyDown("Space") && qFlapping == 1)
{
verticalMomentum = 12;
qFlapping = 0;
}
if (!Greenfoot.isKeyDown("Space"))
{
thisWorld.getQFlapping() = 1;
} PipePark thisWorld = (PipePark) getWorld();
if (Greenfoot.isKeyDown("Space") && thisWorld.getQFlapping() == 1)
{
verticalMomentum = 12;
thisWorld.getQFlapping() = 0;
}
if (!Greenfoot.isKeyDown("Space"))
{
thisWorld.getQFlapping() = 1;
}

