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
Actor inside actor?
By akshay1188, with 2 replies.
Last reply by akshay1188, about 12 years ago:
Thank you!
List add object exception?
By Dalvengyr, with 5 replies.
Last reply by Dalvengyr, about 12 years ago:
Thanks guys for your help, it works correctly now :)
how to move in the facing direction
By nmichael221, with 3 replies.
Last reply by danpost, about 12 years ago:
nmichael221 wrote...
yes, he turns left and he faces left. But after I stop pressing the left key he is facing left and moving right.
That did not answer my question. Nowhere was there an option to answer that he 'turns'. I ask whether the rotation of the actor changes or does the image of the actor change when it changes the direction it faces. Also, you should post the code you currently have for the actor. Use the 'code' link below the reply box to insert code into you posts.
Do i understand it right?
By Erdrag1, with 7 replies.
Last reply by danpost, about 12 years ago:
I thought you wanted to add lettuce if no lettuce as left in the world. However, if you only have one lettuce in the world then at the time it is eaten, there will be none. So, either way, still. That is, in the "extends Actor", you can either call the method to add lettuce in the 'ifcansee' method OR you can still use separate from the 'ifcansee' method 'if (getWorld().getObjects(Lettuce.class).isEmpty())' to qualify when to call the 'createNewLettuce' method.
Kinect Greenfoot Integration
By judemartin, with 5 replies.
Last reply by davmac, about 12 years ago:
Danpost: I didn't write those instructions but I believe step 5 means you should download the Greenfoot kinect examples (the link is provided just below the instructions), as these example scenarios contain classes which communicate with the Greenfoot Kinect server (from step 4). judemartin: I believe you could use the example scenarios as a starting point. There's no real need to write code to communicate with the Kinect server using a socket as you can use the code in the example scenarios which does that for you. It sounds like you have this code and are essentially trying to re-create
SpaceInvaders
By crazyfox1999, with 1 reply.
Replied to by danpost, about 12 years ago:
Please show the code you have for the actor that is shooting (it is the main actor, correct? -- the one that stays in view at all times). Use the 'code' link below the reply box to insert code into your posts.
Control Interface Bug fix in a city Game please Help!
By Prish950, with 1 reply.
Replied to by danpost, about 12 years ago:
The code given will only place the building at the point of mouse-click to begin with. You need more code to maintain to building at the location of the moving mouse. Line 10 is a bit of a no-brainer. The act method is never called on 'null' objects The keyword 'this', used in any non-static method, will always refer to an object -- the object the method is being executed for or on. If the object the method was being called on was 'null', a 'NullPointerException would be thrown before the method was ever reached. Lines 12 and 13 call the 'getX' and 'getY' methods on 'Greenfoot.getMou
losing the game on contact
By Favna, with 2 replies.
Last reply by Favna, about 12 years ago:
Hm yes actually those 2 lines of deathby were in fact under each other. I have just tested your solution (the first one) and it works. Thanks :)!
All my variables and stuff are declared and everything seems to be fine, its just that eclipse doesn't think i have finished my loop, any help is appreciated.
By csr1010, with 11 replies.
Last reply by csr1010, about 12 years ago:
@danpost @jimboweb I really appreciate your help guys.
Falls bouncing off at angles
By BrownBoii333, with 3 replies.
Last reply by danpost, about 12 years ago:
That all depends on what code you already have for the movement (methods available, how movement values are retained, etc.).
Im trying to Setvolume for my sound! does not work:(
By Erdrag1, with 5 replies.
Last reply by danpost, about 12 years ago:
'gfs' is just a name I gave the variable that held the reference to the GreenfootSound object. You declare a variable by first giving the type, then by giving the name you want to call it. Just like <Code Omitted>'World' and 'int' are the
declared variable types
and 'x' and 'myWorld' are the
variable names
. Once values or references to objects are associated with the variable names, you can refer to them by their names.
Counter Problems
By Konzuk, with 1 reply.
Replied to by danpost, about 12 years ago:
On line 11, you are creating a NEW Counter object, whose fields are created and set to their initial default values when the object is created. Remove that line. You want the original Counter object to either show or have its value displayed somehow on the image of the End object. One simple way may be just to change the paint order (inserted somewhere within the 'if' block): <Code Omitted>
make a menu
By SAMAD101, with 1 reply.
Replied to by danpost, about 12 years ago:
Create an array of Actor objects for the buttons and check each one for a click to do whatever is to occur. Many of my more recent scenarios have open source and uses buttons to open and display different textfiles. The TextFileViewer class even has instructions for creating the buttons and getting them to work. I did not actually create a specific Actor subclass for the buttons; but, you can if you wish -- it will work the same.
Just wondering
By Erdrag1, with 2 replies.
Last reply by jimboweb, about 12 years ago:
Thanks, lordhershey!
Talking to Other Classes
By meazalplaq, with 2 replies.
Last reply by meazalplaq, about 12 years ago:
Thank you for your help. I will try this. Thanks,
633
634
635
636
637
638
639
X