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

2013/2/12

How to make an Image rotate

xxhero24xx xxhero24xx

2013/2/12

#
Hi, I am wondering how to make an image rotate without having to put multiple lines of code in. Is there anyway to do that?
danpost danpost

2013/2/12

#
There is a method in the GreenfootImage class that will rotate the image.
xxhero24xx xxhero24xx

2013/2/13

#
what is that method? I'm sorry I don't know greenfoot that well
danpost danpost

2013/2/13

#
Select the 'on-line' option in the 'Reference' section on the 'Documentation' page (link above). Then select the 'GreenfootImage' class API.
xxhero24xx xxhero24xx

2013/2/13

#
I have 2 of images and want to switch to one when I press the Up arrow key and switch to another when I press the Down arrow key. Is there anyway to code for that?
danpost danpost

2013/2/13

#
To change the image, use the 'setImage' method in the Actor class. To detect the keystrokes, use one of the methods in the 'Greenfoot' class. Use appropriate conditions (in an 'if' statement) in the 'act' method, or a method it calls, to determine if image needs changed or not.
You need to login to post a reply.