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 with following
By Bert389, with 1 reply.
Replied to by danpost, over 11 years ago:
When you say that the image of the hero is the image of the background when camouflaged, do you mean that the hero is essentially invisible? Line 11 checks to see if the 'camoHero' image is set as the image of the villain. Is that really what you want to check? And, in either case, the images will not be the same unless 'camoHero', specifically, is set as the image (creating a new image from the file "space.jpg" file will never be "the same image" as one already created and set (they are two distinct object and one is not the other and comparing them with '==' will always return a false v
Splitting up strings?
By h123n, with 7 replies.
Last reply by danpost, over 11 years ago:
h123n wrote...
It can not find the method split(String). Please tell me what I'm doing wrong. <Code Omitted>
There are several issues with the way you are using the 'split' method (in line 3): (1) it is written as if you were calling a 'split' method within the same class or a class that class extends; (it needs to be executed on a String object) (2) 'Answer' is used as if it were a specific String object (I get the feeling that it is actually the name of a Class within your project, which cannot be used here); (a Class is not a S
Need help with pacman ghosts!
By solidsnake, with 3 replies.
Last reply by danpost, over 11 years ago:
There are major issues with the code you are giving -- mainly in the 'ghostMovement' method. One is that there is no guarantee that the randomly generated value of 'direction' will be in the direction of one of the available paths. You need to determine which paths are available and randomly choose from those. Also, it seems that it may be possible for multiple 'move(1)' statements are executed in the same act cycle. To be consistent, the actors should only be allowed to move once per act. Before you had updated your code, I was going to show a simplified version of your 'ghostMovement'
Do you
By Kingly, with 2 replies.
Last reply by h123n, over 11 years ago:
No, you don't have to pay for greenfoot. It is completely free. Just click the download button.
Removing Objects Off-Screen, Using Keys.
By TechDan, with 1 reply.
Replied to by azazeel, over 11 years ago:
suppose you create a bear object like this <Code Omitted>remove use add object to appear and removeobject <Code Omitted>
sword move
By craeXD, with 15 replies.
Last reply by danpost, over 11 years ago:
Did you try 16 degrees for 10 act cycles? Actually, you can accomplish it in whatever number of act cycles you wish. The following format shows this: <Code Omitted>The 'counter/numberOfCyclesToComplete' is the percentage of '160' whose angle is to be taken on at any one time.
Wait for specific keys to be pressed.
By h123n, with 3 replies.
Last reply by h123n, over 11 years ago:
THANK YOU SO MUCH THIS IS EVEN BETTER THAN WHAT I WANTED.
Game ideas i need help
By DragonGirl, with 3 replies.
Last reply by h123n, over 11 years ago:
I did this for a class project some time ago. I created a physics engine in which when you press say left/right you will keep going left/right because you are in space. I also created a boss battle against bing :)
greenfeet
By bzhang, with 4 replies.
Last reply by bzhang, over 11 years ago:
Wow thanks for your help danpost :D
Setting Color in Greenfoot
By Ruben_Lathuy, with 1 reply.
Replied to by davmac, over 11 years ago:
Did you import the Color class? <Code Omitted>
something wrong on using getOneIntersectingObject
By dynamic, with 1 reply.
Replied to by Super_Hippo, over 11 years ago:
The 'CheckCanMove' method returns true if the object doesn't intersect with an object of a given class. In your case, you have coded it that the object only moves if it doesn't intersect a brick before it moves. That means if you moving into a brick, you can't escape anymore. You could check the intersecting after it moved and move back if it intersected. This way you won't stuck: <Code Omitted>
Creating Basic AI?
By MeinKraftBubba, with 17 replies.
Last reply by MeinKraftBubba, over 11 years ago:
Okay, having made those changes, what needs to be fixed in the Blinky class?
Need too call the act method only every couple of frames
By someone1, with 12 replies.
Last reply by someone1, over 11 years ago:
OMG thank you soo much
Need to only call the act method once
By someone1, with 3 replies.
Last reply by someone1, over 11 years ago:
I just tried it out thnx soo much
I can't get the images to rotate as they are walking
By DietrichaLove, with 1 reply.
Replied to by danpost, over 11 years ago:
As written, only one particular image will be set to the actor during any phase in its movement (whether moving left, or right, or up, or down, or standing still). If your ".gif" files contain multiple images each, they need to be extracted from the file and set to the actor individually at set intervals to create the animation. Greenfoot does provide a 'GifImage' class that can be imported into your project that will do most of the dirty work for you. From the menubar, use "Edit>Import Class..." and select the "GifImage" class to import. Once imported, your actors can make use of the clas
560
561
562
563
564
565
566
X