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

What is happening right now?

Nate2002

reply to Error

By Nate2002 - about 6 hours ago
Thanks it works now :)
SemDeBakkero

reply to Turn Object to the direction of the mouse

By SemDeBakkero - about 10 hours ago
danpost wrote...
Just to be clear, an actor with zero rotation is considered to be facing (or turned towards) the right. If the image given the actor is not one that naturally "faces" right, then you will need to do something extra to make it appear properly. Let us say that you have a rocket image which "faces" up as it would when in a landed orientation. You could set it as the default image and change its orientation in the constructor of the class: <Code Omitted>
Ohhh I understand, thanks!
SemDeBakkero

reply to Remove bullet after killing

By SemDeBakkero - about 15 hours ago
danpost wrote...
You are calling two methods, each which could remove the actor from the world (lines 12 and 13). Neither of these methods can execute properly if the actor is not in the world (one uses getOneObjectAtOffset and the other isAtEdge,, both requiring the actor be in a world). Regardless of the order these methods are called, if the first one removes the actor, the second one will fail. There are two main ways to avoid this dilemma. One is to not remove the actor is those called method, but have them return a boolean value indicating the "to-remove" state and then use those returned values ... like: <Code Omitted>This actually, eliminates the need for the ifAtWorldEdge method. The other main way is just to check if the actor is still in the world or not: <Code Omitted>
Wow thanks man, this worked!!