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

Busch2207's Comments

Back to Busch2207's profile

Yeah, I sadly remembered after updating and publishing this code... :/
I think, this problem just occured, because in the list also was the object itself, which was not checked. I changed this in the code.
Well, I used 'getWorld().getObjects()', because getIntersectingObjects() also iterates over all Objects in the World-class, checks whether they intersect and then returns the list. So there's no affect to the running-time. In the 'getOneTouchedObject'-method it could also save some time, if one of the first objects in the list touches it... So the 'intersect'-method don't have to be called on all actors...
Hey! Thank you! I forgot to publish the source code! So here it is!
I want to... But unfortunately, I lost the source code of all of my games, except the 'Adventure'-Game. So I can only update the code of those games, where I added the source Code on this web-page... :/
Well, in the end it is not so complicated. First I check, if the rectangles of the actors collide at all. Then I create an image, wich I rotate like the two original images are rotated. Then I check the overlapping parts of the images for pixels that are colliding.
I would like to continue working on it, because I like this game and I'm very proud of it. I even got the biggest part of the next mission ready. The main problem is, that I don't have so much time any more and my programming style changed extremly and became much more proffessional. So it's a very big mess to get in the code again. Another big problem is, that Greenfootgallery only allows 20mb-games. (Please correct me, if this changed), so each map is expensive... And I also dont have much more room to save some bits...
I'm very sorry, but I don't have the source code of this scenario any more. It was on my old computer... Otherwise there would be no problem.
Well, I'm doing that with a small trick. The images are being created in a separated thread. When the Ram overflows, the Thread throws an error and stops. And then I easily display the messages. ;)