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
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.
game start menu
By AAA355, with 1 reply.
Replied to by danpost, over 8 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 8 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 8 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 8 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 8 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 8 years ago:
See
here
.
Max Score
By joseph.volfman, with 1 reply.
Replied to by Yehuda, over 8 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 8 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 8 years ago:
Well my code is pretty short, and there is no other P, but it doesn't matter anymore, it works Thanks!
bufferedreader not reading the file
By divinity, with 5 replies.
Last reply by divinity, over 8 years ago:
hi danpost thank you very much got it to read the file
Gegner sollen mich verfolgen.
By danixxx12, with 6 replies.
Last reply by danixxx12, over 8 years ago:
Vielen vielen Dank. Habe es dank deiner Hilfe nun geschafft. :)
isKeyDown single action.
By mrlemon, with 6 replies.
Last reply by danpost, over 8 years ago:
The 'delay' method of the Greenfoot class suspends the execution for the specified number of act steps (like a temporary pausing of the scenario). Jumping is the rising and falling of an object over several act steps. You need to code it for what needs done during any one individual act step. How you implement the coding is up to you (whether you want to limit the height and just control the direction, like floating up and down, or you want to make it more realistic by applying a downward acceleration to the vertical speed, for the effect of gravity. Either way, or whichever way you choo
Health Bar
By ali18, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
The code is saying "if the rock is touching the boat, remove the boat". Exactly that is what is happening. I am not sure if the rock should move at all, but maybe you should remove the rock and not the boat. Usually, I would say the boat touches the rock and not the other way around, so you could place the code in your boat class and check for intersections with rocks.
339
340
341
342
343
344
345
X