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
Why does my character fall through the world?
By PostieMalonie, with 6 replies.
Last reply by danpost, almost 7 years ago:
PostieMalonie wrote...
What line would that be on nccb?
nccb wrote...
Your jumpStrength is a positive number, which means the character jumps downwards. You need to make jumpStrength negative in order to jump upwards.
(line 21 -- along with line 111)
Your jtimer does not work correctly because you increase it in act, and then check if it's above zero later on in checkKeys, which it always will be. You probably want to change the threshold for jtimer in checkKeys to be more like 30 to make a longer delay between possible jumps.
(line 36 -- along with line 58 and
Actors pass through walls
By Aftermath, with 3 replies.
Last reply by Aftermath, almost 7 years ago:
danpost wrote...
Aftermath wrote...
I did comment on this, but when the actor hits the wall it will not go through it, but when it starts to reverse, or faces the other way and drives forward, it goes through the walls as if it was driving normally.
It is best to first do an action (turn or move), then check for an obstacle. If one is encountered, then undo the action. That way, you are always not over an obstacle after each act step.
Thank you, this fixed it.
Game not runniing
By IshaanMishra, with 2 replies.
Last reply by IshaanMishra, almost 7 years ago:
Ah I see. I have 4 classes which use the GIFImage Class. Thanks!
Access an actor's variables in another actor
By Notted, with 3 replies.
Last reply by danpost, almost 7 years ago:
Notted wrote...
I found a problem with my movingBomber() code. It seems that whenever the gotoX is equal to the actors x (from getX), he hits an invisible wall, and then spasms insanely, making him stuck. << Code Omitted >> The gotoX = 220 (100 less than of the width of the game world).
Try changing line 3 to this: <Code Omitted>
GIF not working on site
By valdes, with no replies.
For greenfoot site administrators: I have games that are using the GIFImage import class. The games work fine on Greenfoot, but when they are uploaded to this site, they crash. Using the latest version of that class, in Greenfoot 3.5.3. Is there are trick for using GIFs on the site? I give links to games with that problem:
game1
game2
This guy discussed the same problem:
game3
Head Soccer
By CRISTIANO7, with no replies.
Wie kann man ein Tor beim Fussball programieren?
NullPointerException: problem with ending with gameover
By IshaanMishra, with 2 replies.
Last reply by IshaanMishra, almost 7 years ago:
This was the code when I called GameOver(). Explode removes the spaceship. <Code Omitted>I changed it after what you said to <Code Omitted> and it works now! Thank you so much :)
problems with my bullet
By Simson1000, with 1 reply.
Replied to by danpost, almost 7 years ago:
You have several misconceptions about the way your code is processed. First, all your while loops are infinite loops. Once the condition is true, the loop will repeat forever and nothing else can then be executed. The condition must change within the loop so that it can be exited and the following command can then be processed. If statements would work, however, as greenfoot repeatedly calls the
act
method while your program is running to create the animation loop. All you need to put in the
act
method is what should be done on a single act step. Even better again, is to se
Problems adding actors-scrollworld
By Andrew.2, with 6 replies.
Last reply by Andrew.2, almost 7 years ago:
nevermind i fixed it
help making levels
By 343qwm29, with 1 reply.
Replied to by danpost, almost 7 years ago:
343qwm29 wrote...
I'm making a shooting game with multiple levels and I was wondering how to have the game go to the next level once the enemies in the level are eliminated, can somebody please help?
Add an
act
method to your
World
subclass and check to see if any enemies are in the world.
isTouching is not working.
By denizkb, with 1 reply.
Replied to by danpost, almost 7 years ago:
denizkb wrote...
The code below is in my sprite class, when the sprite touches any enemies it goes to the location however the life counter doesn't decrease. When I remove the code below, the sprite doesn't go to the location and goes through the enemies but it decreases the life counter. << Code Omitted >>
Please show your current entire
checkObstacles
method.
Lives not decreasing when hit an obstacle
By denizkb, with 2 replies.
Last reply by danpost, almost 7 years ago:
Lines 398 through 401 does not help in your
sprite
class. Also, I would think you would want
touchingObstacles
to be
false
at line 413.
My Score Is Not Incrementing When I Pickup A Coin
By denizkb, with 6 replies.
Last reply by denizkb, almost 7 years ago:
danpost wrote...
denizkb wrote...
<< Code Omitted >> This is MyWorld code if that helps. I am still stuck and the score is not incrementing ;/
Change line 132 to: <Code Omitted>and line 150 to <Code Omitted>If problem persist, show sprite class next.
Thank you so much, the score now increments whenever I collect a coin. I would kindly like to ask if you could help me with the lives counter:
https://www.greenfoot.org/topics/61747/0#post_130426
error message can't open scenario
By g.baessler, with 1 reply.
Replied to by danpost, almost 7 years ago:
g.baessler wrote...
The world could not be constructed. The world subclass may not have a public constructor without parameters, or may not be public
Obviously there is something amiss with your World subclass code. Show code for help.
I struggle with giving my actor reversed controls
By Tommes, with 2 replies.
Last reply by Tommes, almost 7 years ago:
Thank you! You helped me a lot!
213
214
215
216
217
218
219
X