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
Help moving 1 tile at a time.
By mullac51, with 3 replies.
Last reply by danpost, almost 12 years ago:
The best way is to add an instance boolean field to the class, similar to how firing was described at the bottom of
this discussion page
. You will, however, need to use a combination of checks (one for each key):
Non rectangular object borders in Greenfoot
By classicjimmy, with 9 replies.
Last reply by classicjimmy, almost 12 years ago:
Thanks I will check those out. Dividing the objects into parts is a great idea and definately something I will use for simple pictures. For more complex pictures its too much work I think..
Referencing a variable across worlds
By Hersov, with 8 replies.
Last reply by davmac, almost 12 years ago:
The command getWorld will return the world that's currently 'active' or the world the codes resides in.
No - it returns the world that the actor is in, which isn't necessarily the active world. If the actor is not in any world, it returns null (even if there is an active world).
getImage complications....
By Alwin_Gerrits, with 12 replies.
Last reply by Super_Hippo, almost 12 years ago:
It is often not good to fix these 'non-static variable from static context' errors with making it static. But there are useful moments when to use it. :) Updated Insect Wars and the Bomberman game lately. Right now, I am not working on anything. Sometimes I have an idea and then, I try to add it. ;)
Counter
By lozzi96, with 2 replies.
Last reply by Alwin_Gerrits, almost 12 years ago:
So prety much just add a counter and up it in your method that makes the point disappear. Then call that counter if you want to know how many points have been collected. If you want to ask how much the counters value is from another class just declare it as a public (so 'int counter' outside of any method but inside your class)(not really called public, but works the same) and use newVariable = point.countername. Then just print newVariable or whatever name you gave the variable you want to hold the score. You could allso just print point.countername (by the way, point is your classname for th
Next level if certain coordinates
By M_Slofstra, with 21 replies.
Last reply by M_Slofstra, almost 12 years ago:
Thanks for your help guys, I finally managed to upload the first version, after days without internet. This is the URL to my game: http://www.greenfoot.org/scenarios/12469 You're right, Alwin_Gerrits. But it's kinda strange that teachers won't help much, so I'm really happy that you guys exist :p
Changing Random Int to String
By xxPythonslayeRxx, with 5 replies.
Last reply by xxX_Muffin.man_Xxx, almost 12 years ago:
<Video Omitted> happy halloween
Enemy health wont work.
By Srax, with 4 replies.
Last reply by Srax, almost 12 years ago:
davmac wrote...
i don't really know how to fix that :(
The problem is that you can't call the atWorldEdge() method once the actor has been removed from the world. The way to fix it is to change your code so that it doesn't call the atWorldEdge() method if the actor has been removed from the world. :) There's a full explanation
here
. Many other people have experienced this problem. I suggest you try a search, in future, to see if others have encountered your problem and whether they found a solution. In t
Have enum classes and Actor classes in the same array?
By Entity1037, with 10 replies.
Last reply by danpost, almost 12 years ago:
Entity1037 wrote...
Oh! I didn't know Objects was a type you could use.
Just to clarify -- it is not 'Objects', but 'Object' as the name of the class.
Wait, it doesn't work if I put "Enemy.class" in the array.
An array of Object type will accept all values and objects (provided they are defined and referred to properly). I would think it goes without saying that 'void' is not a valid entry as all elements are 'null' (not 'void') to begin with.
Change order of objects (One over the other)
By HaselnuesseTo, with 6 replies.
Last reply by Super_Hippo, almost 12 years ago:
Alwin_Gerrits wrote...
The last thing you add is going to be on top. Because it is the last layer added to the world. Please correct if I'm wrong.
It's the other way around, the first class will be on top of the others, then the second and so on.
End of game audio/ scoreboard working on PC, but not Greenfoot website?
By Gish, with 15 replies.
Last reply by davmac, almost 12 years ago:
Yes, we are working on it. No, I do not know when it will be resolved. :)
Shooting delay
By Srax, with 6 replies.
Last reply by Srax, almost 12 years ago:
Okay, i'll try again, Thanks.
Where to download a stick man scenario
By cloud41910, with 2 replies.
Last reply by danpost, almost 12 years ago:
I did find one downloadable 'stickman' scenario here. I believe it was scenario 1017.
cannot find symbol add score problem
By coder04, with 1 reply.
Replied to by danpost, almost 12 years ago:
Not enough info. What is 'multiplayerspace', as far as being a variable/field? How is it defined?
Wave
By xoiam, with 3 replies.
Last reply by danpost, almost 12 years ago:
I came up with the following, where the frequency is around the number of cycles across a 600 pixel wide world: <Code Omitted>The first three lines can be instance fields instead of local variables (or even class constants, if desired).
638
639
640
641
642
643
644
X