This site requires JavaScript, please enable it in your browser!
Greenfoot back

Discussions

You need to login to take part
Rss

Current Discussions

youngdisciple07

Stuck in: "The world is being constructed"

By youngdisciple07, with no replies.
Hey, I have been stuck with a screen saying that the world is being constructed... I tried closing the program and reopening it and restarting my pc but to no avail... Here is my Background class: <Code Omitted> here is my counter class: <Code Omitted> here is my RecruitSkellyButton: import lang.stride.*; import java.util.*; import greenfoot.*; /** * */ public class RecruitSkellyButton extends Buttons { GreenfootImage button = new GreenfootImage("RecruitSkellyButton1.png"); GreenfootImage buttonHighlighted = new GreenfootImage("RecruitSkellyButton1Highlighted.png"); GreenfootImage buttonGrayed = new GreenfootImage("RecruitSkellyButton1BlackandWhite.png"); private Counter counter; public RecruitSkellyButton(Counter counter){ this.counter = counter; button.scale(150,109); buttonHighlighted.scale(150,109); buttonGrayed.scale(150,109); setImage(button); } /** * Act - do whatever the Option1_Button wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment. PLACEHOLDER FOR RECRUIT SKELLY BUTTON */ public void act() { Background world = (Background) getWorld(); Counter counter = world.getCounter(); if (counter.getValue() < 5) { //check if the counter has enough gold setImage(buttonGrayed); } else if (counter.getValue() >= 5) { RecruitSkelly skelly1 = new RecruitSkelly(); setImage(button); if (Greenfoot.mouseMoved(this)) { setImage(buttonHighlighted); } if (Greenfoot.mouseClicked(this)) { Arrow arrow1 = new Arrow(); getWorld().addObject(arrow1, 163, 277); Arrow arrow2 = new Arrow(); getWorld().addObject(arrow2, 163, 125); } } } } Note: I get greeted with this terminal message whenever I open greenfoot: 2024-11-18 20:55:35.543 java +: chose IMKClient_Legacy 2024-11-18 20:55:35.544 java +: chose IMKInputSession_LegacyException in thread "AWT-EventQueue-0" java.lang.NegativeArraySizeException: -4 Any help would be appreciated!!
1
2
3
4