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 for Game: Images
By spnjh, with 5 replies.
Last reply by danpost, over 9 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 9 years ago:
Thank You!
Random Moving // Get Random number
By FeVo, with 2 replies.
Last reply by FeVo, over 9 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 9 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 9 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 9 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.
game start menu
By AAA355, with 1 reply.
Replied to by danpost, over 9 years ago:
AAA355 wrote...
I want to have a start menu for my game. my game is simple maze game with multiple levels, I want to be able to have 3 different buttons on the menu as well as a picture. is this possible?
There are only hardware limitations as to what is (should be) possible. Create the menu World subclass and add the button Actor objects that the clicks are detected on (to start).
If actor touches wall, go back to start
By alishap, with 7 replies.
Last reply by alishap, over 9 years ago:
Okay, I will do that. Thank you so much!
Open a URL in browser
By unionthunder, with 1 reply.
Replied to by Yehuda, over 9 years ago:
unionthunder wrote...
Does anyone know if it's possible to open a URL in a browser through Greenfoot?
I would think it's possible, since it's possible with java and that's what Greenfoot is, the question is How? Maybe this will help:
Custom Networking
for loops
By ali18, with 9 replies.
Last reply by danpost, over 9 years ago:
Okay. First, let me correct a typo in what is now your line 25 above, which should be: <Code Omitted>Now, your world constructor should begin like this: <Code Omitted>You may or may not have some parameters between the parenthesis. Curiously, I am not sure why you named the class that creates objects that represent lives 'HealthBar'.
Game Over Screen
By joseph.volfman, with 1 reply.
Replied to by Yehuda, over 9 years ago:
See
here
. Instead of changing to Level2 change to GameOver, or instead of adding objects for new level, add in game over image/actor.
Level Changes
By joseph.volfman, with 1 reply.
Replied to by Yehuda, over 9 years ago:
See
here
.
Max Score
By joseph.volfman, with 1 reply.
Replied to by Yehuda, over 9 years ago:
That depends on what your levels are (different world, just remove objects and place new ones, etc.). If your score to switch levels is 100 and you have an int field named "score" holding the current score, then you can use those in an if statement to change the level.
turning objects in "while"
By Talrasha, with 10 replies.
Last reply by Talrasha, over 9 years ago:
Alright. i gonna try to programm this tommorow.
What is wrong with this array?
By Unknown6415, with 9 replies.
Last reply by Unknown6415, over 9 years ago:
Well my code is pretty short, and there is no other P, but it doesn't matter anymore, it works Thanks!
340
341
342
343
344
345
346
X