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

2014/6/12

How can I adjust Greenfoot itself?

Upupzealot Upupzealot

2014/6/12

#
Since Greenfoot is a freeware, which means I can get it's source code, and then I can change Greenfoot it self as I wanted. For example, change the coordinate system of Greenfoot from int to float. Noticed that there is a project named Greenfoot3D have been working on a similar way, so I want to ask: Can I begin a work like that? Can I get support from Greenfoot team if I do start a project? @davmac @GreenfootTeam
nccb nccb

2014/6/12

#
Technically, it's not the freeware aspect but the open source aspect that allows you to get Greenfoot's source. There's a link on the download page. You are within your rights to modify the source code to Greenfoot, but we cannot offer any support for doing so.
davmac davmac

2014/6/12

#
As nccb says you are free to modify the source code as long as you follow the relevant license restrictions. We can't promise support, but if you have occasional questions I may be able to answer them. There is also a small amount of documentation in the source bundle. However, the code is complex and you should think hard about whether you really need to do this. If you just want a float/double based co-ordinate system you can build this on top of the existing Greenfoot system, as in for example the SmoothMover class.
Upupzealot Upupzealot

2014/6/12

#
@nccb @davmac Very thanks for replying. What I want to do is: 1.float/double co-ordinate system 2.add a "render" method for Actor class, like act method, it can be override in subclasses, so I can maker cooler visal effects. 3.add a "Parent - Child" node relationship for the Actors.(I'm not sure how to say it in English, but since you are familiar with 2D game programming, I hope you can understand) Since then, if a parent node was moved/rotated, the child nodes would followed that. In the current project, I realize this effect by overriding the setLocation, setRotation method in a subclass. But that makes things complicated. I'v just learned about Greenfoot3D, just wondering, can I work out a similar thing? Exporting the functions above into a jar, and once you replaced it into the Greenfoot software, I can have them in the Actor class.
Upupzealot Upupzealot

2014/6/13

#
Here's a problem: After I settled the BlueJ and Greenfoot projects in Eclipse, when I tried to run BlueJ, the software runs, but I got this warning in console: class Boot: tools.jar not found. Potential problem for execution. I figured out that it was caused by a line in Boot.java(the
1
private URL getToolsURL()
method ) when I tried to run Greenfoot, it crashed after the splash screen. Console told: Greenfoot launch failed due to debug VM terminating.
Upupzealot Upupzealot

2014/6/13

#
The warning still exists, but Greenfoot runs now. It seems I have to add the AppleJavaExtentions.jar to the Java Build Path of the Greenfoot project. PS: I'm on Windows
Upupzealot Upupzealot

2014/6/19

#
Question in the source code: In class Actor method boolean containsPoint(int px, int py) some code is like:
1
2
3
4
5
if (rotation == 0 || rotation == 90 || rotation == 270) {
            // We can just check the bounding rectangle
            return (px >= boundingRect.getX() && px < boundingRect.getRight()
                    && py >= boundingRect.getY() && py < boundingRect.getTop());
        }
is "|| rotation == 180" missing here?
Upupzealot Upupzealot

2014/6/19

#
And what is the full name of "ibsp"?
nccb nccb

2014/6/19

#
Yes, I think we could add rotation == 180 there (it's only a shortcut anyway). I can't remember what the i stands for, but bsp is binary space partition -- a technique also used in 3D games like Doom.
davmac davmac

2014/6/21

#
And what is the full name of "ibsp"?
"Incremental Binary Space Partition". The tree is not re-built from scratch each time an actor moves, but rather adjusted incrementally.
You need to login to post a reply.