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

2012/11/17

New Greenfoot4Android discussion

1
2
3
4
groengeel groengeel

2012/11/17

#
Since some users are tired of getting bugged by the alerts from the original topic. I thought I open this one. Please continue the discussion here.
-nic- -nic-

2012/11/17

#
Good idea
groengeel groengeel

2012/11/17

#
Previous topic: Link Might be double, but I experience a bug: In the method getintersectingobjects, it only detects intersections on the corners.
Upupzealot Upupzealot

2012/11/18

#
@groengeel It just won't work in a "cross" situation I think.
erdelf erdelf

2012/11/18

#
@Upupzealot, didnt you wrote that you are sleeping for 10 hours?
groengeel groengeel

2012/11/18

#
        int ax = getX() - getImage().getWidth()/2;
        int ay = getY() - getImage().getHeight()/2;
        List<String> axc = new ArrayList();
        System.out.println("----This:----");
        for(int ix=0; ix<getImage().getWidth(); ix++) {
            int dx = ax+ix;
            for(int iy=0; iy<getImage().getHeight(); iy++) {
                int dy = ay+iy;
                axc.add(dx+","+dy);
                System.out.println(dx+","+dy);
            }
        }
        
        Actor other = (Actor)getWorld().getObjects(cls).get(0);
        int bx = other.getX() - other.getImage().getWidth()/2;
        int by = other.getY() - other.getImage().getHeight()/2;
        List<String> bxc = new ArrayList();
        System.out.println("----Other:----");
        for(int ix=0; ix<other.getImage().getWidth(); ix++) {
            int dx = bx+ix;
            for(int iy=0; iy<other.getImage().getHeight(); iy++) {
                int dy = by+iy;
                bxc.add(dx+","+dy);
                System.out.println(dx+","+dy);
            }
        }        
        
        for(String coordinate : axc) {
            if(bxc.contains(coordinate)) {
                System.out.println("Found matching coordinate: "+coordinate);
                return true;
            }
        }
        
        return false;
My first start...
Upupzealot Upupzealot

2012/11/18

#
I'm still on my bed actually :-) Then how is your work going erdelf?
groengeel groengeel

2012/11/18

#
It 'creates' a cube around it. Upup.., is there a bounding box in the Greenfoot4Android project?
erdelf erdelf

2012/11/18

#
I still dont get the error, I send you a zip package
Upupzealot Upupzealot

2012/11/18

#
@groengeel The difficulty of the intersection detecting is: what if the Actors are having rotations...
groengeel groengeel

2012/11/18

#
Upupzealot wrote...
@groengeel The difficulty of the intersection detecting is: what if the Actors are having rotations...
Exactly, that is what i am now figuring out.
Upupzealot Upupzealot

2012/11/18

#
@erdelf I checked my email twice but get nothing. Again my email is:hzxjhspxn@163.com Maybe you should send it again.
Upupzealot Upupzealot

2012/11/18

#
I think the most important thing to do for Greenfoot4Android is find some way to catch the Exceptions and show them up, like Greenfoot did. So someone like erdelf would get his job more easier. @erdelf file received
erdelf erdelf

2012/11/18

#
good. now I am in bed
groengeel groengeel

2012/11/18

#
me too. Its 2 o'clock here. Tomorrow I will be done. Upupzealot: I just thought of a nice trick with this intersections. Will work it out tomorrow.
There are more replies on the next page.
1
2
3
4