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
Space invaders
By MrGigglez, with 1 reply.
Replied to by danpost, almost 11 years ago:
Your ship has a rotation of zero, which makes it move left and right with 'move(-10);' and 'move(10);'. By setting the rotation of the bullet to that of the ship, the bullets will also move left and right when using the 'move' method. If you want to use the 'move' method to move an object upward, that object must have a rotation of '270'. This may or may not have the unfortunate result in having your bullets flying sideways depending on the image used for them. There are several ways to avoid this. Re-post if help is needed in this regard.
Code
By Express88, with 7 replies.
Last reply by danpost, almost 11 years ago:
What method is the code from line 16 down in? Look like an undeclared block of code to me. Then, what two objects do you want removed at once?
Drag-able object stops being drag-able when another actor is brought in
By KiwiMC1482, with 2 replies.
Last reply by danpost, almost 11 years ago:
What are the dimensions of the image that is set to the line object?
Getting a random number between 10.0 and 15.0 but with decimals?
By DiplomatikCow, with 5 replies.
Last reply by danpost, almost 11 years ago:
The SmoothMover class probably has a 'public void move(double distance)' method, or something like that. If so, you can just do: <Code Omitted>
Added Levels of difficulty
By sh935wi, with 1 reply.
Replied to by danpost, almost 11 years ago:
In what way is the difficulty to increase? Show what you have tried?
Putting another question
By MrGigglez, with 27 replies.
Last reply by danpost, almost 11 years ago:
For the value of 'x' in line 34, you will need to add '2' instead of '1' or case 21 will never be used and nothing will show for case 1. As far as the fields in the Background class, lines 12 and 13 can be removed (not used anymore). Line 11 can also be removed; but, line 34 will need to be adjusted to this: <Code Omitted>As I do not know what 'var' (line 14) is for, I cannot say whether you need it or not.
Score on Game over screen
By gamer98, with 1 reply.
Replied to by danpost, almost 11 years ago:
There are multiple discussion threads dealing exactly with this issue. Usually, it is the case that they have something like this; <Code Omitted>and do not realize that they can split the line up to this: <Code Omitted>By doing this, they can then proceed to call methods on the new game over world. For example:
Setting a Firing delay
By howdoesonecode, with 6 replies.
Last reply by danpost, almost 11 years ago:
howdoesonecode wrote...
my only problem now is getting a bullet to delete after it has intersected an enemy ive tried like a hundred different ways and nothing works any ideas?
Show what you have tried.
Greenfoot Opens but doesnt show classes
By MrGigglez, with 5 replies.
Last reply by MrGigglez, almost 11 years ago:
I fixed it ! Thank you
Bounce an Object off of walls, but not so easy?
By DiplomatikCow, with 3 replies.
Last reply by DiplomatikCow, almost 11 years ago:
Thanks :)
Speed change
By MrGigglez, with 1 reply.
Replied to by danpost, almost 11 years ago:
This should be a continuation of your other discussion post -- not a new one.
How to move bullet creation location
By howdoesonecode, with 16 replies.
Last reply by danpost, almost 11 years ago:
Ok. What you are trying to say without really saying it is that the bullets are being created and placed in the world properly, but they are not moving like they should be. If you look in your bullet class, you will notice that the value of the 'speed' field is never initialized to anything; so, the speed of each bullet created is zero. You need to assign a positive value to the field either when declared or in the bullet constructor code block.
dont want to run into self!HELP??
By Moho, with 4 replies.
Last reply by Moho, almost 11 years ago:
i tried but it still didnt work. i programmed this extact game a year ago but i got a new computer so i cant go back i just dont recall how i did it.
Natural enemy movement
By howdoesonecode, with 3 replies.
Last reply by danpost, almost 11 years ago:
You can slow them down by changing 'move(2)' to 'move(1)'. As far as the strangeness, you just have to fiddle with the turn values or add more code to be more specific as to how you want them to move.
Fading Timer and Hovering
By Ariadia, with 4 replies.
Last reply by danpost, almost 11 years ago:
Ariadia wrote...
As for the hover, If I do animate it out of the program, will the code still work with it? For example, if I have the object getting the ground at offset, will it change? Or does it work with a bounding box? (Does that question make sense?)
It is unclear what you mean by animating the hover out of the program as all animation must be done through code. Also, 'the code' in 'will the code still work' can only be presumed to be the fading code, where fading and hovering have nothing to do with each other unless you specifically add code to have the state of one cause a ch
604
605
606
607
608
609
610
X