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
Please help!!! :-(
By ILOVELABRADORS, with 1 reply.
Replied to by danpost, almost 12 years ago:
I need a better understanding of what you want, exactly. What part of the other actor has to be within 40 pixels (horizontally, vertically, or diagonally) of the hamburger ... the center of the actor? any part of its image? if the latter, is its image square?
Im new to greenfoot plz help
By DemonsWhiteSoul, with 3 replies.
Last reply by danpost, almost 12 years ago:
DemonsWhiteSoul wrote...
I got the walls to act like a solid now, i used the getOneObjectAtOffset etc. Only thing wrong now is i cant save the world :P
Explain. Give any error messages. Give details about unwanted behaviors. Supply code (use the 'code' link below the reply box to insert code into posts). Anything that might help resolve the issue. BTW, you can only save the world after compiling or resetting and making changes manually but before any act cycles have been executed.
Getting an x and y location from actors in a neibours list
By AndrewHollahan, with 7 replies.
Last reply by davmac, almost 12 years ago:
Lastly I wasn't aware that the neighbours command was a square, it said radius so I assumed it was a circle thank you for the info.
The documentation doesn't say radius at all. It says:
Return the neighbours to this object within a given distance. This method considers only logical location, ignoring extent of the image. Thus, it is most useful in scenarios where objects are contained in a single cell. All cells that can be reached in the number of steps given in 'distance' from this object are considered. Steps may be only in the four main directions, or may
Changing Java Source in Greenfoot projects
By kOmaster476, with 5 replies.
Last reply by danpost, almost 12 years ago:
I was thinking along the following lines when dealing with Strings in a switch block. Let us say you were doing a chess program and you had the pieces hold their types in Strings. Then, instead of: <Code Omitted>you could do this: <Code Omitted>
HELP! Transferring score counter from level 1 world class to level 2 world class while still keeping score
By Starmadero, with 4 replies.
Last reply by danpost, almost 12 years ago:
Well, if you are not going to maintain a common place for the fields and methods, then you will have to determine the type of world each time a method or field from any world is accessed. For example: <Code Omitted>You can continue with 'else if' blocks for other world types. In a similar manner, this will have to be done everywhere y
replace object with another object
By bladerunner2nd, with 12 replies.
Last reply by danpost, almost 12 years ago:
bladerunner2nd wrote...
i have different codes for removing the fish: for example if you eat it or it just reaches the left corner of the game; and the bloodstain should disappear after the animation or if it reaches the left corner too; i don't just want one removing code
Well, it can be done both ways -- as two separate removing codes or as two separate conditions within the same 'if' that removes the actor. That is:
Card Game
By largowinch123, with 3 replies.
Last reply by danpost, almost 12 years ago:
The Java tutorial page on
The List Interface
might be helpful (in more ways than one). You may as well want to check out the link at the bottom of the page for the 'Algorithms' page.
Prevent Objects spawning on eachother
By HELLOITSME, with 8 replies.
Last reply by HELLOITSME, almost 12 years ago:
ah man fixed it thanks danpost! :)
Indent a String?
By _wade, with 2 replies.
Last reply by _wade, almost 12 years ago:
danpost wrote...
There are escape sequences you can use to modify the way a string is output in most situations. Near the bottom of
this page
of the Java tutorials is a table for them.
It works! :)
loosing health after time
By Steven.Z., with 5 replies.
Last reply by danpost, almost 12 years ago:
There is also another thing about the HealthBar100 class that should be of concern. It refreshes its image every act cycle, which is not very efficient. It only needs to refresh its image when the value of the bar changes. You can remove the act method from the class and add a call to 'update' as the last line in the loseHealth25 method.
Switching World issue
By Dillybar, with 3 replies.
Last reply by Dillybar, almost 12 years ago:
Ah of course, that makes sense. I did some fooling around and it worked. TY :)
Help with Bullet
By tkurban, with 1 reply.
Replied to by danpost, almost 12 years ago:
'multiple bullets': what do you think this implies as far as programming this? If you want to do the same thing several times over, what kind of statement do you think would be required? 'different directions: this would imply some randomness in speed and/or direction; initial locations should probably be randomized somewhat also (or the visual of multiple bullets would not be readily apparent).
i could use help im new to greentfoot.
By redouan75, with 1 reply.
Replied to by danpost, almost 12 years ago:
Does it have to be the same car or can it be a different one (possibly a different color car)? (if it will always be the same color, then using 'setLocation' would be easier than removing and adding) What part are you having problems with? * making the car disappear * making the car reappear or spawn * random placement Show what code you have tried (use the 'code' link below the reply box to insert code into posts) working on one part at a time.
Encountering multiple problems and none in which i can think of a solution
By DieKatze117, with 4 replies.
Last reply by danpost, almost 12 years ago:
You say your map is over 100000 meters. What exactly do you mean by that? Maybe you can describe it in terms of pixels on your screen and give both dimensions. I noticed a bunch of large images within the images folder. A blue screen can easily be produced withouth the need of a stored image. Same with the gray screen with the title on it. Why your captured tank battle result image is in the folder, I cannot say. These large images may exceed the cache memory available for them. If you need help as far as creating images like those programmatically, ask. Another thing I need to ment
scrolling world
By iPrototype, with 5 replies.
Last reply by iPrototype, almost 12 years ago:
Ill look into that game tomorrow. Thanks for the reply guys
618
619
620
621
622
623
624
X