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
Can anybody help me?
By plsFast, with 4 replies.
Last reply by Super_Hippo, over 7 years ago:
It does it in the same act-cycle. So it won't be visible there if it immediately moves back. Otherwise, you had to replicate the isTouching method instead of using the current location, use the one which it would have after moving. But that is really unnecessary. To the first question. You could exit your method with an error message if x or y are greater than 7.
Large hit box
By Erasedsword, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
I have no clue what "pikel" is. However, make sure that there are no needless transparent areas around your images. As an alternative, you can use methods which do not take the image into account, but only the position of the object.
delete object
By plsFast, with 2 replies.
Last reply by Super_Hippo, over 7 years ago:
The World class has the method "getObjectsAt". It gets a list of all actors of a given class at given x/y coordinates. The following with remove anything from the world which is at (x|y). <Code Omitted>
Make an actor take Damage
By dammnn, with 1 reply.
Replied to by danpost, over 7 years ago:
You need to do one of the following: (1) immediately remove any laser that hits the actor; (2) add a
boolean
field to track the state the actor being hit by a
Laser
object; or (3) add an
Actor
reference field to hold any
Laser
object currently touching the actor.
the health bar, it doest lose health when hit by the bullet
By Deveshwarreddy, with 3 replies.
Last reply by danpost, over 7 years ago:
Remove the following line from the
prepare
method: <Code Omitted>
Execption in thread
By SniperRocks, with no replies.
greenfoot exception in thread awt-eventqueue-0 java.lang.ArrayIndexOutOfBoundsException: 4096 it doesn't let me make a subclass
How do I move
By coreypants03, with 3 replies.
Last reply by coreypants03, over 7 years ago:
Thank you. I was able to get it to move.
Moving the Character
By Biscuits1, with 4 replies.
Last reply by Biscuits1, over 7 years ago:
Helps a lot, thanks a lot!
What's wrong with this code?
By EthanWasHere_, with 1 reply.
Replied to by nccb, over 7 years ago:
You cannot call methods which talk to the world after you've been removed from the world -- and this includes isTouching. So if one of these methods removes the actor from the world, you should not call the second method. One suggestion on how to fix this is to return a boolean from the method indicating if the actor was removed (like in
this post
). Another shorter check is to change: <Code Omitted> into: <Code Omitted> The check for the w
Randomly spawning objects in set locations at the start of the game
By EthanWasHere_, with 6 replies.
Last reply by EthanWasHere_, over 7 years ago:
Cheers!
Passing score value from lev 1 to lev 2
By jackreacher659, with 5 replies.
Last reply by danpost, over 7 years ago:
jackreacher659 wrote...
set score in level 2 to score in level 1 ?? can u tell me how can i do so?
Something like this: <Code Omitted>
Checking boundaries in my game
By Sam123123, with 4 replies.
Last reply by Sam123123, over 7 years ago:
Thank you so much nccb! this worked perfectly!
How do I take damage from collision without Animal class??
By KennyBoy, with 5 replies.
Last reply by Super_Hippo, over 7 years ago:
The simplest one (or at least a very simple one) is a variable in your Goku class. <Code Omitted>
Getting actors to shoot one laser at a time?
By charliejustshrekedyou, with 5 replies.
Last reply by danpost, over 7 years ago:
Add a
boolean
field to track the state of the "s" key. Anytime the actual state of the key is not equal to the field, change the field value and check that new value as the condition to shoot.
How to make a scoring system?
By Poseidon420, with 12 replies.
Last reply by BaliEatz, over 7 years ago:
Poseidon420 wrote...
Its alright i've fixed it now thanks guys
np dog
202
203
204
205
206
207
208
X