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

Super_Hippo's Comments

Back to Super_Hippo's profile

When do you get the exception?
I think the problem is that the calculated route is not something which can be pre-calculated because the target is unknown before it was chosen and the unit should instantly move after the target was chosen. And since this doesn't even work with one unit, what would happen if there are a lot more trying to move around? I guess either Java is not efficient, my code is not optimal or my computer is too slow.
Increasing the simulation speed won't change anything about the lag. The calculation of one act cycle is always at maximal speed. When it is not at speed = 100, it has a defined delay between the beginnings of the act cycles though. So if I increase the speed, the operations can't be executed faster. I am in fact not understanding what this code is doing. What I am doing is that whenever a new target for a unit is chosen (like moving a unit or unit automatically walks back to nearest town center / storage pit after collecting 10 wood from a tree), it calculates the route once. Then it will walk this route without calculating (unless the route gets blocked by a new building). If it would help, I could post the code used for the route calculation in a new discussion. If I get this right, I can't use this Timer class because the code is not executed once in a while but always when a unit gets a new target.
Added two points to the "Things which work" section. Hope this helps!
It is wanted that for scrolling down, you have to put the mouse to the very bottom so the mouse can click on the buttons on the bottom part which appear if you select something. To select something, simply click (left mouse button) on it (for example a villager). Then a click with the right mouse button chooses the target for the villager (a tree, a building which is not finished yet or simply a free space to move (for every kind of unit). Clicking on a building results in having the unit move into the building (bug)). After selecting a villager, you can also choose a building to build. You can also select more than one unit by drawing a rectangle around them (press and drag the mouse). I will add it to the description how to select and move. Thank you for pointing that out.
Ah ok, I see. maybe you could use X then. Or you would need to check if before and after the x are no letters...
Sometimes, there are duplicate choices: https://i.gyazo.com/429e6edd0abfedd0d45d1d7af316a86e.png
Why is it `x and not x?
Since highscores are in fact working online, you can consider adding one which shows the score for each player. (Or at least the first place which is me now) :P