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

2012/1/5

Greenfoot Mobile App?

5
6
7
8
9
10
11
Upupzealot Upupzealot

2012/11/16

#
@groegeel That would creat a image for every actor, if you get a lot of actors in your world(500 for e.g.) It will cost a lot of memory of your Android device. But use setImage() in every constructor is also a good idea to unity the code
Upupzealot Upupzealot

2012/11/16

#
I'v published a game with source, both for Greenfoot and Greenfoot4Android. You can download it to find out what shoud be done, when you are converting a Greenfoot Scenario to Greenfoot4Android. Here is the Link: http://www.greenfoot.org/scenarios/6658
-nic- -nic-

2012/11/16

#
private void prepare()
    {
        Wheel wheel = new Wheel();
        addObject(wheel, 100, 100);
        Ball ball = new Ball();
        addObject(ball, 100, 100);
        ClassImageManager.setClassImage(ball, ball.png);
    }
ive got this and im trying to set the ball's image to ball.png but im not sure how you would do this?
Upupzealot Upupzealot

2012/11/16

#
Dose those code work? I usually dose those settings in the constructor of my World class. For your code, I think ClassImageManager.setClassImage(ball.class, new GreenfootImage("ball.png")); may be correct.
-nic- -nic-

2012/11/16

#
thank you
groengeel groengeel

2012/11/16

#
Something funny here. In Greenfoot this works fine, mobile however, plane goes straight no matter what I click. Plane class:
    
public void act() 
    {
        if (altitude <= 0) {
                touchdown();
        } else {
            if (health>0) {
                    fly(4);
                Airport world = (Airport)getWorld();
                if (Greenfoot.mouseClicked(world)) {
                    turnTowards(Greenfoot.getMouseInfo().getX(), Greenfoot.getMouseInfo().getY());
                }

                lowerAltitude();
            }
        }
    }
Note that mouseClick on Actors seems to work fine, only on World it has problems. Is this a bug? If yes, can you fix it? If the answer is no, i will lay a transparant canvas over the screen which will tell where a user clicked.
-nic- -nic-

2012/11/16

#
in alot of the main classes where there is a @Override there is a error
groengeel groengeel

2012/11/16

#
-nic- wrote...
in alot of the main classes where there is a @Override there is a error
Use AIDE. I had the same problem.
-nic- -nic-

2012/11/16

#
i cant my phone dosent support 2.2
groengeel groengeel

2012/11/16

#
groengeel wrote...
Something funny here. In Greenfoot this works fine, mobile however, plane goes straight no matter what I click. Plane class:
    
public void act() 
    {
        if (altitude <= 0) {
                touchdown();
        } else {
            if (health>0) {
                    fly(4);
                Airport world = (Airport)getWorld();
                if (Greenfoot.mouseClicked(world)) {
                    turnTowards(Greenfoot.getMouseInfo().getX(), Greenfoot.getMouseInfo().getY());
                }

                lowerAltitude();
            }
        }
    }
Note that mouseClick on Actors seems to work fine, only on World it has problems. Is this a bug? If yes, can you fix it? If the answer is no, i will lay a transparant canvas over the screen which will tell where a user clicked.
The problem doesn't seem to be the world class reacting to Touch events. Adding an overlay got the same problem... Here are the source files. My code is in src/LandThePlane
groengeel groengeel

2012/11/16

#
-nic- wrote...
i cant my phone dosent support 2.2
Open your Android virtual machine and put AIDE on that.
groengeel groengeel

2012/11/16

#
I feel stupid. Forgot to set the image.... Off to thee next errors.
-nic- -nic-

2012/11/16

#
its okay im using my dads tablet
erdelf erdelf

2012/11/16

#
is the method getWorld(); always returning WorldX?
-nic- -nic-

2012/11/16

#
I dident know you had to buy AIDE is there a way of getting rid of the errors
-nic- wrote...
in alot of the main classes where there is a @Override there is a error
There are more replies on the next page.
5
6
7
8
9
10
11