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
remove objects with a specified parameter
By Duck_of_doom, with 6 replies.
Last reply by danpost, about 12 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, about 12 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, about 12 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, about 12 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, about 12 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, about 12 years ago:
thanks!
Illegal start of expression?
By JamesHughes, with 3 replies.
Last reply by JamesHughes, about 12 years ago:
Thanks :) that solved that error
BlackJack Tutorial
By Konzuk, with 4 replies.
Last reply by Konzuk, about 12 years ago:
thank you! It finally works ^^
Need some help with getNeighbours
By Skuggan, with 2 replies.
Last reply by Skuggan, about 12 years ago:
No, no reason at all I'm afraid. I'm just so new at this that it seemed like a good way to do it. Thank you for your help!
turn one way or another
By 11770, with 2 replies.
Last reply by Super_Hippo, about 12 years ago:
You can't write it like this. Instead, you can create a new random number and 50% of the time, you turn clockwise and 50% counterclockwise. <Code Omitted>
calling variable from new World subclass
By Alwin_Gerrits, with 13 replies.
Last reply by danpost, about 12 years ago:
Maybe, instead of creating a new main actor in the new level, you should be using the same main actor. That way any and all states for that actor are not lost. The code could look something like this (although, it would depend on what class you are changing worlds in):: <Code Omitted>This particular code would require that you had a method in your Level2 classes defined as follows (however, it could be defined more specifically as far as the cl
Image isn't appearing...
By BryanGSMST, with 2 replies.
Last reply by Super_Hippo, about 12 years ago:
I would suggest to comment out line 37 because I don't think that an array can be 'null'.
Variables Reset Glitch
By BlackBench, with 1 reply.
Replied to by danpost, about 12 years ago:
Every time you create a new Rock object, it, the new Rock object, receives its own 'L' and 'N' fields for its use. If you want all Rock objects to share the same 'L' and 'N' fields, they you need to declare them as static fields: <Code Omitted>Their default initial values will be zero; however, because the values of static fields are retained during resetting of the project, you should explicitly set them to zero in the constructor of your subclass of World, using: <Code Omitted>
Error when Bullet hits Asteroid.
By CKnox, with 2 replies.
Last reply by CKnox, about 12 years ago:
Thankyou you for pointing that out, I checked my Bullet code and there is no removal code there either. Thankyou
Enemy glitching
By A1234, with 8 replies.
Last reply by A1234, about 12 years ago:
Yeah, that seemed to fix it and now it is working completely fine. It is strange how that fixed it as before it was glitching like crazy! But thank you again :)
642
643
644
645
646
647
648
X