i have a class enemyboss and sending it to different class called levelObject.
main.java
EnemyBoss enemyObject;
...
//game loop - actionperformed
levelObject.nextLevel(enemyObject);
...
//paint method
if(enemyObject!=null){
enemyObject.paint(g);
}
in level.java class i am createding enemyobject class.
level.java
...
enemyObject = new EnemyBoss(50, 20);
...
the problem is nothing prints on screen. its bc enemyObject is null in main method, even though i am createing in level.java. any idea how can i fix this? i want set enemyboss class in main and create in level class.