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
Help: trouble Using get One Object At Offset to move a character along a set of tiles
By Kami_Uizado, with 4 replies.
Last reply by danpost, over 11 years ago:
Sorry. I was mistaken in the above. The check on line 10 limits the number of tiles that could be detected to two -- which will not work. The other tile detected will be the tile that the character is current at. If you import java.util.List into the class you can replace my lines 10 through 12 above with the following:
Having trouble with my platform game
By mcyr116, with 2 replies.
Last reply by mcyr116, over 11 years ago:
Thank you soooo much! I was close on my own, but just couldn't get there!
Exercise 8.32 in textbook
By rgilmet, with 4 replies.
Last reply by rgilmet, over 11 years ago:
Thanks so much for your help.
Help with drawOval
By Buddha, with 3 replies.
Last reply by danpost, over 11 years ago:
I was suggesting something like this: <Code Omitted>
Access variables defined in world in and actor. Is this possible?
By ChiefCrunchy0, with 2 replies.
Last reply by ChiefCrunchy0, over 11 years ago:
Thank you danpost, this solved my problem!
Don't know how to use a method
By worldmaker, with 3 replies.
Last reply by Super_Hippo, over 11 years ago:
If you want to pause the whole scenario, you can use 'Greenfoot.delay(200);'. This will be like 3-4 seconds with the speed slider in the middle.
A little help with intersects() method
By NoValidIdea, with 2 replies.
Last reply by NoValidIdea, over 11 years ago:
Thanks. The reference soulution is way better...
Need help with the Records
By Oxcar, with 1 reply.
Replied to by danpost, over 11 years ago:
If you are referring to your 'Bee' scenario, it seems okay to me. It is also showing your score of '40'.
World Creation Question
By Gingervitis, with 3 replies.
Last reply by danpost, over 11 years ago:
I think my
Use of 'this' demo
may be something for you to look at. Basically, what the scenario demonstrates, as far as world changing, is that you can create all your portal pairs and place them each in their respective worlds right at start-up. Randomly placing the portals in their worlds will not effect their capabilities and they can be made to be one-way, circular (back and forth), or chained (one to the next). Also, when used, the receiving portal can remain (as I have it in the demo), be relocated, or even removed. If you have an
Need help with changing color of text
By acampbell24, with 7 replies.
Last reply by danpost, over 11 years ago:
You could get a MouseInfo object if 'mouseClicked(null)' and then see if 'getActor', if not null, returns an actor of said type. However, I would just keep references to all three colonist objects in the world class and check for clicks on each one in its act method:
Very confused Please assist
By ipeefreely, with 3 replies.
Last reply by danpost, over 11 years ago:
There are other problems as well -- but, the main one is where you are putting the code. It should not be in the Animal class, but in your World subclass and called from the constructor of that class. Also, a better name for the method might be 'addObjects' (plural), since it adds multiple actors into the world:
Having a major problem with my game code, please help.
By Raisoren, with 5 replies.
Last reply by Raisoren, over 11 years ago:
UPDATE: The problem has been fixed, thanks all for replying. There was an extra letter in the "Level" subclass that didn't belong. Sorted now.
why is this not the answer I thought it was
By ipeefreely, with 2 replies.
Last reply by Super_Hippo, over 11 years ago:
@azazeel: I think this code was given and you have to find out the value of 'sales'. If you change the given code like you did, you will get a different result. @ipeefreely: You used 'bonus0' in the code above. If 'bonus0' is 0 or 'bonus', then at the end, 'bonus' will be 20. The reason is the following: 'if (sales>300)' checks if 'sales', which is 500, is greater than 300. It is, so it executes the if-block (which is the next line). So 'bonus' is set to 'bonus0+20'. The next condition isn't even checked because it has this 'else' before the 'if'. That means it would only check the conditi
Re-adding an object when it's been removed
By vampire-wannabe, with 2 replies.
Last reply by danpost, over 11 years ago:
azazeel wrote...
what is this ?
I wonder this myself. This is what I see: <Code Omitted>Your line 48 and 49 get some random numbers that are not being used; so line 46 through 50 are meaningless. Besides, the actor would have to come in contact with two Zuko object at one time for line 46 to detect one because you are removing one in the previously calle
what is the value of sum after the following code is executed?
By ipeefreely, with 1 reply.
Replied to by danpost, over 11 years ago:
The code will not compile as 'sum' and 'x' are not declared anywhere. However, if you had this: <Code Omitted>then sum = 0+2, +3, +4, +5 = 14. I believe that this would work also: <Code Omitted>In fact, this may even work: <Code Omitted>
562
563
564
565
566
567
568
X