No threads. Just a common timer based on nanotime, to keep things sort of in sync. I don't believe that the Greenfoot Gallery would play nicely with threads (everything gets converted to JavaScript before being displayed in HTML 5) so I didn't even consider that.
At it's core there is TreeMap of TreeMaps of ArrayList of GameObject (not as complicated as it sounds - just a way to keep track of objects without having millions of null checks) and a camera algorithm to provide a list of objects near enough to the player to be "drawn." I layer that over a separately managed by similarly timed Tile engine.
The thing that's slowing me down is that this is a behemoth of old code! This wasn't a planned project - it started off as starter code for an almost completely unrelated student project (an image manipulation project, where they manipulate a buffered image using 2d array logic) and so each time I add something, there is a lot of backtracking. Having said that, if you send me a message on the Teacher side of this website, I'll send you a link to the code.
Hi Mr Bradley. This uses System time / delta time.
Presently working on a slick workaround for the lack of a z variable.
Greenfoot can be pretty deep it you want it to be.
Try now, Xiao ... I think it might be better. The ending doesn't work (you can keep clicking) but the shapes (including the blue ovals) should now scroll smoothly. I actually pre-draw an array with every single size I need (80, in the current version) and then just pull images from that array. Saves a ton of processing mid-game (youll notice a delay when you click to start). Almost ready to start building game logic!
I do plan to share this!
I can offer no timeline, but ultimately I try to share everything I create, for the benefit of my students, and educators and students everywhere :)
Thanks Dan,
It turns out that this wasn't the actual problem. I was getting a javascript error that made it seem like setColorAt was getting a null object. It turned out that I was hitting an object limit. Once I simplified some of my classes to maintain a spritesheet rather than a number of arrays of GreenfootImage, it eliminated the problem.
This is the scenario I'm working on, if you're interested: https://www.greenfoot.org/scenarios/25314
2021/1/26
Preview - GreenTreeChronicles
2021/1/21
Preview - GreenTreeChronicles
2021/1/8
Guardians of the Green Tower
2021/1/6
Guardians of the Green Tower
2021/1/5
Testing A Graphic Error
2021/1/2
Testing A Graphic Error
2020/12/25
Preview - GreenTreeChronicles
2020/4/20
I wanna be the Pikachu -- Aang
2020/2/24
TestingColorAt