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
How do I make and object point in a specific direction?
By minionlover, with 1 reply.
Replied to by danpost, almost 10 years ago:
minionlover wrote...
An arrow should be told to rotate to face the same direction that a Stylus just moved in. For example, if the Stylus was just moved to the right then the arrow should face east, if it was moved up then the arrow should face north.
Use the 'setRotation' method of the Actor class. If the arrow and the Stylus are two different objects, then maybe the Stylus should keep a reference to the arrow and tell it, the arrow, to rotate when it, the Stylus, moves.
How to spawn object after 3 seconds
By Matchr, with 3 replies.
Last reply by danpost, almost 10 years ago:
You want the timer to increment every act cycle, so do not place any conditions on incrementing it (you do not need the 'i' field; and line 13, the incrementing of 't', should be outside any 'if' blocks). The only thing that is conditional (placed within an 'if' block) is calling 'ObjectRandom', along with resetting the value of 't' back to zero (and that is when the timer has reached the given limit).
Is it possible ?
By ricsipop, with 4 replies.
Last reply by ricsipop, almost 10 years ago:
thank you !
Weird bug?
By Freekywill, with 3 replies.
Last reply by danpost, almost 10 years ago:
Freekywill wrote...
I think you misunderstand, I have thousands of trees and rocks in my world, I think that is the reason I am lagging. Thank you for the help provided, but all I want to know is why the objects wont respawn into my world after I leave the area and come back.
For one thing, half of all your trees in the array are replaced with stones (look at the value of 'i' for both loops in the SpawnStuff method). If they are not in the array, they will not respawn. It would help also, if your array was not so large. You only have 1500 actors (trees and stones together), but you
Need help with stickman activity 3.34-3.37
By YG777, with no replies.
"I have been trouble with stickman activities."
I am having trouble scaling an actor for every object it removes.
By jakob23w, with 1 reply.
Replied to by danpost, almost 10 years ago:
jakob23w wrote...
I know I need to use isEmpty() and size() for a list, but I do not know how to use them
You should explain what you are trying to do, instead of just saying what you think you are going to do. Also, some attempted code usually goes a long way toward resolving issues quickly.
Need help with someone who has 2nd edition book
By Vash_the_Stampede, with 4 replies.
Last reply by YG777, almost 10 years ago:
How do you do those assignment, need help!!!! 3.34-3.37
Text box problems.
By Samas, with 3 replies.
Last reply by danpost, almost 10 years ago:
It is just a "glorified" GreenfootImage class for text. It has constructors and methods to deal with pretty much anything dealing with text. View the class in "Documentation" mode to view it as API documentation. It explains how to use the class. If you are getting errors or exceptions, you should show the code in question along with the message (otherwise, it would be quite difficult to help).
How do I know what element of an object array was clicked?
By SpiderStacey, with 8 replies.
Last reply by SpiderStacey, almost 10 years ago:
Got it. Thanks for the help.
Angry Birds Type of Game.
By iaselen, with 2 replies.
Last reply by iaselen, almost 10 years ago:
Many thanks. I 'll try it.
Greenfoot-source-304 bluej: compile error
By genakoganovich, with 2 replies.
Last reply by genakoganovich, almost 10 years ago:
I'm using jdk1.8.0_92 and Eclipse IDE but it's ok. I solved the problem somehow by adding the project to git repository.
I use a for loop and i'm stuck with an infinite loop
By DuckGod, with 13 replies.
Last reply by DuckGod, almost 10 years ago:
Oh I got it from my friend he was helping me for programming class.
If Loop or While Loop? Or something different?
By gmacias, with 1 reply.
Replied to by danpost, almost 10 years ago:
If you think about the execution of lines 74 through 77 and of lines 79 through 82, you will see that since the location of the ambulance does not change while the loops execute, the loop will never be exited. Therefore, you will continually create cloud objects (one overtop of another) until memory is used up. Using 'if' is sufficient in both places (lines 74 and 79 -- instead of 'while'). It would be best to have your cloud object have a short lifespan. For one thing, so you do not have too many actors which can cause lagging; and for another, so when the car gets back off the sand, they
code not working
By gamingskyrim, with 3 replies.
Last reply by Super_Hippo, almost 10 years ago:
You have to import the List class. <Code Omitted>
Snake game- length of snake
By nush99, with 2 replies.
Last reply by nush99, almost 10 years ago:
okay, thanks!
439
440
441
442
443
444
445
X