This site requires JavaScript, please enable it in your browser!

What is happening right now?


reply to Help with moving a specific number of spaces

By danpost - 30 minutes ago
Again, cannot help without code to work with.

reply to How to get an OK Button?

By danpost - 31 minutes ago
You will have to see what methods are available in the class of the object you are working with.

reply to Rain drop game, removing objects that fall to the ground

By danpost - 42 minutes ago
The problem with the error is not what you think. The execution of one act method is specific to one raindrop and has nothing to do with the acting of other raindrops. You are getting the error because when the bucket removed a raindrop from the world, that same raindrop no longer has a location within the world and therefore 'getX' and 'getY' ('getY()' being called when checking if this same raindrop is at the bottom edge of the world) cannot complete its assigned task of returning a valid coordinate for your actor. You need to add the condition that the actor be in the world before checking its location in the world: <Code Omitted> For the raindrops being picked up from the side of the bucket, probably the easiest thing to do is check the location of the raindrop with respect to that of the bucket. If the raindrop is within raindrop speed of the top edge of the bucket and within raindrop width of the edges of the bucket, then it is good to pick up (something like that).

reply to The Colors Greenfoot Looks For

By danpost - about 1 hour ago
danpost wrote...
If your actor is to be changing colors throughout its existence, then you will want them as instance fields (as you show above).
As an alternative, you can save the colors themselves and get the individual color parts when you need them; so, instead of saving 15 color part values, you are saving 5 colors from which you can retrieves those color part values from. You may not even have to save the colors. It really depends on how you are using them. You may, just for the sake of readability, rather go ahead and save all 15 color part values. However, the more you rely on your own coding, the more chance of an error creeping in. I, myself, would prefer to get the actual value from the color at the time I need it.

reply to Help with school project

By danpost - about 2 hours ago
What error are you getting? Do you have a Vector class within your code?