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
How to make greenfoot.ask change variable of something?
By dave6969, with 5 replies.
Last reply by danpost, over 8 years ago:
dave6969 wrote...
And if I want to have 2 questions and 2 answers do i do << Code Omitted >> ?
Well, you would most probably change the question. If the questions are to be back-to-back, you can re-use
input
(so instead of <Code Omitted>you could just use <Code Omitted>and parse it to the new field.
Scenario stopping when switching worlds
By mulon, with 1 reply.
Replied to by danpost, over 8 years ago:
mulon wrote...
My code was working before when the argument of the if statement was based on where the mouse was, but now after I have changed it, the scenario stops when switching to a different world. What can I do to make the scenario not pause? << Code Omitted >>
Nothing in the code given would be the cause of the scenario stopping. Must be something you changed elsewhere (or a bug in greenfoot, which I doubt in this case). If you are getting an error message, please show. If not, you probably have a
Greenfoot.stop()
command stopping the scenario. One improvement, howe
Need help with delay
By Kachima, with 7 replies.
Last reply by danpost, over 8 years ago:
Kachima wrote...
and can i run it infinitely with this method? because thats the point of the game, the longer you survive the more points you get
Correct.
My project doesn't finish compiling
By DSB, with 3 replies.
Last reply by danpost, over 8 years ago:
DSB wrote...
Thank you. Is there an easy, simple way to turn a png image into a java image?
<Code Omitted>The
getAwtImage
method has been available almost from the beginnings of Greenfoot.
Need help returning int from other class
By Game4Lols, with 3 replies.
Last reply by danpost, over 8 years ago:
Game4Lols wrote...
Basically, I have four "Worlds" that the character can be in, and by walking to the end of the screen, it will change the "world" to a new one by changing the background. I also have the barrel, which I only want to be visible if the player is in the same world as the barrel. The "Worlds" is just top left, bottom right etc. So the int world has a range of 0-3. I want barrel, (Who is given a random world of its own at the start,) to find the players world, and hide if it's world isn't the same.
You are having the barrel constantly check on the condition that the playe
I'm trying to add an object onto my World but it doesn't seem to work. Can someone tell me what I'm doing wrong
By Comp, with 10 replies.
Last reply by danpost, over 8 years ago:
Comp wrote...
A terminal window popped up relaying the message but only a couple of times.
Every time it does work, a new VikingLifeEater object IS placed into your world and should by all rights remove a Life object from the world (provided you are placing them properly in the world).
I’m making a sort of zombie game
By NervousNeep, with 25 replies.
Last reply by NervousNeep, over 8 years ago:
Never mind I got it
i'm trying to make a "tank trouble" game for school
By Sean, with 3 replies.
Last reply by danpost, over 8 years ago:
Sean wrote...
when the tank touches a bullet the program crashes. I also need some help getting the Tanks to fire bullets in the first place. I think i could figure out the shooting part if someone can help me with the bullets hitting the tanks
Show class code for bullet.
Score counter won't work
By Prox276, with 12 replies.
Last reply by Prox276, over 8 years ago:
Ok, thanks a lot!
I'm making a brick breaker game for a school project. I was wondering what code to write for the ball to bounce back in the angle it came off of walls/paddleboard?
By RSekander, with 1 reply.
Replied to by danpost, over 8 years ago:
RSekander wrote...
I am completely lost for the bounceBack method. How do I get it to bounce back of the same angle it came in? << Code Omitted >>
Bouncing off a wall will involve changing horizontal direction while bouncing off a paddle will involve changing vertical direction. That being said, you should split up the conditions into two separate
if
statements.
Is it possible to add two of the same object - sidewalls? It wont show up on the screen.
By RSekander, with 2 replies.
Last reply by RSekander, over 8 years ago:
Thank you, I got it :)
java.lang.NullPointerException
By raging_ewok, with 4 replies.
Last reply by Yehuda, over 8 years ago:
You were not supposed to remove the whole line.
danpost wrote...
Remove the first
Scoreboard
from line 28
Have the following as line 28: <Code Omitted>
How to created a quiz in Greenfoot
By eliass, with 1 reply.
Replied to by Yehuda, over 8 years ago:
What part are you having trouble with? (See
here
.)
How to show a you lose screen at zero points.
By AliZahid28, with 1 reply.
Replied to by Yehuda, over 8 years ago:
More information is necessary to give a detailed explanation for your scenario. Where is the counter variable and where are you trying to access it from? Why do you not just have the game over code in the class that has the counter variable? <Code Omitted>
How to check if actor is touching a certain color
By Zweeg, with 5 replies.
Last reply by danpost, over 8 years ago:
Zweeg wrote...
@danpost could you provide some example code? I'm not quite sure how to use getOneIntersectingObject or how to use it to become useful in this case
Would rather see if a better way is available. But: <Code Omitted>should be how to get going.
254
255
256
257
258
259
260
X