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
Good bounce and direction
By welleid, with 1 reply.
Replied to by danpost, over 11 years ago:
If the 'wheel' of blocks has no breaks between them (there is no space between them), then the wheel on a whole can be treated as a large ball that the pong ball will bounce off of. The rotation of the block contacted should give the actual angle between the two centers (within reason). The calculation for the bounce should be fairly straight-forward.
"Modificationscreen cannot be cast to terrainone"
By mattjonescalday, with 28 replies.
Last reply by davmac, over 11 years ago:
You either need to have a tracksbutton instance in the world, so that getObjects(...) returns a list with an item in it, or you need to maintain a separate reference to the tracksbutton object (in a variable), set that at some point, and use it instead of getObjects(...).
Timer
By vbh, with 1 reply.
Replied to by Gevater_Tod4711, over 11 years ago:
The problem is that your countdown is in the constructor of the world. So it is only executed when the world is built. You have to write the code for the timer (everything after super(...);) into the act method.
mouseClicked on object
By vbh, with 1 reply.
Replied to by vbh, over 11 years ago:
probleme solve :-) i wrote this, that did the trick :-)
Scaling an Image
By K_O_P, with 8 replies.
Last reply by K_O_P, over 11 years ago:
Great! That was, what I was searching for! Thank you, Busch2207!
Help with timers
By Yongjoon, with 1 reply.
Replied to by danpost, over 11 years ago:
Timers are useful only to regulate the rate of speed at which something happens and are not necessary in creating automatic movement to begin with. The running of the scenario, with it executing all act methods on all active objects repeatedly will create the 'loop' required to continuously have your actors do something. For example, just by creating an 'act' method with a simple 'move' statement will cause your actor to move toward the right until it hits the edge of the world just by starting the simulation. <Code Omitted>This repe
Help with rotations
By Neon147, with 3 replies.
Last reply by Neon147, over 11 years ago:
It works, thank you!
Setting my world
By welleid, with 16 replies.
Last reply by danpost, over 11 years ago:
You really do not need a return method, in this instance. It could have been coded as follows: <Code Omitted>
help it says non -static method setSpeed(int) cannot be reference from a static context
By sergiodeleon702, with 5 replies.
Last reply by davmac, over 11 years ago:
Gevater_Tod4711 wrote...
Just change Puck.setSpeed(7); to puck.setSpeed(7); (no capital letter).
This is partially true. You'll also need to do a cast to the correct type. Change this: <Code Omitted> to this: <Code Omitted>
Life code
By GhostSniper, with 2 replies.
Last reply by GhostSniper, over 11 years ago:
So who do I decease the number of lives when my actor gets hit
A method, that affects all objects of a class
By Maddin, with 7 replies.
Last reply by Maddin, over 11 years ago:
Ok thanks, gives me a lot of possibilities :DD
counter probz
By mezboycalday, with 5 replies.
Last reply by Gevater_Tod4711, over 11 years ago:
Oh ok. So when your actor intersects the other object you have to pick it up: <Code Omitted> Then you have to add one to the counter. There are serval ways for doing that. That depends on how your code looks like at the moment: Have you got only one counter object in the world? Have you got a reference to the object in your world class?
How can i upload a game to this website??
By kinchan, with 7 replies.
Last reply by kinchan, over 11 years ago:
oh! I get it. thx!!! XD
[URGENT]Why cannot find symbol - variable gameState
By louis993546, with 1 reply.
Replied to by davmac, over 11 years ago:
For one thing, the variable is defined in the MineBoard class, not the GWorld class, so the variable gameState doesn't exist in the GWorld class. That's why you get "cannot find symbol". For another thing, the variable isn't static, but you are accessing it via a class name instead of via a reference. Try: <Code Omitted>
can anyone help me make a class size bigger
By emma123456789, with 27 replies.
Last reply by emma123456789, over 11 years ago:
i just need the coding:)
836
837
838
839
840
841
842
X