So, I'm still a pretty new programmer and I need help getting the drawstring method to draw a string that says a variable from another class. In this case a seal class defines a variable as points(shown below) and I need to bring the variable to the background class and and use it in a string.
Here's what I have so far...
Variable declaration code...
String drawing code...
The only import statements are for color and the default greenfoot one. The creation statement doesn't import any variables(or at least not the points variable).
So, just to sum things up, that's my code and I want it to say "Points: (Whatever the points variable will be equal to)"
Thank you and good luck :)
public static int points;
public void showPoints() { GreenfootImage bg = getBackground(); bg.setColor(Color.BLACK); bg.drawstring("Points: " Seal.points, 78, 37); }