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
Error with Zombies
By RandomGuy, with 4 replies.
Last reply by envxity, over 1 year ago:
fr
how to change an actors color
By envxity, with 13 replies.
Last reply by danpost, over 1 year ago:
envxity wrote...
i keep on getting a null pointer exception for the turn towards mouse how do i fix it?
Try this then: <Code Omitted>
i dont want it to only turn towards the mouse when i click i want it to always follow my mouse if the button is gre
How would I make an actor grab another actor and drag them off the screen?
By KCee, with 9 replies.
Last reply by danpost, over 1 year ago:
KCee wrote...
I cant make it "private void checkHitPedestrian()" because the checkHitPedestrian method is in my vehicle superclass as a boolean which my monster class is under. << Codes Omitted >>
Then use this for the method:
I want all actors under my Vehicle superclass to speedup during an event
By KCee, with 4 replies.
Last reply by envxity, over 1 year ago:
o im sorry i didnt help :(
How do I make an actor turn into a frog upon contact with another actor
By KCee, with 1 reply.
Replied to by danpost, over 1 year ago:
KCee wrote...
i have two actors under the same superclass "Pedestrian". One of the actors is called villager and I want him to turn into a frog upon contact with the other actor called "EvilWitch". << Codes Omitted >>
Looks like you have code in the
Villager
class to do just that. Only problem is that if contact with
EvilWitch
is more than one
act
step, which is most probably the case, then the image will be made smaller multiple times; and, at some point, it will try to make it a size that is zero or less, causing an error. You need a way to check whether the a
Use a variable in all classes
By gijsdevries, with 1 reply.
Replied to by danpost, over 1 year ago:
gijsdevries wrote...
Im making a game where you can score points when a bullet hits a monster. I also want to make a scoreboard but I cant use the variable I made for points in the scoreboard class. I already tried to make the variable public but that doesnt work. A video or an example code would be sufficient. Im kinda new to this so keep the code as simple as possible please :)
Please refer to my
Value Display Tutorial
scenario.
I need the bullet to follow my mouse
By gijsdevries, with 3 replies.
Last reply by danpost, over 1 year ago:
gijsdevries wrote...
Could you maybe give an example? right now I have this. The bullet only spawns at the coordinates of the mouse (a kogel means a bullet). << Code Omitted >>
I think all you need do is: <Code Omitted>Note that if your bullet moves too slow (less than maybe 5 pixels per move), the aiming will not be accurate -- maybe so inaccurate that it looks totally off. For the extreme example, if moving only 1 pixel per move, the movement will either be horizontal or vertical;
I want my villager subclass to change into a different image when touched
By KCee, with 1 reply.
Replied to by danpost, over 1 year ago:
Doesn't the
rooted
method get called when a
Villager
instance is touched by a
RootedCorpse
object? Change its image there.
can anyone explain how to code ai in a way that my pea brain will understand?
By acredb, with 1 reply.
Replied to by danpost, over 1 year ago:
acredb wrote...
basically i'm really stupid and can barely understand the syntax errors that i'm getting. << Code Omitted >> and if i try to fix one syntax error, another pops up, and so on no clue how to fix it, been on someone else's thread and i could barely read what was on the screen, everything kinda blurs together
The
Greenfoot.start()
method has a
void
return type. You cannot reference a
void
or compare it with anything. Also, the equal comparison operator is a double equal sign ( == ), not a single one ( = ).
How to add actors in the same place as before
By RandomGuy, with 2 replies.
Last reply by RandomGuy, over 1 year ago:
Dude thank you so much!
I need an actor to follow an other actor
By gijsdevries, with 2 replies.
Last reply by danpost, over 1 year ago:
gijsdevries wrote...
<Code Omitted>
The condition here will ALWAYS be
true
(if you have a class called
Player
).
I want an actor to apply a "rooted" status condition when it touches another actor
By KCee, with 5 replies.
Last reply by danpost, over 1 year ago:
KCee wrote...
Here is the SuperSmoothMover class: << Code Omitted >>
Okay. Try the following for line 35: <Code Omitted>
triangles
By LucarioCodes, with 6 replies.
Last reply by danpost, over 1 year ago:
LucarioCodes wrote...
Oh, thanks, sorry, I'm new to greenfoot
Line 10 should end with an opening bracket --
{
why doesn't my code work
By Magzlum, with 9 replies.
Last reply by danpost, over 1 year ago:
Magzlum wrote...
do you have a good and easy idea for a game that i can make for school
Avoiders are the easiest type to create. Adding some type of shielding might be an easy idea. Or, you could add shooting ability to the player, which would be a slight step up. You could continue to add other options later, which again will be stepping up.
code has error
By Merten, with 3 replies.
Last reply by danpost, over 1 year ago:
Merten wrote...
i<Code Omitted>
This code, in your
Fighter_Kogel
class, should be removed if you want the instances to move and get removed at edges like a
Kogel
instance is programmed to do. As an alternative, you could change it to: <Code Omitted>
19
20
21
22
23
24
25
X