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
Change colors of an orb
By alexaa, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
You have to change line 27. The first two 0 are the coordinates of the top left corner, the third and forth 0 represent the size of the oval. If it is 0, nothing can be filled. The random color thing could also be done like this: <Code Omitted>
Run a Function Ever Other Second
By Alola_Sandslash, with 13 replies.
Last reply by danpost, over 9 years ago:
Use double values. Make gravity '0.25' and divide jump speed in half. Also, track the x and y coordinates of the player using double values so there will be no loss in precision when applying such small changes in location (since greenfoot tracks the location of actors using int values). This change is basically what the SmoothMover class (provided by greenfoot) provides to its subclasses.
Zufällig Objekte in die Welt setzen
By SamGreen, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Was genau soll zufällig geschehen? Sollen gegebene Objekte an zufälligen Orten in der Welt platziert werden oder sollen an bestimmten Orten Objekte zufälliger Klassen platziert werden? Und soll es bei Erstellung der Welt passieren oder während das Szenario läuft?
PowerUp Bar
By joseph.volfman, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Add a power bar to the world, save a reference in the world. Whenever something is hit, use that reference to call a method on the power bar which changes a value in it (which then changes the image of the power bar).
Check if something is next to the main.
By Trystar360, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
There is the 'getOneObjectAtOffset' method. You can check if another actor is a given amount of pixels in x/y-directions away. You could also move some amount to the side and use the 'isTouching' method (and then move back to the original position). That would probably be the easiest way.
Text Splitting.
By HolyCheeseCurd, with 3 replies.
Last reply by danpost, over 9 years ago:
You also might consider using the
lastIndexOf(String, int)
method of the String class.
List of Fonts?
By HolyCheeseCurd, with 2 replies.
Last reply by Yehuda, over 9 years ago:
HolyCheeseCurd wrote...
Is there anywhere that I would be able to find a list of the available fonts?
I'm not so sure what you mean. The available fonts are the ones that are on the system that the program is running on. If you want to retrieve the fonts from the system in your program, then you can use the following: <Code Omitted>
How do I make an object move continuously?
By alema173, with 12 replies.
Last reply by Yehuda, over 9 years ago:
FutureCoder wrote...
try this code to get the object to move up <Code Omitted>
The following is the same code: <Code Omitted>I don't think the problem discussed here is moving, it seems to me that the object is supposed to move after the space bar is pressed (to which a solution has been given).
How to compare Greenfoot Actors
By GreenfootNewbie2000, with 17 replies.
Last reply by Yehuda, over 9 years ago:
@davmac I guess that's the end, but I of course agree that the way I showed isn't the way things should be done.
Actor not in world error
By Soggy_Diaperz, with 4 replies.
Last reply by danpost, over 9 years ago:
Cut and paste line 23, inserting it at line 17. That way you are not trying to kill an alien after edge removal.
Collision Detection
By asthaga20, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Is this code in the act method?
Collision detection
By That0neGuy, with 16 replies.
Last reply by FutureCoder, over 9 years ago:
make a boolean variable that equals true when the player answers the question , and can only answer if the boolean variable equals false
Score board
By MikiG, with 1 reply.
Replied to by danpost, over 9 years ago:
Please see my
Value Display Tutorial
scenario.
thread not running, cause of error
By divinity, with no replies.
hi am doing thread running race the hare and tortoise timeless running race, but I change the variable from hare to cat and tortoise to dog, everything seem to going smooth except when it reach where it was interrupted method. can someone tell men why the compiler is not recognizing this error and how to fix it. here is the code <Code Omitted> any help would be greatly appreciately and tell me how to fix it
Incomparable Image and String Error
By Nameless477, with 9 replies.
Last reply by Nameless477, over 9 years ago:
aha! placing the code in the act method of the Card class achieves the desired results. Thank you :)
345
346
347
348
349
350
351
X