By the way, if you want your text to have the same design as the buttons, you can use the Text class. For example:
addObject(new Text("\nAlex His APCSA Project", 40), 400, 150);
would replace your title drawing in the constructor. Text is in rccookie.greenfoot.ui.basic;
Say you want to switch between worlds with a button. Then all you need is something like this in the constructor:
addObject(new TextButton(„Switch world“).addClickAction(m -> Greenfoot.setWorld(new SecondWorld())), 300, 350);
This will initialize and set a new world named SecondWorld
No, this is based on java packaging. This is basically like a folder system. Therefore, copy the whole „rccookie“ folder into your project, so that the structure is like
YourScenarioFolder
|-images
|-rccookie
|-MyWorld.java
|-MyWorld.class
|-project.greenfoot
|-More of your classes
Then you can import a class from the package like this:
// At the very top of the file just like the greenfoot import
import rccookie.ui.basic.Button;
This way you import the Button class. You can also write
import rccookie.ui.basic.*;
import rccookie.zu.advanced.*;
import rccookie.ui.util.*;
To import absolutely everything about the ui.
Actually the import greenfoot.*; statement works exactly the same, only that is does not reference a folder in your scenario‘s folder.
You can also take a look into the MyWorld source code in my demo to see how I did this.
The algorithm stores your score to the server only once when the game ends. This is done mainly due to performance:
You can’t use multiple threads on the website conversion (to store the score simultaneously while running the game) and I once tried to sync online multiplayer using the userinfo class and that just lagged like crazy because the storing just takes too long.
In terms of what happens if you refresh the side, if you didn’t finish it ain’t save your score. If you manage to reset the page during the storing phase, I suppose it will first finish storing the score and then reset, but I don’t exactly know
2021/1/15
Login System/ Windows Emulator
2021/1/13
The endless room
2020/12/15
aMAZE
2020/12/10
Project: UI
2020/12/9
Project: UI
2020/12/9
Project: UI
2020/12/9
Project: UI
2020/12/9
Project: UI
2020/12/2
Highscore speedrun competition