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
How do you bounce a bullet off of a wall in the opposite direction?
By xsolvite, with 3 replies.
Last reply by danpost, over 4 years ago:
Collision checking should come AFTER any change in position (or rotation) -- that is, any change not dictated by collision to begin with. There are two actions that should be performed when a collision occurs: moving (or rotating) off the object collided with and turning. The first of these is often missed by young coders.
Help with NullPointer on exercise 9.70
By Sfven, with 3 replies.
Last reply by Sfven, over 4 years ago:
In
act
method of
Space
class, you can use: <Code Omitted> Thank you Dan, that was the code I was missing. I should also mention, my professor also said that we were not allowed to modify the
act
method, so I replaced line 100 of the
Asteroid
class with the if statement you posted. It looks like this:
Changing color of text
By BlueHand, with 1 reply.
Replied to by danpost, over 4 years ago:
You will need to have the
Instructions
object retain the message for later use (add a
String
field and assign
message
to it) and then add a
setColor
method to the class that acquires a color (via parameter argument) and creates and sets an appropriately colored new image.
stop background music when switching world
By Genota, with 1 reply.
Replied to by Super_Hippo, over 4 years ago:
To stop a sound, you need a reference to it. After you changed to the new world in line 34 of the Title_Screen class, you won’t have any further chance to get a reference to the sound object from the newly created world, so it will run forever. A few alternatives you could go for: 1) stop the sound before changing the world 2) pass a reference when you create the new world 3) make the sound a class variable (static) instead of an object variable to access it from anywhere more easily
What's wrong with my counter
By BlueHand, with 11 replies.
Last reply by Super_Hippo, over 4 years ago:
<Code Omitted>
How to call this return type method in actor class.
By Jemy, with 1 reply.
Replied to by danpost, over 4 years ago:
int timeOut = ((MyWorld)getWorld()).TimeOut();
Get variable from actor that is not in world
By Gbasire, with 1 reply.
Replied to by danpost, over 4 years ago:
If not in the world, then a reference to those actors must be maintained -- preferably, in a list (or a set of lists).
Position Same images in different positions
By Jemy, with 6 replies.
Last reply by Jemy, over 4 years ago:
danpost wrote...
danpost wrote...
What code do you have in Person class? (I presume the random numbers are given there)
I guess it is called
Server
class now.
yes
How can I jump?
By Elen123, with 1 reply.
Replied to by danpost, over 4 years ago:
Please refer to my
Jump and Run Demo w/Moving Platform
scenario. Run and click on
Who
button for code used.
Enemy Animation in both Directions
By Genota, with 5 replies.
Last reply by danpost, over 4 years ago:
The
direction
field is not required and only complicates things. Just negate the
speed
value to turn around. You will only need one
setLocaton
line that way, also. <Code Omitted> Remove
count++;
from act.
how to create multiple parameters within a constructor
By bubble96, with 1 reply.
Replied to by danpost, over 4 years ago:
This appears to be an assignment. Maybe you should refer to the java tutorials for help on this, particularly the section on
arguments
.
Actor not in the World
By Genota, with 1 reply.
Replied to by danpost, over 4 years ago:
Insert the following after line 133 in
Projectile
class: <Code Omitted>
How making the actor in to the home?
By mariq_rasyid29, with 1 reply.
Replied to by danpost, over 4 years ago:
Please refer to the Greefoot
tutorials
.
I get an weird error
By XApple15, with 5 replies.
Last reply by danpost, over 4 years ago:
Those kind of errors are usually caused by having information blocks embedded in the files. Try re-saving the files w/o the information.
Change the image of an Object
By lil.bopp, with 1 reply.
Replied to by lil.bopp, over 4 years ago:
Uh sorri, I found out myself xd It's literally just <Code Omitted> well still thank you, and if this helped someone else, that's just better :p
85
86
87
88
89
90
91
X