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
"If" loops
By FeVo, with 9 replies.
Last reply by FeVo, over 8 years ago:
Thanks @Yehuda
Collision Checking
By MichaelMac, with 1 reply.
Replied to by Yehuda, over 8 years ago:
Greenfoot has a method that creates a list of all the intersecting instances of the specified class. To cycle through all the intersecting instances of Block.class you would use the following: <Code Omitted>With the above code you can do something if there is a block at the specified coordinates.
Getting an object to move smoothly with a single key press
By geckert, with 1 reply.
Replied to by Yehuda, over 8 years ago:
Maybe
this discussion
can help.
constructor doctor in class doctor cannot be applied to given types
By divinity, with 2 replies.
Last reply by divinity, over 8 years ago:
thank you very much Super_Hippo what you have suggested to do, it work, thanks sssssssoooooo much. it is well appreciated, now all I have to do is the connected the administrative class to the gui.
Hiding Methods from GF
By MrBradley, with 4 replies.
Last reply by danpost, over 8 years ago:
MrBradley wrote...
Dan, what version on GF are you using?
I still using GF 2.3.0 USB stand-alone.
How to convert an int into an array containing its digits?
By Super_Hippo, with 9 replies.
Last reply by davmac, over 8 years ago:
Just one small question: where is the -48 coming from?
Incidentally, you can replace -48 with -'0' and it works well, as well as being perhaps a little less cryptic: <Code Omitted>
image change on key press
By AAA355, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
Try to use the setRotation method and then move(5) for every direction.
Need an easy int for my racing game
By john132, with 2 replies.
Last reply by Yehuda, over 8 years ago:
An integer is just a whole number so an easy int would be 1. What I'm basically asking is What is your question?
Move Object around another Object
By JeanRabelo75, with 2 replies.
Last reply by JeanRabelo75, over 8 years ago:
Thanks a lot! It Works!
Help for Game: Images
By spnjh, with 5 replies.
Last reply by danpost, over 8 years ago:
As far as the given method: First, the image belongs to an instance of the class, so it cannot be a static method. Secondly, if the method returns an image, then why would you say it returns an int value (int should be GreenfoottImage). But, the method is already a part of the Actor class; you do not need to create, or re-create, it. In general: If the images are to be given to Food objects, then the fields should be located in the Food class and the Food class constructor should set one of the images to the created instances. The images can be put in an array to give each an index val
How do I get two shooters working at once?
By frankiegc28, with 4 replies.
Last reply by frankiegc28, over 8 years ago:
Thank You!
Random Moving // Get Random number
By FeVo, with 2 replies.
Last reply by FeVo, over 8 years ago:
Super_Hippo wrote...
<Code Omitted> Or just: <Code Omitted>
Thanks, works perfect
Greenfoot / JDK configuration
By MrBradley, with 3 replies.
Last reply by davmac, over 8 years ago:
MrBradley wrote...
For the classpath issue, I assume it must be specified in the command line vs being picked up via an OS environment var?
It must be on the classpath though it doesn't matter how. However, the usual environment variable for specifying a classpath is CLASSPATH, and I'm not sure if its value is used if a classpath is also specified on the command line (which the BlueJ script does) and furthermore the tools.jar file is not normally listed in the CLASSPATH environment variable. You could of course modify the bluej launch script so that it included a value from an envi
Counter NullPointerException
By zomoruk, with 2 replies.
Last reply by zomoruk, over 8 years ago:
davmac wrote...
Hi. The exception is happening in the callcounter method - your code is never reaching the counttote method, so that method isn't the problem:
zomoruk wrote...
java.lang.NullPointerException at Mensch.callcounter(Mensch.java:272) ...
You didn't specify, but I assume that this must be the line that the exception occurs on (i.e. line 272 of the Mensch class): <Code Omitted> To be getting a NullPointerException there, then either getWorld() is returning null, or 'theCounter' variable
Ball bouncing on platform help!
By EthanLettuce, with 1 reply.
Replied to by danpost, over 8 years ago:
The rotation of a ball has nothing to do with the direction the ball travels. So turning upon collision or setting its initial rotation should not influence the movement of the ball. Your collision method has yet to be executed as it still needs to be called from somewhere. That being said, it is no wonder that you are having trouble with the bouncing as the value of 'isFall' is never changed (nowhere is it being set back to true and, since the collision method is not currently executing, it is never set to false). All your actor will do is fall.
338
339
340
341
342
343
344
X