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 to make actor react on noise through microphone
By Dhiraj, with 1 reply.
Replied to by danpost, over 7 years ago:
Use the
Greenfoot.getMicLevel
method. If the returned value is less than a certain value, move right as normal, otherwise (
else
) move left. Btw, the commented text in the code reads moving left is normal and move right when noise is being made.
Swapping Actors in a 2d array
By M123D, with 1 reply.
Replied to by danpost, over 7 years ago:
M123D wrote...
I'm trying to make a game based off of candy crush but I can't seem to get the swapping of the actors right. In my code, all the different coloured candies extend a Candy class and they are placed in MyWorld according to how many pixels apart they are.
Please show
Candy
class code and
MyWorld
class code.
PLEASE HELP ME FOR THE LOVE OF GOD
By Swangbee, with 4 replies.
Last reply by danpost, over 7 years ago:
If the
HealthBar
object is contained by the
SpaceShip
object, then it would make good sense to have the space ship look for the Powerup object and not the other way around.
Get an actor to bounce back when egde is hit.
By Notted, with 7 replies.
Last reply by danpost, over 7 years ago:
Notted wrote...
So, if this << Code Omitted >> is not setting the direction of the actor, will setRotation(), do the job? If not, what will?
Yes, but your actor will not the be upright. Just negate the speed of the actor.
I want to use the boundaries of the image as the bombs hitting the bucket. How do I do this, since I don't know?
First, see if there is an intersecting bomb. If so, then get the image and determine whether the location of the bomb is in the collectible region. The left edge of the basket would be at:
I have a question
By imdojangbob, with 6 replies.
Last reply by danpost, over 7 years ago:
imdojangbob wrote...
What should I do with my animal class?
Personally, I would totally remove the
Animal
class from the project. I see only one "possibly" useful method in it (the
move
method) and it is not used in the
Human
class. All the others either have a method now in the
Actor
class that can be used in lieu of it (
canSee, eat, turn, atWorldEdge
); or, are badly written (
access, removeObject
); or, are related to poor design (displayMessage, clear). From a design standpoint, it would be better to use an actor, or actors, to display messa
Logic errors(?). boomArea no checking to see if bomb has hit class
By Notted, with 17 replies.
Last reply by Notted, over 7 years ago:
Thanks!
我到底那里错了?
By NanyuKe, with no replies.
<Code Omitted>
Highscores
By ant, with 2 replies.
Last reply by data17, over 7 years ago:
With this method you can read the highscore file: <Code Omitted>
Problem with the removing of something
By Tommes, with 3 replies.
Last reply by danpost, over 7 years ago:
Tommes wrote...
Thank you, you are my hero!
And you are my 500th fan (follower). Thank you.
Colordetection
By xandreas_1, with 6 replies.
Last reply by danpost, over 7 years ago:
xandreas_1 wrote...
Is there a way to get a scrolling background in the worldclass while pressing w and s for forwards and backwards?
See my
Scroller Class Demos
scenario.
Answer for Q2: Size World(1500, 750, 1) Size Background Actor(1500px x 210px) Localisation Background Actor(750, 650)
Would take a bit of calculating to just figure out which pixel in the background image would need to be looked at.
I should mentioned some facts about my game: One of my Actorclasses is my scrollingbackground(not with the col
Issue with calling sub-programs from another class
By Legitimacy, with 1 reply.
Replied to by Legitimacy, over 7 years ago:
the bolded line didn't work within the code but the line I was pointing out starts with <Code Omitted> and ends with <Code Omitted>.
how do i change my dp
By bully12345, with 1 reply.
Replied to by bully12345, over 7 years ago:
nvm i found it
How to use "Actor stone = (Actor)getWorld().getObjects(Stone.class).get(0) " for multiple Actors
By lm_s, with 2 replies.
Last reply by lm_s, over 7 years ago:
Thank you for your answer! Both versions are working well.
Shooting in Multi-Player mode
By KSH-Aeppli, with 2 replies.
Last reply by KSH-Aeppli, over 7 years ago:
Thank you, this works perfectly!
Score not showing up on separate worlds
By Nate2002, with 7 replies.
Last reply by danpost, over 7 years ago:
Nate2002 wrote...
World2: <Code Omitted>
Really? The first two lines are fields -- the others are execution code. And why would you create a
World2
object from within a
World2
world? Remove lines 3 through 5 here in World2.
219
220
221
222
223
224
225
X