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 do I stop my actor(Fbot) from passing through the walls?
By anderslieww, with 8 replies.
Last reply by RcCookie, about 4 years ago:
If your walls are stationary, this should work: <Code Omitted>
i want top score ,i used static variable to store problem
By venkatesh438, with 2 replies.
Last reply by venkatesh438, about 4 years ago:
thanks bro
Problem with getting a variable
By Turbo_Thorsten, with 8 replies.
Last reply by danpost, about 4 years ago:
Try this for line 34: <Code Omitted>
Power Up Problem
By Gabe1098, with 1 reply.
Replied to by Gabe1098, about 4 years ago:
of I updated it
Boolean and Return
By Gabe1098, with 2 replies.
Last reply by Gabe1098, about 4 years ago:
danpost wrote...
Gabe1098 wrote...
hello I am very new to greenfoot and I have been doing discussions a lot lately so can you please do a simple explanation about boolean and return
Boolean: the
boolean
data type has only two possible values:
true
and
false
. Use this data type for simple flags that track true/false conditions. Return: the
return
statement is used to immediately exit a method. In a method whose return type is declared
void
, it is used to force an immediate exit so that the following lines of code in the method do not execute. In a
Character movement
By Shinnaru, with 2 replies.
Last reply by Shinnaru, about 4 years ago:
Works now, I just noticed I had a method checkWall() which prevents my character from touching and/or going through the wall, so the if statement(Line 12) was not running.
How do I check after all of an actor is gone, then print "GameOver"
By anderslieww, with 3 replies.
Last reply by anderslieww, about 4 years ago:
Thanks it worked! :)
VARIOUS
By ronald, with 44 replies.
Last reply by ronald, about 4 years ago:
thank you
i want to transparent particular part only
By venkatesh438, with 4 replies.
Last reply by venkatesh438, about 4 years ago:
thank you so much....
Quick question will Greenfoot work on rosetta 2
By coder123, with 1 reply.
Replied to by RcCookie, about 4 years ago:
Since Rosetta 2 should be able to run x64 based programs for Intel it should work. But I don’t have a Mac
Hi I need help coming up with an if statement
By Icup, with 8 replies.
Last reply by danpost, about 4 years ago:
Icup wrote...
What I mean is like my 2 pong pieces keep going off the screen when I move them like I can go beyond what I can see and make them disappear and I don’t want that to happen
Show class codes for pong pieces. Also, show first line in your world's constructor (it would start with "
super(
"...)
Why can't my object change the Image?
By Turbo_Thorsten, with 2 replies.
Last reply by Turbo_Thorsten, about 4 years ago:
Ah yes I'm always missing sth thank you
addObject() or setImage() won´t work
By elektro, with 2 replies.
Last reply by danpost, about 4 years ago:
You need an
addObject
line to put
question
in the world.
How do you make a grid in a non grid world?
By Darkstep, with 1 reply.
Replied to by danpost, about 4 years ago:
Darkstep wrote...
I know you have to use a GridActor for actors going into the grid and a separate actor class for the actual grid itself
Actually ... no. You do not have to use
GridActor
(specific to a grid world) and you do not need an actor for the grid (grid can be drawn onto the world background). All coordinates will be based on "cell" width A virtual 0 coordinate would be just half a "cell" width. A virtual 1 coordinate would be one and one-half "cell" widths. All are half a "cell" width plus the virtual coordinate times a "cell" width.
How to addObject in constructor of an actor class
By Nicole05, with 1 reply.
Replied to by RcCookie, about 4 years ago:
The problem is that when the object is created it is not in a world yet. So, it has to add itself to the world first, then it can add other objects. These information have to be passed into the constructor. <Code Omitted>By doing so you can also replace this <Code Omitted>with this <Code Omitted>
64
65
66
67
68
69
70
X