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
Boxworld
By Hypergyra, with 8 replies.
Last reply by Hypergyra, about 7 years ago:
Nevermind my question about the multiple worlds. I have found the answer. I decided to make an extra player, box, point etc... subclass that only works for the second world.
ALST CLASS MISS U OOP
By jasmag21, with 2 replies.
Last reply by vinay365, about 7 years ago:
I am going to miss you all :-(
Enemy follows actor
By FarbKlexx, with 5 replies.
Last reply by danpost, about 7 years ago:
FarbKlexx wrote...
How do i declare that?
<Code Omitted>It would still need to be assigned the player object.
The question about the color of text in Greenfoot coding application
By DrakeGuo, with 2 replies.
Last reply by DrakeGuo, about 7 years ago:
Thanks a lot
Shooting Direction
By Verglas, with 5 replies.
Last reply by Verglas, about 7 years ago:
Thank you very much! Works perfectly after having to change some of the rotation angles. I don't know why but it seems that the bullet is facing right when the program starts; right is 0, down is 90 and so on. Took me a few moment to realize XD.
making several rows of enemys in (myWorld) without getX() ???
By isAtEdgeForNoReason, with 1 reply.
Replied to by danpost, about 7 years ago:
Line 16 is only making a 1-pixel difference in their positions in the second row.
Key activated Door
By Thotson, with 5 replies.
Last reply by danpost, about 7 years ago:
Thotson wrote...
<< Code Omitted >>
Have the
Isaac
actor check for the key and remove it. The key should not do anything (except maybe move -- but it probably does not anyway).
Regarding an error we are receiving
By Joyfu1, with 2 replies.
Last reply by Joyfu1, about 7 years ago:
Thank you!
Referencing methods from other actors
By LegitTeddyBears, with 2 replies.
Last reply by LegitTeddyBears, about 7 years ago:
I just tried this, now it says that the x in this.x isn't public and therfore can't be cannot be accessed from outside the package. Edit: I replaced this.x with getX() and it conpiled! Thank you
Fixing if objects are intersecting
By The_bazm, with 3 replies.
Last reply by danpost, about 7 years ago:
The_bazm wrote...
ok. my current situation is that if the player is for example IN a block he should get teleported on the block. This is fine and also works. But my problem is that when the player even touches something he gets teleported up, too. For example if there is a jump and you would touch the wall or an element at the bottom normally the player just should continue falling. But now he teleports because of this method up and you can skip the whole level.
Sounds like a jump-and-run type scenario. You will probably have to deal with horizontal and vertical movements separately
Starting using Enter
By Thotson, with 3 replies.
Last reply by danpost, about 7 years ago:
The only way to run a scenario from a stopped state is by clicking the "Run" button. You can have your scenario start automatically and then wait for "enter" to be pressed while in a running state as the following depicts: <Code Omitted>
Put objects automaticly into my world
By Gre3n0, with 2 replies.
Last reply by danpost, about 7 years ago:
Gre3n0 wrote...
Which code do I need if I want to put objects in my world if I press run? I mean that the objects get placed by greenfoot.
I believe you want to use the
started
method of the
World
class.
Cannot Remove Acto in myWorld when I Click another Actor
By AlexandraGrace812, with 1 reply.
Replied to by danpost, about 7 years ago:
Move line 21 to outside of the method. As is, you are creating a different
selector3
object every
act
step; so, if one is added to the world, it will not be referenced when it is time to remove it. A different
selector3
object (the one created on that act step) will be referenced.
I want my rain drops to fall down vertically. What is the code.
By lucky555, with 8 replies.
Last reply by danpost, about 7 years ago:
lucky555 wrote...
We want the Bone class once it is touched by the Dog class to pile up the bones in the right corner of the World.
You want to add a new state to the bones. The state of being collected or not. States are described by fields. Since there are only two possible states for collected (being or not being), a
boolean
field is in order. After line 43, add code to check for an intersecting
Dog
object. If found, find a place in the corner for the bone and switch the
boolean
value. Since the bone must cease and desist in this state, add the following at
Help using showtext and simple integers
By CROCKETTROCKETT4, with 2 replies.
Last reply by CROCKETTROCKETT4, about 7 years ago:
I owe you my life. Thank you Danpost
183
184
185
186
187
188
189
X