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
Can sombody tell me why the game does not work in the second space world?
By stijn.b, with 5 replies.
Last reply by danpost, 5 months ago:
One way to "fix" it is as follows (in
Shot
class): <Code Omitted>Although there is probably an easier way -- like having an intermediate class between
World
and the two space worlds (maybe
Can sombody tell me why the game does not work in the second space world?
By stijn.b, with 14 replies.
Last reply by danpost, 5 months ago:
stijn.b wrote...
<< Codes Omitted >>
What about the
Space2
class code?
How to make a loot dropping system with chance attached to it
By Deepfist, with 2 replies.
Last reply by Deepfist, 6 months ago:
Ok thx, didn't know that getRandomNumber also worked like that so that's my bad
How can i invert this code
By Hhe, with 2 replies.
Last reply by Hhe, 6 months ago:
OMG youre right
Greenfoot uploading old version of my game
By BigCakeTwo, with 1 reply.
Replied to by danpost, 6 months ago:
BigCakeTwo wrote...
I have tried to upload a scenario to this website however when I launch the scenario on its page it plays an older version, which loads into a test scene I used while developing the game. I have tried deleting the test scene from the scenario project files before uploading it and uploading it under a new name but the scenario still loads into the deleted test scene instead of the actual game. Is there some way to fix this problem or is my project just broken?
If deleting the files by way of file directory actions, you need to delete ALL 3 files related to the test sc
I wanna play an explosion animation using 14 images i have of the explosion
By KCee, with 7 replies.
Last reply by danpost, 6 months ago:
KCee wrote...
How do i make the animations play out faster? I tried manipulating the numbers in setImage but its giving me errors like << Error Trace Omitted >> << Code Omitted >>
The number that needs changed appears several times in the
setImage
method. Also, it should probably be a constant for the
Explosion
class: <Code Omitted>Your
setImage
method can then be modified to this:
How to make a damage and kill system with one bullet and multiple different health values for actors
By Deepfist, with 8 replies.
Last reply by Deepfist, 6 months ago:
Well that was easier than expected, thx
Make image only flip once
By TanishStIves, with 10 replies.
Last reply by TheGoatFighter, 6 months ago:
Naaaa Yototrth
How to remove Bullet from world
By RandomGuy, with 81 replies.
Last reply by TheGoatFighter, 6 months ago:
The goat wrote...
if(isAtEdge()) { getWorld().removeObject(this); }
There you go, ask help from me, not danpost, i the goat
How do i stop music from playing in when i switch to a certain world?
By LuukTheGamer, with 3 replies.
Last reply by TheGoatFighter, 6 months ago:
Danpost 1v1 on me fortnite, luuk the game get of greenfoot and add me on fortnite. Danpost in not a life save he hasnt answered my worries.
terminal window because isatedge
By gijsdevries, with 2 replies.
Last reply by TheGoatFighter, 6 months ago:
This code is so easy, danpost 1v1 me on greenfoot on the 21st September 2029
need help with transferring the score counter to a new level
By Merten, with 3 replies.
Last reply by danpost, 6 months ago:
Merten wrote...
i have done that but now at the end of level 2 the game crashes when i hit an enemy. error: java.lang.NullPointerException. this is at class Kogel, line 80
Along with the
addObject
line you inserted above, also add the following line: <Code Omitted>(and similiarly with other level changes)
I get a terminal window for whatever reason
By gijsdevries, with 1 reply.
Replied to by danpost, 6 months ago:
gijsdevries wrote...
i get a terminal window because of the line of code at rule 16. does anyone know how to fix this? when i remove rule 18 it works fine but i need that rule in my code << Code Omitted >>
The problem is that when you remove this actor from the world in the
vermoordMonster
method, then go back to the
act
method, it then calls the
vermoordNachtbaas
method, which require the actor still be in the world. Easy fix is to either change line 11 (in
act
) to: <Code Omitted> OR, insert the following line
How do can i make a class follow another class around the world?
By Rainescap, with 7 replies.
Last reply by danpost, 6 months ago:
Rainescap wrote...
how would i start the code for the collision?
What type of actors is the
Shield
instance protecting the spaceship from?
HELP ASAP
By envxity, with 1 reply.
Replied to by danpost, 6 months ago:
envxity wrote...
so i ruined my game that i was making and now it barely works like it was meant to here is the source code its due today. so pls help << Codes Omitted >>
I did notice that in multiple places you have images being created continuously (every act frame). Image creation/manipulation can be a hog on CPU time and may cause some lagging. Also, I noticed that you have the health bar and the counter doing things they should not. GUI objects, as such, should be prompted to do things, not do them on their own -- and only do those things when required. In other words, they
3
4
5
6
7
8
9
X