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
Checking whether an object is of a specific class
By classicjimmy, with 3 replies.
Last reply by classicjimmy, almost 11 years ago:
Thanks, that's really simple and beautiful.
Passing a boolean value to subclass
By Nubbit, with 69 replies.
Last reply by GreenfootStars, almost 11 years ago:
danpost wrote...
The snippet can be simplified to this: <Code Omitted>
This was great! :) Managed to finish the whole thing. THANK YOU SO MUCH danpost and Super_Hippo! You guys are amazingly awesome and have really saved my ass!
Walking and jumping
By JeppDev, with 4 replies.
Last reply by BenMcBen, almost 11 years ago:
danpost wrote...
@BenMcBen, that is not quite how it would work out when calling 'getKey' multiple times. Keystrokes are temporarily saved in a buffer. Think of it as a list where each keystroke value is added to the end of. If the list is empty, 'null' would be returned by 'getKey'. If not, the first item in the list is returned AND also removed from the list. So, any successive call to 'getKey' would return 'null', unless there has been enough time between calls that more than one keystroke could be made -- in which case, the second keystroke would be returned on the second call, etc.
Score Updates, but Proton Charge Does Not
By BryanGSMST, with 11 replies.
Last reply by danpost, almost 11 years ago:
This issue is the result of having more than one field trying to track the same value. You may think that it is easier to get the value of a field from one class to another by doing so; but, that is not the case -- especially when you are using a field that is 'static' (or multiple fields that are 'static'). Here, you have a static field 'protonDelayCount' in your Rocket class and a static field 'value' in your ProtonCounter class. Then you have added a method 'getCharge' (which, by the way, is probably what should have been used in the act method before the 'update' method call). First, '
Image Not Updating
By BryanGSMST, with 1 reply.
Replied to by danpost, almost 11 years ago:
Please refrain from creating multiple discussion threads on the same issue.
Sliding problem in my 2D Game
By MySelfLuls, with 3 replies.
Last reply by danpost, almost 11 years ago:
You could apply more friction (add and subtract 2 instead of 1).
Quick Guidance / Direction for following pathway of dots
By ozcorps, with 15 replies.
Last reply by Super_Hippo, almost 11 years ago:
What? :o
Please help, I want to collect all objects from a certain class and check a specific value of a variable..
By tummie555, with 5 replies.
Last reply by danpost, almost 11 years ago:
Creating a new object type for something that can be dealt with by using a simple int field seems a bit much. And, unless you are adding the Regel object created into the world, the class does not have to extend Actor (you can either remove 'extends Actor' altogether or change it to 'extends Object').
cannot find variable problem
By minimii, with 2 replies.
Last reply by minimii, almost 11 years ago:
Ah, that was the problem :) thanks for your help^^
remove objects with a specified parameter
By Duck_of_doom, with 6 replies.
Last reply by danpost, almost 11 years ago:
Cannot assign elements of the list created by 'getObjects' to a variable that holds an Actor without first casting the element to the Actor class. Try this: <Code Omitted>Here, line 3 typecasts the object element returned from within the list to an Actor and assign it to an Actor variable. Notice that the elements are typed as Object objects within the list itself and that is what they are extracted as.
Lose points whenever object gets eaten
By Coolguy, with 17 replies.
Last reply by danpost, almost 11 years ago:
Show all code related to your Counter object and indicate where each part is located. This would include any line with the word 'Counter' and any code that has any field or variable name that follows 'Counter'.
Velocity
By JamesHughes, with 2 replies.
Last reply by danpost, almost 11 years ago:
'increaseSpeed' was never in greenfoot. It may have been a method in a version of the SmoothMover class, however. Open the code editor on the SmoothMover class and do a 'Find' on 'increaseSpeed' and you will probably find that there are no instances of that character string. Change the view to documentation (in the upper-right of the editor there is a drop-down option box for 'source view/documentation view'). See what method is available for adjusting the speed and use it instead.
Side Scroller, room to room
By Winds, with 2 replies.
Last reply by Winds, almost 11 years ago:
Thank you so much! Out of curiosity, is there any way you can say, if the player is coming from room 3, then in room 2, the player will spawn on the left side?
Prevent Objects From Spawning in the Same Cell
By blairtch, with 2 replies.
Last reply by blairtch, almost 11 years ago:
I created a new method addWombat() <Code Omitted> And called this method in the populate() method and it seems to have fixed the issue!
Code doesnt work?
By JamesHughes, with 2 replies.
Last reply by JamesHughes, almost 11 years ago:
thanks!
639
640
641
642
643
644
645
X