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
Please explain how to work this
By ipeefreely, with 3 replies.
Last reply by ipeefreely, over 11 years ago:
never mind. someone else explained it but thanks for your reply. I got sum is initialized to be 0. x = 2; x < 6 (true), sum = 0 + 2 = 2 x = 3; x < 6 (true) sum = 2 + 3 = 5 x = 4; x < 6 (true) sum = 5 + 4 = 9 x = 5; x < 6 (true) sum = 9 + 5 = 14 x = 6; x < 6 (false) The program terminated The last value of sum is 14 I didnt understand how to distribute the handy chart you provided but now I understand
Coding Help
By Code10, with 2 replies.
Last reply by danpost, over 11 years ago:
Code10 wrote...
ive tried using If ObjectClicked(actor) do this: AddObject(actor)
This is an improper way of showing what you have tried. You need to show the actual code you tried. Please read the 'Posting code? read this!' link below the reply box before posting the actual code you tried.
Gameproblem
By AdventureGameDE, with 8 replies.
Last reply by AdventureGameDE, over 11 years ago:
ok thx
multilevel counter.
By possumprior, with 10 replies.
Last reply by possumprior, over 11 years ago:
Thank you so much danpost what u said worked
Double actor trouble
By Corrupted, with 21 replies.
Last reply by Corrupted, over 11 years ago:
Thank you, if works perfectly! I get an error at the end when the player dies, but I'll be able to fix that myself. Once again, thank you!
Need some help with character moving
By ac130kire, with 1 reply.
Replied to by danpost, over 11 years ago:
Gravity is just a continuous adding to the vertical velocity. That is, represent the vertical speed of your character with a field (instance variable) and add a constant (gravity) to it every act cycle (continuous adding). Do not forget to use the field when moving the actor vertically. Using the background color would be very tedious -- especially since there are already methods available in the Actor class to check for intersection with other objects. Create Actor subclasses for the objects that represent Ground or Platform (black); also, do the same for the Gate or Door (red)
How do you get the act() method for world classes working?
By 298812kl2, with 1 reply.
Replied to by davmac, over 11 years ago:
I think you should read that API documentation more carefully:
This method does nothing. It should be overridden in subclasses to implement an world's action.
That gives you the answer to your question. Incidentally, the wording is almost the same as for the Actor's act method:
The default implementation does nothing. This method should be overridden in subclasses to implement an actor's action.
In other words, the act() method for the World and Actor subclasses works in exactly the same way. The only difference is that when you create an actor subclass, the class wil
Problem With Bouncing
By Tommy99, with 7 replies.
Last reply by Tommy99, over 11 years ago:
I made a few changes and it now works perfectly. Thanks for the help, danpost and davmac.
A question about Frames
By akkartik, with 2 replies.
Last reply by akkartik, over 11 years ago:
I have no idea what or where the greenroom is. But whatever.
attempting to make a recharging meter that stops an action if it is spent
By Spooks, with 8 replies.
Last reply by danpost, over 11 years ago:
You could add a boolean field and call it 'charging'. Use it to prevent boost, if charging, until recharged (when 'rechargemtr == 100', set 'charging' back to false). Set the 'charging' field to 'true' when 'rechargemtr == 0'. Only recharge ('rechargemtr++') when 'charging' is true). So, you would be doing the following two sets of steps at various places in your code:
How do I get my bluetank to move correctly and to stop going through the wall. I dont want the tank to get stuck, but to rather slightly bounce off.
By thenextsuperman, with 2 replies.
Last reply by danpost, over 11 years ago:
Moving is not the only thing here that may cause a collision with a Wall object. Rotating the actor may also be a cause. Therefore rotation must also be negated if it causes a collision. The following may be closer to what is required:
Carry score
By StuDent463212, with 8 replies.
Last reply by danpost, over 11 years ago:
StuDent463212 wrote...
I'm getting an error "<Identifier expected>" Between the first 'getScore' and the '()' in the second line
Show the code you are using. Cannot fix unseen code. This not only means what you used by my suggestion, but also the 'setScore' method in your world class as well.
not a statment error?
By Spooks, with 5 replies.
Last reply by Spooks, over 11 years ago:
danpost wrote...
Spooks wrote...
I figured it out, you cant do the exclamation point when calling a method
Actually, you can. But it would not make any sense to do it alone; and the method would have to have a boolean return type. For example, it would make sense to use it in the following ways:: <Code Omitted> Using any one of the following is meaningless:
[Help] Make object Follow Another Object Movement
By fayde, with 6 replies.
Last reply by danpost, over 11 years ago:
darkdaser wrote...
What do you meen with "dx" and "dy"?
The refer to the positional offsets (the amount of movement) along the horizontal and vertical axes -- the change in value of the location coordinates for the given movement.
interaction with object/ object dropping garbage
By dionyman, with 2 replies.
Last reply by danpost, over 11 years ago:
Work on one thing at a time. What have you tried as far as the children dropping garbage?
563
564
565
566
567
568
569
X