This is the eror code form terminal idk what i must to do
here the code at HUD Class
here the code at text class code
here the code at Temp Text codes
java.lang.NullPointerException at greenfoot.Actor.<init>(Actor.java:139) at HUD.<init>(HUD.java:9) at Text.<init>(Text.java:9) at TempText.<init>(TempText.java:12) at BridgeStoneForest.<init>(BridgeStoneForest.java:128) at Playbutton.act(Playbutton.java:22) at greenfoot.core.Simulation.actActor(Simulation.java:567) at greenfoot.core.Simulation.runOneLoop(Simulation.java:530) at greenfoot.core.Simulation.runContent(Simulation.java:193) at greenfoot.core.Simulation.run(Simulation.java:183)
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class HUD here. * * @author (your name) * @version (a version number or a date) */ public class HUD extends Actor { /** * Act - do whatever the HUD wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { // Add your action code here. } }
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Text here. * * @author (your name) * @version (a version number or a date) */ public class Text extends HUD { /** * Act - do whatever the Text wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { // Add your action code here. } }
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class TempText here. * * @author (your name) * @version (a version number or a date) */ public class TempText extends Text { private int timer; public TempText(String text, int showActs) { timer = showActs; setImage(new GreenfootImage(text, 28, Color.BLACK, Color.WHITE)); } public void act() { if (--timer == 0) getWorld().removeObject(this); } }