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 generate objects in random spots until a game ends?
By abarnes, with 12 replies.
Last reply by abarnes, almost 13 years ago:
Now I'm stuck on a scoreboard >.>
How do you make something happen when an actor is eaten?
By ScratchMan, with no replies.
For example, I would like more identical actors to be created when an actor is eaten by my main actor. Could anyone help?
Growing Game Code
By wafflepudding, with 7 replies.
Last reply by wafflepudding, almost 13 years ago:
Put in the bracket, took that line out of the act, still doesn't work. Anything else I should try?
Chopping up an image
By actinium, with 4 replies.
Last reply by actinium, almost 13 years ago:
Thanks all, that looks like what i need danpost. Thanks also zamoht.
Failure to change
By ader108, with no replies.
In my game, the zombie is supposed to eat the NPCs and then turn them into another zombie. This used to work.. until in attempts to condense I combined the two NPC classes and the four Zombie classes. Currently it simply removes the object and adjusts its image to the zombie relating to the object removed. <Code Omitted>
Removing all objects
By bbwf, with 21 replies.
Last reply by danpost, almost 13 years ago:
'return;' is just a statement that causes an immediate exit from the method that is currently executing. Placing it in your code prevents later statements in the method from executing.
How to get the Greep/Alien to go back to the ship after they get the tomato?
By sask_girlz_rock, with no replies.
I have got the alien to get the tomato, bounce off the water and only a few return back to the ship. how can get it to return to the ship without the command saying return to ship?
How do you get the score to reset when you reset the game?
By theuberjew, with no replies.
me and my friend are stuck on this.
Whats the code for putting a timer in greenfoot if there is one?
By theuberjew, with 2 replies.
Last reply by theuberjew, almost 13 years ago:
thanks figured it out
Light Cycle AI
By m.legere1323, with 5 replies.
Last reply by wafflepudding, almost 13 years ago:
oh okay. thanks man I'll go there
Click to add objects
By super_noob, with 6 replies.
Last reply by Zamoht, almost 13 years ago:
I guess you could add my code to the world's act() method like this. public void act() { if (Greenfoot.mouseClicked(null)) { MouseInfo mouseInfo = Greenfoot.getMouseInfo(); int x = mouseInfo.getX(); int y = mouseInfo.getY(); addObject(new WhatEverClass(), x, y); } }
Delaying An Actor
By marzukr, with 3 replies.
Last reply by marzukr, almost 13 years ago:
Never mind I fixed this by decreasing jp to -16. Thanks.
adding a counter and making it work
By ctgreenfoot, with 1 reply.
Replied to by vonmeth, almost 13 years ago:
Find the code in the Crab class (it should be in a method that looks for the worm) where the crab 'eats' the Worm class. You will want to assign a new value to your counter there. Something like, " counter = counter + 1; ", or you can simplify that line and use the increment operator - "counter++;" - that will increase the counter by 1.
Shooting Problem
By Motifaded, with 3 replies.
Last reply by Motifaded, almost 13 years ago:
I fixed the problem.
How to detect what object is currently using a global method?
By UnclePedro, with 2 replies.
Last reply by danpost, almost 13 years ago:
I think that all you need is to put an instance boolean variable in the Enemy class, call it 'reversed'. Each object created from that class or any subclass will have a copy of that field for its use. You can also add the following method within the Enemy class to return the state of any object of that class (or subclass): <Code Omitted>Just change the state of the 'reversed' field every time you turn the object around.
908
909
910
911
912
913
914
X