Hi,
I'm new to the field and I have a problem that I want to pass an int/boolean value from a World subclass to an Actor subclass and vice versa. Can someone write me an example for both cases?
Thanks!
public void act(){ if(Greenfoot.isKeyDown("1")) { mschwierigkeit = 1; mherzen= 20; mlevel= 1; } if(Greenfoot.isKeyDown("2")) { mschwierigkeit = 2; mherzen= 15; mlevel= 2; } if(Greenfoot.isKeyDown("3")) { mschwierigkeit = 20; mherzen= 10; mlevel= 3; } }
int schwierigkeit = mschwierigkeit.Bloodstream int herzen = mherzen.Bloodstream int level = mlevel.Bloodstream
int schwierigkeit = mschwierigkeit.Bloodstream int herzen = mherzen.Bloodstream int level = mlevel.Bloodstream