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
Background sound for the worlds
By Adi18, with 2 replies.
Last reply by Adi18, almost 7 years ago:
Thanks
Getting names of objects to print for debugging purposes
By MRCampbell, with 1 reply.
Replied to by danpost, almost 7 years ago:
MRCampbell wrote...
I want to get information to print to the terminal about a specific object, but I can't tell which instance of the object the information is coming from.
Introduce an indentifying field into the CatClass class: <Code Omitted>Then add a constructor to the class to accept a name: <Code Omitted>Now, you can give the cats their names: <Code Omitted>For the print line command, you can now use:
Type in player names
By marenss, with 3 replies.
Last reply by danpost, almost 7 years ago:
marenss wrote...
<< Code Omitted >> What i wanted to do is to use a GreenfootImage to display the typed text. but i have no clue how to make the "name" in the method individual. My idea was to create a new object: << Code Omitted >> to do so. But i can“t figure out how to create on of this objects without giving the "text" in the code
"typed text"? where is the code that allows user input?
Problem with version 3.5.3
By MCKING91, with 2 replies.
Last reply by MCKING91, almost 7 years ago:
oh thanks yes I was talking about the "Compile" button :)
Adjust position of one actor
By xandreas_1, with 2 replies.
Last reply by xandreas_1, almost 7 years ago:
Thx SIr :D
Swing Timer
By TheSlorrow44, with 1 reply.
Replied to by danpost, almost 7 years ago:
TheSlorrow44 wrote...
Is it a good idea to use Swing Timer? Does it affect the performance if I use it repeatedly?I use a swing timer like this: << Code Omitted
For anything to be uploaded onto the
greenfoot
site, all
javax.swing
classes should be avoided (same with
java.awt
classes). The "common way", as you put it, is more direct, works anywhere and has no chance of messing with the behavior of the
greenfoot
environment.
What does this error mean?
By TheSlorrow44, with 4 replies.
Last reply by nccb, almost 7 years ago:
Are there any more lines in the stack trace? It's possible there's an error in the collision checker because it does use recursion but the stack overflow will probably involve more than three calls, so we'd need to see more of the trace. If you're willing to, zipping up the scenario and sending it to support@greenfoot.org would allow us to take a look.
Help me pls
By Himsul, with 3 replies.
Last reply by Himsul, almost 7 years ago:
I tried that but it crashes. Ty anyway.
How can i create a object not permeable ?
By Thirtyseveneleven, with 1 reply.
Replied to by danpost, almost 7 years ago:
In
Car
class
act
method or a method called from within the
act
method: (A_0) move car (B_0) check for collision with object(s) (B_1) if collision, move car back
Counter for lives not incrementing or decrementing.
By Notted, with 23 replies.
Last reply by Notted, almost 7 years ago:
Notted wrote...
Strange. After doing a bit of debugging, I found that bombBoom never returns true; it's always false, even when the bomb hits it. Is it supposed to do that? I would like to use this for my lives system, whenever the bombs hit the boomArea (bombBoom is now true. False is when the bomb is in the air falling down.)
Just fixed it as of now. The problem was that boomBoom was being called in the act method of boomArea.
Rotation of my bullet
By Sam123123, with 1 reply.
Replied to by danpost, almost 7 years ago:
Sam123123 wrote...
I added bullet code to my character but I don't know how to make my character shoot in the direction of which my character is facing. I have tried about anything on the internet but nothing seems to work. << Code Omitted >>
The rotation of your
Soldaat
actor never changes;, so
getRotation()
will always return zero at line 32.
Bullet
on line 32 is a
Class
I need help for school ASAP
By BilalSLSS, with 1 reply.
Replied to by danpost, almost 7 years ago:
BilalSLSS wrote...
I need help in my homework which is to: Create a Chicken and make it fly left and right by changing the argument to the fly(int) method. 2. Create a Chicken and modify its name by invoking the setName(String) method. Put double quotations around the argument. << Code Omitted >>
What have you tried?
Wombats
By baseball2244, with 1 reply.
Replied to by danpost, almost 7 years ago:
baseball2244 wrote...
Is it possible for the wombats to move diagonally? << Code Omitted >>
You would need to change line 48 to: <Code Omitted>and add the appropriate cases to the
switch
block in the
canMove
method. However, once an edge is reached, it will turn twice to go along each edge, anyway. Maybe adding a random turn to the code would help: <Code Omitted>
Help on background music!
By SniperRocks, with 6 replies.
Last reply by SniperRocks, almost 7 years ago:
ive got a plan so hopefully itll work, ill give an update tomorrow evening.
Variable from MyWorld
By JPEG, with 3 replies.
Last reply by danpost, almost 7 years ago:
JPEG wrote...
I'm not sure how, but I treat my actors like Variables. ... how do I figure out what case random has been assigned to? e.g If random followed case 2 (as I already said that the actor paper has to be pressed), the IF statement will mean that scissor's actor will be removed.
Place your actors in an array field: <Code Omitted>They will each now have a number associated with them: <Code Omitted>Your act method can then start wit
211
212
213
214
215
216
217
X