This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Discussions
You need to login to take part
Current Discussions
question about placing objects!
By veyydot, with 2 replies.
Last reply by Super_Hippo, over 11 years ago:
I think his only problem is that ALL pairs are next to each other (because he places them like that). If all cards would be placed randomly and some pairs are next to each other, this wouldn't be a problem.
Rollover button help
By Cytotoxin, with 2 replies.
Last reply by Cytotoxin, over 11 years ago:
Thank you very much danpost, you have helped me greatly.
Counter doesen't increase when item is collected
By SalatgurkenJoe, with 32 replies.
Last reply by danpost, over 11 years ago:
You could remove all the actors from the current world or set a different world active (to get to the same point of having an active world with no actors in it. If you have actors being added by way of your World subclass act method, setting a new World object active would be the way to go. At this point, you can work with the background image of the now current world as needed. The methods you might use are (1) if changing worlds, the Greenfoot class method 'setWorld'; (2) if removing actors, the World object methods 'getObjects' and 'removeObjects' (3) if setting a new background image
Changing Text size
By Leenza, with 3 replies.
Last reply by danpost, over 11 years ago:
Leenza wrote...
Where exactly would I put this code? Would I put it where I currently have < Code Omitted > or somewhere else (sorry I am a beginner)
Yes, it would replace those exact lines.
drawImage and differnt Images in one method
By xWanna, with 14 replies.
Last reply by danpost, over 11 years ago:
xWanna wrote...
Ok, thanks. Do I have to use a specific line, such as . 'Image.setImage(...)' or just 'setImage'?
'setImage' is an Actor class method that assigns an image to an actor instance: <Code Omitted>The actor must be added to the world using the World object method 'addObject' before the image of the actor is visible. If the changes to the world background image are to be permanent, then you can get the background of the world and use the GreenfootImage object method 'drawImage' to draw the image directly
Help - life counter
By Leenza, with 4 replies.
Last reply by Super_Hippo, over 11 years ago:
No, but it is not enough to have a line like 'private static int numLives = 3;'. You need the line I gave you above.
Buttons To Play Again
By drchrisv1, with 7 replies.
Last reply by drchrisv1, over 11 years ago:
@danpost , @Super_Hippo and @Srax , thank you all very much... To be honest I didn't think that I would get any response since there are so many questions posted daily. I am glad that i was proved wrong :) so Thank you
how tu make a picture spin around in circle
By Dudeson, with 7 replies.
Last reply by Super_Hippo, over 11 years ago:
Srax wrote...
in the act method, put "turn(1);" then it will turn around in a circle...
Re-read the first post. That's exactly not what was wanted.
why is 1/2 0.0 ?
By fejfo, with 3 replies.
Last reply by davmac, over 11 years ago:
fejfo wrote...
I thouth u needed to do <Code Omitted> for integer division
Your own result proves that's not the case. If (and only if) both operands are of integer type, the division performed will be an integer division. Your example '(int) num1/num2' will perform integer division
only if
'num2' is of integer type.
how to add object
By greenfoot_user, with 9 replies.
Last reply by Srax, over 11 years ago:
greenfoot_user wrote...
There was some error in my code and I finally corrected it and it worked Thanks Can i add some animations in my game which displays fire crackers displaying you won or something like that
If you want to have animations (gifs) there is a very easy way to do so. What you do is, you import an actor called 'GifImage' (Press Edit --> Import Class --> GifImage --> Import) When you have imported the class, you will be able to see the code. The code is over 1.000 lines so i wont post the whole code, but what you need is at the top of the actors code. You wil
Is it possible to use the "GifImage" inbuild class multiple times?
By Srax, with 4 replies.
Last reply by Srax, over 11 years ago:
davmac wrote...
Then, for example: <Code Omitted> 'gifImage', 'gifImage2' are just variable names - you can use whatever names you want.
Okay, thanks!
Adding Score
By jordan93, with 1 reply.
Replied to by davmac, over 11 years ago:
When you post images, you need to use the URL of the image, not the URL of the page that hosts the image. Eg: <Image Omitted> 'http://s15.postimg.org/t6myjqouz/Capture1.jpg', not 'http://postimg.org/image/pn10txm53/' In any case you should post code as text, not as an image.
Use code tags
.
Is it possible for an actor to ignore all other actors codes?
By Srax, with 3 replies.
Last reply by Srax, over 11 years ago:
danpost wrote...
The four 'while' loops in the 'move' method is where the collision detection code is at. Currently, if any actor is found at the offset given, it is returned by the 'getOneObjectAtOffset' call and any other actors that might have been found there are ignored. In other words, just saying to ignore any object returned that is of the type to ignore would not be sufficient. So, it would take extensive changes to the code to have the wombat ignore the new actor. Basically, you would have to use 'getObjectsAtOffset' to get a list of all actors at those locations, remove any instan
HELP
By SioneF, with 5 replies.
Last reply by SioneF, over 11 years ago:
Thank you!!
Creating a bullet on the gun
By jordan32, with 2 replies.
Last reply by jordan32, over 11 years ago:
Thank you! I had: <Code Omitted>I just never thought about moving the bullet like that.
584
585
586
587
588
589
590
X