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
Kinect Greenfoot Integration
By judemartin, with 5 replies.
Last reply by davmac, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 12 years ago:
Thanks, lordhershey!
Talking to Other Classes
By meazalplaq, with 2 replies.
Last reply by meazalplaq, almost 12 years ago:
Thank you for your help. I will try this. Thanks,
can someone explain this code?
By Erdrag1, with 1 reply.
Replied to by Super_Hippo, almost 12 years ago:
It returns true if the x-coordinate of the actor is either smaller than 10 or greater than 10 subtracted from the width of the world (the actor is in right now). So in other words, if the actor is at a range of 10 of either the left or the right side of the world. The method 'getWorld' returns the world object in which the actor is right now (or null if it wasn't added or already removed from the world). 'getWidth' returns the width of the world, so the value which was added as the first parameter when creating the world (the x in 'super(x,y,cs)').
Hey i need some help! :)
By Erdrag1, with 8 replies.
Last reply by davmac, almost 12 years ago:
how do you you add an act method if world class doenst have it?
The same way you add any method. You added an 'addLettuce' method; you can add an 'act' method in precisely the same way. (However, note that the 'act' method must be
public
rather than
private
).
Java 8 with Greenfoot
By dedoig213, with 1 reply.
Replied to by davmac, almost 12 years ago:
Is there a version of Greenfoot that comes bundled with Java8?
There isn't (yet).
I have Java 8 installed on my machine, and tried running the Pure Java version with my Java8, but it simply hangs saying "Boot".
For support please see
the support page
. If you can find the debug log it would be a great aid in diagnosing this.
Confused
By xxX_Muffin.man_Xxx, with 2 replies.
Last reply by danpost, almost 12 years ago:
'getWorld' in your act method is returning the world your actor is in, not the 'changename' world from which you are trying to access the 'getName1' method. You probably need to keep a reference to the 'changename' world or make the name fields and the methods in the 'changename' world 'static', so you can access the methods through the class name:
633
634
635
636
637
638
639
X