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

2017/4/22

How I make the hitting box smaller?

Timon Timon

2017/4/22

#
Actor object = getOneIntersectingObject(Objects.class);
        if (object != null)
        {
            int yDir = (int)Math.signum(ySpeed);
            setLocation(getX(), object.getY()-yDir*((object.getImage().getHeight()+getImage().getHeight())/2+1));
            ySpeed = 0;
            if (yDir > 0) onGround = true;
        }
danpost danpost

2017/4/22

#
This may be a "how to remove excess transparency from image of an actor" issue. Make a copy of image and then use my Image Transparency Adder/Trimmer scenario to remove excess trannparency from image. Just load the image and immediately save it. All excess is automatically removed.
Timon Timon

2017/4/22

#
I can't open it he says error.
danpost danpost

2017/4/22

#
Timon wrote...
I can't open it he says error.
It is downloadable. Click on the big green "Open in Greenfoot" button and save it on your system. Then you can open the file with your greenfoot application and use it there. You can even "Share" it to make an application file out of it (select the tab) so that you can use it without opening greenfoot first.
Timon Timon

2017/4/22

#
I hade open it but now he says that the World class can't be complitet, because some Scenarios have Errors.
danpost danpost

2017/4/22

#
Timon wrote...
I hade open it but now he says that the World class can't be complitet, because some Scenarios have Errors.
Ah. If you are using a newer version of greenfoot (any that has the greenfoot.Color and greenfoot.Font classes), then that scenario will not work. Maybe sometime soon I can re-upload it with an application already included in the folder.
Timon Timon

2017/4/22

#
I correct all Errors what must I do now to make the hitting box smaller?
Timon Timon

2017/4/22

#
Thanks I have done it.
You need to login to post a reply.