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
Uploading a scenario
By thekidj, with 1 reply.
Replied to by davmac, over 11 years ago:
Click the "share" button from within Greenfoot.
I keep on getting "can't find symbol" error on the "Cansee(fly.class) ))"
By youresocool, with 1 reply.
Replied to by danpost, over 11 years ago:
Unless you wrote or added the 'Cansee' method to your class (or a superclass of that class) yourself, you will get that error. There is a 'canSee' method in the Animal class (lettercase is important). If this class extends that class than use 'canSee' (not 'Cansee'). If not then, you need to either add the Animal class and have this class extend it, or add the methods to this class to do what you want.
Toggling a variable
By qwertyuiop, with 2 replies.
Last reply by qwertyuiop, over 11 years ago:
Thanks that gave me the idea of using an int variable that will change depending on the power up gained and it is working.
Help me please
By skreamone, with 2 replies.
Last reply by JasonZhu, over 11 years ago:
I suggest you ask for online help rather than a finished project. I know this is a school project and I'm sure you could figure it out with help. I have finished the project and I'm willing to offer you help.
Scrolling world for Shoot em' Up
By mcGreen, with 2 replies.
Last reply by mcGreen, over 11 years ago:
Yeah, I decided to try something little less complex. Thanks for your help anyways.
How to get the current world name
By qwertyuiop, with 2 replies.
Last reply by danpost, over 11 years ago:
<Code Omitted>But I do not think that is what you are looking for. Can you be more specific as to why you need the class name and how you want to use it in the 'if' statement?
Actor size is larger than it appears to be.
By AlexFeetham, with 3 replies.
Last reply by AlexFeetham, over 11 years ago:
Actually no I think you're right, its an issue with the image of the actual player character. Cheers danpost =)
removing objects after hitting world
By Greenfootnoob, with 1 reply.
Replied to by danpost, over 11 years ago:
The world is an two-dimensional array of cells. The width of the world is acquired by the World class method 'getWidth' and the height is acquired by the World class method 'getHeight'. So the four edges are horizontally at '0' and 'getWidth()-1' and vertically at '0' and 'getHeight()-1'. The World class method 'removeObject' in the world class will make an object 'disappear'. The Actor class method 'getWorld' will return the world the actor is in. The actor class methods 'getX' and 'getY' return the location coordinates of the actor within the world. Those are the pieces. You put the
Victory message?
By tomw, with 1 reply.
Replied to by danpost, over 11 years ago:
Remove the player from the world and add an Actor object that has the image you want to the world (the victory message). The player can do this by checking to see if he is either within a certain area or when it intersects some target object. Add the object before having the player remove itself to avoid some possible exceptions.
Jumping Gliche
By Greenfootnoob, with 5 replies.
Last reply by danpost, over 11 years ago:
My revised outline: (1) add 'acceleration' to 'vSpeed' (2) vertically move actor (3) if intersecting platform (a) if vSpeed is positive (i) set actor above platform (ii) set 'vSpeed' to zero (iii) if 'space' key is down * add 'jumpStrength' to 'vSpeed' (b) if vSpeed is negative (else block) (i) set actor below platform (ii) set 'vSpeed' to zero
Coding error
By GamesGrinder1998, with 5 replies.
Last reply by danpost, over 11 years ago:
GamesGrinder1998 wrote...
sorry i don't really understand it, how would the code look
Please refer to the GreenfootSound API documentation for the constructor(s) and method(s) available.
Firing problem
By Greenfootnoob, with no replies.
G'day.. i was going around the green foot forums for a firing code and i found this. however, i only wanted my actor to shoot one bullet at a time, instead of many bullets coming out. can anyone help me? <Code Omitted>
Incompatible types
By GamesGrinder1998, with 1 reply.
Replied to by danpost, over 11 years ago:
If you show what line it is occurring on and inform us of what type object/fields you are trying to use, we could explain WITH an example. All I can say without one, is that you are using an incorrect type of field or object somewhere.
Scoreboards and counters...and a big thank you to anyone who reads through all this
By Roz, with 21 replies.
Last reply by Roz, over 11 years ago:
And many thanks for your efforts too Erdelf.
Help with Programming a Player Piano?
By Sneaky4296, with 2 replies.
Last reply by danpost, over 11 years ago:
The problem is that you are trying to use the Key class to control all the keys. A class is a blueprint of an object and the methods within it should be each geared for a single key. If you want to control how all the keys are to behave, the world class is where that code should probably go. It may require a dual set of conditions in your act method of the Key class for having a Key object play its note (the set you already have, plus one more set for the player). Maybe add an 'int' field to the class for 'autoPlay' and add a method for the world to call to set it to some nominal value (ma
704
705
706
707
708
709
710
X