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
I can't get my actor to spawn when run is clicked
By S4uk0, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Remove the 'spawn' method and add the You object from the world constructor. Right now, every You object creates another You object every act cycle. If there is none, then none will be created, but if there would be one, after one second, there would be so many that your computer could not handle them.
Need Help
By Hansi77, with 2 replies.
Last reply by danpost, over 9 years ago:
I uploaded one as simple as I could do it -- source included. It is
here.
Hope you can understand it. And if not, you could ask for information about any codes you do not understand of it here.
World class not compiling
By LakeOtis, with no replies.
This is the code- I didn't change anything except the size of the world, is something wrong with my Greenfoot?<Code Omitted>Edit: Nevermind, I just had to restart Greenfoot.
Trying to get actor location before object has been created error
By Dylex, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Try to use this: <Code Omitted>The addedToWorld method is automatically executed once after the object was added to the world. The constructor on the other side is executed when the object is created which is before it is added to the world, so it can't get its location at this point. You created this discussion twice. Click on "Destroy" at the other one.
Subscripts
By abby410, with 1 reply.
Replied to by danpost, over 9 years ago:
The subscripts are not too difficult to do. There are characters for all ten of them between (char)8320 and (char)8329. I have found all but one of the superscripts (the 1 was not found). Most of them between (char)8304 and (char)8313 (8305 through 8307 are not usable. The 2 and 3 superscripts are the squaring and cubing characters located at (char)178 and (char)179 (if I am not mistaken). Without the '1', however,, the codes for the other nine might be quite useless. A side though is that you could create you own system for creating the superscripts and subscripts in an image with a b
Geography quiz
By adlafforest, with 1 reply.
Replied to by danpost, over 9 years ago:
You can make the String objects be the common factor. Save the strings instead of the Answer objects. Have the filename of the pictures also be the same string with all pictures having the same extension. This way, you can even vary the answer to the same question -- one of the strings can be randomly picked to be the right answer. Its image is shown, the Answer objects are created with the chosen one getting the 'true' parameter.
Why this won't work
By DuckGod, with 2 replies.
Last reply by danpost, over 9 years ago:
I tested the code out and it seems okay to me. The Fall is falling and afterwards the world resets the level. Of course, I had to presume what codes you had for 'cleanUp' and for 'testLvl' plus a couple of other minor adjustments that was in no way related to falling or resetting the level. The only other thing I had to do was change what class the Fall class extends to Actor (I did not have the Effects class codes). So, in light of my results, I would say that cause of the issue you are having resides either in the Effects class or the WorldLoader class.
method in actor class called by specific object in world class
By Telko, with 11 replies.
Last reply by Telko, over 9 years ago:
Thank you very much, it works now.
need help with shooting
By FutureCoder, with 4 replies.
Last reply by FutureCoder, over 9 years ago:
thanks a lot, this really helps
how do you make something repeat only once
By 111213451, with 1 reply.
Replied to by danpost, over 9 years ago:
111213451 wrote...
I'm trying to change the size of the actor only once because it keeps getting smaller and I don't know what The constructor is
There are many ways to limit it to a one-time action. Obviously, you have found that coding the action in the constructor is one way -- and in this case, probably the best way. The constructor is a block of code that looks like a method, but (1) does not have a return type (in most cases, it would be the 'void' in method declaration lines); and (2) the name of the block has the same name as the class. So, a Player class would have a constru
Lesson 5: Add Randomization and Conditional Behaviors
By rwagner, with 1 reply.
Replied to by danpost, over 9 years ago:
rwagner wrote...
How do you write an IF-Else statement to program the ants to move and than turn up to 20 degrees 10% of the time, else move and turn up to 10 degrees?
What have you tried? Show something of an attempt.
Changing BackgroundImage in MyWorld
By wueschn, with 2 replies.
Last reply by wueschn, over 9 years ago:
@danpost Your solution works perfect, thanks a lot!! I tried now to combine your solution with my coding and because of your explanation it also works! It is sentence 5 and 10 that matters.
Want to spawn specific actor based off value of array
By MichaelMac, with 3 replies.
Last reply by danpost, over 9 years ago:
Since no more information was given, I could only speculate that the actors each represent a dice with a different value. Then, the answer to 'is there a better way' would be "yes" (definitely better from a design perspective; but faster -- as far as coding time, probably; as far as execution time, questionable).
Show score at the end
By JokeNotFound, with 6 replies.
Last reply by JokeNotFound, over 9 years ago:
Thank you very much, it worked!!
How to properly export a project...
By PJaymz, with 3 replies.
Last reply by danpost, over 9 years ago:
You could put a copy of the executable file (created by locally sharing to make an application) in the project folder and upload it here with the source code checkbox checked. Then they can download it from the site, extract the files by unzipping the downloaded folder and take the executable from inside it.
384
385
386
387
388
389
390
X