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
5
6
7
-nic- -nic-

2012/11/18

#
Thats really good!!
erdelf erdelf

2012/11/18

#
is java.awt.Font importable?
groengeel groengeel

2012/11/18

#
erdelf wrote...
my code for mouse locations doesn't work for me. Maybe one of you could help me. The following is in the act method, but the player object keeps going up:
                MouseInfo mouse = Greenfoot.getMouseInfo();  
                if(mouse!=null)
                {  
                    if (Greenfoot.mouseClicked(null)) {
                        mouseY = Greenfoot.getMouseInfo().getY();
                        mouseX = Greenfoot.getMouseInfo().getX();
                    } 
                    if(getY() > 109)
                    {
                        if(mouseY < getY())
                        {
                            setLocation(getX(), getY() - 5);
                        }
                    }
                    if(getY() < 554)
                    {
                        if(mouseY > getY())
                        {
                            setLocation(getX(), getY() + 5);
                        }
                    }
                }
            
KeyPressed worked better in my case. Try that.
Upupzealot Upupzealot

2012/11/18

#
java.awt.Font is now greenfoot.Font, I'v said that.
erdelf erdelf

2012/11/18

#
sorry Upupzealot, I didnt remember. @groengeel, I want coordinates.
erdelf erdelf

2012/11/18

#
@upupzealot, if you still have my code, could you look over the bar class. I dont get it, why it doesnt appear on the screen.
Upupzealot Upupzealot

2012/11/18

#
Send it again, your old code has tons of spell mistakes with the pics.
erdelf erdelf

2012/11/18

#
is send. I made a testworld just with the bar.
groengeel groengeel

2012/11/18

#
Oh, yeah. Try this: Create a new Actor (mine is called touchOverlay), make it transparant and make it fill the screen. Also make sure it is always on top (using drawOrder method). Then. Do something similar to this:
touch = (TouchOverlay)getWorld().getObjects(TouchOverlay.class).get(0);
if (Greenfoot.mouseClicked(touch)) {
        turnTowards(Greenfoot.getMouseInfo().getX(), Greenfoot.getMouseInfo().getY());
}
I use it to let the user control the plane. Or was the world mouseclick bug already fixed?
groengeel groengeel

2012/11/18

#
What happens to the log? What does it log and most importantly: where? Game still crashes after few moments of nothing happening.
erdelf erdelf

2012/11/18

#
is there a way to get the coordinates of the mouse in the keyboard mod input?
groengeel groengeel

2012/11/18

#
Ok: found the problem: If the memory is full (too many actors), the app dies. Please generate an error/warning message for this.
groengeel groengeel

2012/11/18

#
Ok, all. Game nearly finished. Please test it for me, its on my server: APK file Debug is still on, so you can report your errors. Code will be shared tomorrow, since my code is still under review@school.
erdelf erdelf

2012/11/18

#
nice one.
erdelf erdelf

2012/11/18

#
something new with the bar class?
There are more replies on the next page.
1
2
3
4
5
6
7