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
Slow Movement
By MAR, with 1 reply.
Replied to by danpost, almost 10 years ago:
What do you really want to slow down? If you want to slow down the animation, use the 'Greenfoot.setSpeed(int)' method; if you want to slow down the movement, you may need to track the speed in more precise measurements than pixels per move (or maybe just adding a delay counter might do the trick for you). It really depends on what variance in speed you will have for the actors and whether it is just one type of actor or all you are referring to.
How do you make an imported counter go up every second?
By luke6728, with 25 replies.
Last reply by danpost, almost 10 years ago:
ryguy wrote...
were do you put for the method for currentTimeMillis();
Your act method seems fine as is. You just need to add the one line I gave you after the 'super' call in your constructor.
Method to check if being simulated
By DogeOverlord, with 5 replies.
Last reply by DogeOverlord, almost 10 years ago:
smh thank you
I am having a problem with java.lang.NullPointerException
By itavares, with 2 replies.
Last reply by itavares, almost 10 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, almost 10 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, almost 10 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, almost 10 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_, almost 10 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, almost 10 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, almost 10 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, almost 10 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, almost 10 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, almost 10 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, almost 10 years ago:
okay, thanks ill see what i can do
Switching images
By RedBird420, with 2 replies.
Last reply by RedBird420, almost 10 years ago:
I'll try it out. Thanks! I
474
475
476
477
478
479
480
X