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
Problems with variables
By Etch-a-sketch, with 1 reply.
Replied to by danpost, over 8 years ago:
Etch-a-sketch wrote...
I'm relatively new to greenfoot and have been asked to do a falling leaves project for one of my classes. This is the code: << Code Omitted >> The errors are occuring with the actor not being able to move
The
once
on line 10 is not the same
once
that you declared on line 3. On line 10, you are declaring a new variable that is local to the method (its scope extends only for the execution of the method). The use of
int
at the beginning of the line is what defines the declared variable. By removing it, the one declared on line 3 will be, by
All Actors freeze when i want to freeze on thread
By MrCaspar, with 1 reply.
Replied to by danpost, over 8 years ago:
MrCaspar wrote...
Everytime two Actors meet dealdamage() is called and they should only deal each other damage every 1.5 seconds but every actor extending Enemy Freezes for 1.5 seconds. How can i delay the damage dealing but nothing else? << Code Omitted >>
It is probably not a good idea to work with threads in
greenfoot
. Better might be to use
int timer
fields.
Change Username without losing projects?
By Evil12345678910, with no replies.
Hey folks, is there any way of changing my username in Greenfoot? I wanted to update and make my page a bit more professional. Any way I can do this? Do not really want to create a new account and re-submit all of my projects again as that might get rid of my views and likes on my games. Thanks,
How can i access a World from neither an Actor nor a World
By MrCaspar, with 3 replies.
Last reply by MrCaspar, over 8 years ago:
Ah ok works now: <Code Omitted>
Boss Health Bar not Updating
By Nines, with 1 reply.
Replied to by danpost, over 8 years ago:
Nines wrote...
I need the value to change as the player's attack hits the boss. Currently the bossHealth value only changes in one class and not the other. This is an issue because I draw boss health bar in a separate class but directed greenfoot to look in the specific class that contains the health value to update it. ... I do see it just that it doesn't decrease as bullets hit the boss. << Code Omitted >>
You see it, but did you actually check its value. After you believe it should have decreased, do the following: * pause the scenario * right-click on
BossHp
object *
space invader barriers
By ogy2014, with 33 replies.
Last reply by ogy2014, over 8 years ago:
100% sorted
make actor complete a loop?
By kevoncmlc2000, with 6 replies.
Last reply by kevoncmlc2000, over 8 years ago:
ok, i'll work with this. thanks so much
Actor not in world - Error at the End of the game
By fabipfolix, with 5 replies.
Last reply by danpost, over 8 years ago:
fabipfolix wrote...
danpost wrote...
Line 29 is asking the wrong thing. Currently, it is asking if a List object is returned; but, what you need to ask is if the List object that is returned (and one will be returned) is empty or not.
Doesn't that mean it has to be <Code Omitted>But that doesn't work as well.
You cannot blindly check the first element of a list without first checking that a first element exists. Use the
isEmpty
method of t
incompatible types: java.lang.Class<lifeboard> cannot be converted into greenfoot.Actor
By ogy2014, with 68 replies.
Last reply by ogy2014, over 8 years ago:
oh i am officially dumb i had it set as a png when it was a jpg sorry for the waste of time
IndexOutOfBounds Exception?
By aayu1004, with 1 reply.
Replied to by danpost, over 8 years ago:
aayu1004 wrote...
Hello, I have an actor that is support to teleport to a different location as soon as its x position reaches a certain value. But for some reason, the program is giving me this exception: java.lang.IndexOutOfBoundsException: X is out of bounds. It was: 485 and it should have been smaller than: 37
Please show (copy/paste) the entire error output.
What does this mean and how can I solve it? << Code Omitted >>
This cannot have anything to do with the error. However, it will cause the actor to jump back and forth between the "edges" if landing at one
Book Scenarios from First Edition - updated?
By stevex, with 6 replies.
Last reply by danpost, over 8 years ago:
stevex wrote...
No version of Greenfoot ran any book scenario that I have tried. Version 3.1.0 updates the code so it compiles, but nothing happens hitting the run button for the 2 scenarios of chapter 1 for instance, Wombats and Asteroids.
The only problem I see for the Wombat scenario is that the
WombatWorld
constructor does not call the
populate
method.
Toggle between Java & Stride
By mark.hayes, with 5 replies.
Last reply by mark.hayes, over 8 years ago:
Many thanks.
Getting the error "java.lang.IllegalArgumentException: java.io.FileNotFoundException: Could not find file: (file)
By Lev, with 1 reply.
Replied to by danpost, over 8 years ago:
Lev wrote...
I'm making and have encountered an error that I cannot fix at all. java.lang.IllegalArgumentException: java.io.FileNotFoundException: Could not find file: RogueUpA
The file names are missing their extensions (".jpg", ".png", or ".gif").
getIntersectingObjects - Enemy takes Damage from Bullet
By fabipfolix, with 14 replies.
Last reply by fabipfolix, over 8 years ago:
danpost wrote...
fabipfolix wrote...
And how can I solve this problem?
Change the conditional operator (currently ">=") to something more appropriate.
Thank you, i missed, that it was the false one ^^ Now it's working :D
How do I make this actor, addObject of some other actor?
By JOELwindows7, with 7 replies.
Last reply by danpost, over 8 years ago:
JOELwindows7 wrote...
Greenfoot, Please don't detect spam this way where I have to wait 24 hours. if the the thread got expired, everyone will think helpers or programmers are ignorant!
They want to make sure you are not spamming or promoting another site. This only happens the first time you add a link into a post (usually).
252
253
254
255
256
257
258
X