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
I am having a problem with java.lang.NullPointerException
By itavares, with 2 replies.
Last reply by itavares, over 9 years ago:
It worked ! Awesome , thank you so much for the help danpost ! :)
Removing Object - Nothing happens?
By idk1234, with 15 replies.
Last reply by idk1234, over 9 years ago:
The else code doesn't seem to work, I'm trying to get a random number out of 100, a survivor gets removed depending on if the number is above 50 or below 50.
I want my actor to hold a gun
By Amadeus, with 6 replies.
Last reply by danpost, over 9 years ago:
Amadeus wrote...
Yeah that indeed looks like a better way to do it. Gonna put it in my code thank you, the only thing why i didnt do it this way from the start on is, that i am new to programming and this is my first project, so i do not know so many possibilitys yet.
Yeah. Well, it is always best to have whatever action an object type does should go in its class. That is, for example, a player holds a gun and carries it around; so, that part should be programmed in the class of the player. A gun fires a bullet; so that part should be programmed in the class of the gun. The gun coul
Trouble with health deduction
By StoveAteMe, with 1 reply.
Replied to by danpost, over 9 years ago:
The problem is due to the fact that you are using two different collision methods in your Hit method (namely 'getOneObjectAtOffset' and 'isTouching'. The first one is more limited than the second one and will be 'null' for multiple act methods while the other one returns 'true'. So, nothing is removed from the world and health is decreased four times, to zero, on four consecutive act cycles. There is another collision method you could use to fix this. Instead of using the 'getOneObjectAtOffset' method, and since you do not need a reference to any rocket unless you are actually touching o
Game wont end when counter hits 0.
By Bluedino_, with 2 replies.
Last reply by Bluedino_, over 9 years ago:
I found the problem, i had it miss spelled hahaha. Thanks anyway!
Hit method assitance
By StoveAteMe, with 6 replies.
Last reply by StoveAteMe, over 9 years ago:
Oh okay, the issue was your second suggestion, it's working as I want now. Thanks for your help!
Animated pictures
By The_Shados, with 1 reply.
Replied to by danpost, over 9 years ago:
The_Shados wrote...
Is it possible to use animated pictures in greenfoot.
The extend of which animation is possible in greenfoot is demonstrated in my
Animation Suport Class
scenario. Of course, the images in my demo were created within the demo, but you can use any set of images to create an animation.
sound keeps playing wont stop
By Solidchainss, with 1 reply.
Replied to by danpost, over 9 years ago:
On line 33, you are creating a new GreenfootSound instance of the same song. This is not the instance that is already playing -- so stopping it will not stop the sound from playing. You need to keep a reference of the one that is playing and stop it: <Code Omitted>Removing the preceding 'GreenfootSound' from line 23 allows 'sound' to refer to the instance field instead of creating a local variable with th
Snake type game
By IL3107, with 1 reply.
Replied to by danpost, over 9 years ago:
IL3107 wrote...
I'm trying to create a snake-type game but I can't work out how to make a new spot appear when the first one is eaten (I am very bad at coding, sorry).
Instead of removing the first dot, just relocate it.
Prevent Collision With Transparent Object
By SnapDraggen, with 1 reply.
Replied to by danpost, over 9 years ago:
I would suggest using what is called perfect pixel collision, which checks the color of the map. I do not know if this is possible with your scenario and it is quite elaborate and CPU time consuming. Better might be to add transparent Intersection objects that tell the actors which directions are available at its location. One at each possible turn location is all that is required.
I need to make a speedometer
By AngelusNeko13, with 3 replies.
Last reply by AngelusNeko13, over 9 years ago:
okay, thanks ill see what i can do
Switching images
By RedBird420, with 2 replies.
Last reply by RedBird420, over 9 years ago:
I'll try it out. Thanks! I
Sound not playing?
By xlRenn, with 1 reply.
Replied to by danpost, over 9 years ago:
There does not appear to be anything wrong with the code. Do other sounds work? have you checked your sound setting (volume and mute)?
How to access a variable of another Object if more than one Object exists
By Cheiron3000, with 3 replies.
Last reply by danpost, over 9 years ago:
Cheiron3000 wrote...
Thanks danpost, now it works. But I had do put a "(Bullet)" before the getOneIntersectingObject method to ajust the types;P
Apparently, I missed that -- sorry. Good job fixing it, however.
mouseClick function
By GreenMan15, with 8 replies.
Last reply by GreenMan15, over 9 years ago:
After hours of trying to figure this out, I finally understand what to do. I did what you said and use two buttons one for high volume and one for low volume and it works perfectly. Thanks a bunch and Cheers!
474
475
476
477
478
479
480
X