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
My for clause doesn't work
By Turbo_Thorsten, with 3 replies.
Last reply by danpost, over 2 years ago:
Also, line 3, within a
for
loop, is troublesome because you a scaling the same image multiple times, which never works well. Best is to save the original image in an instance field, and on each iteration of the loop, create a copy of that image and then scale the copy once.
i need held with my code
By truck_hunt97, with 3 replies.
Last reply by danpost, over 2 years ago:
truck_hunt97 wrote...
I have a coin counter, every time I take one, this is the account, how do I multiply its value?
Show all methods and fields that deal with the coin counter and indicate the classes each code block/field is in.
Hi i need held thanks in advance
By truck_hunt97, with 1 reply.
Replied to by Spock47, over 2 years ago:
Please have a look at https://www.greenfoot.org/topics/64967/0 There is a menu to choose which ship the hero is flying. You can reuse it for your idea, especially adding buttons for each position to the chooser-menu. At the button action, you can also add a check whether the hero has enough coins and the reduction of coins when the number of coins is sufficient. You can also add booleans to the hero class to indicate whether the effects are already bought. Please let me know whether this helps, otherwise just add additional questions as response here to resolve any remaining problems.
I need help pls
By OE51, with 2 replies.
Last reply by Spock47, over 2 years ago:
The problem is probably the check "x>=0 ||x==getWorld().getWidth()". The first part checks whether x is greater or equal 0, which is always true. But I think you want to check whether x is less or equal. Note, that you need two simple ideas as the basis for the reflecting: 1. If the fish bounces off top or bottom, its new rotation is 360-oldValue. 2. If the fish bounces off left or right, its new rotation is 180-oldValue. A simple source code to implement this:
I need help with a code!
By ELquenosabena, with 2 replies.
Last reply by ELquenosabena, over 2 years ago:
ok, but, could you send me a code, as an example, if you can
I need help with some code
By nedenatt, with 1 reply.
Replied to by danpost, over 2 years ago:
Use
Actor
type objects to display clickable text. Use
World
objects for different screens (probably).
jump n run please help
By jerno, with 1 reply.
Replied to by danpost, over 2 years ago:
Need codes for
Robby2
constructor and for
randonSpawn
method.
Ball being launched in a certain direction
By Gengar360, with 1 reply.
Replied to by Spock47, over 2 years ago:
It seems that "this.paddle" is null. Therefore: 1. Please give the source code where the constructor is called (new Ball(..., ...)). (if the first parameter is null, we found the problem) 2. Please change the line "public Paddle paddle;" to "private final Paddle paddle;". This ensures that the constructor is the only place "this.paddle" is set (otherwise one would have to check whether paddle gets changed somewhere else in the source code).
Boolean Turning Off by Itself
By LegoAJ, with 1 reply.
Replied to by LegoAJ, over 2 years ago:
Never mind, I figured it out.
Card Matching Game
By vinxl, with 2 replies.
Last reply by vinxl, over 2 years ago:
sorry to say I decided not to submit anything and fail my course. I just lost interest in programming :<
hi, I need help
By MATE-USER67, with 1 reply.
Replied to by danpost, over 2 years ago:
MATE-USER67 wrote...
I need a code that when a character touches a potion he can increase his speed and another that doubles the score when you pick up a coin THANKS advance
Add instance fields to the class of the character to signify that (1) potion was touched; and (2) coin was picked up. Use them to control the behavior of the character in the
act
method. Attempt some codes and if you run into trouble, show codes attempted for assistance.
i need help i new progamming
By sares97, with 1 reply.
Replied to by danpost, over 2 years ago:
sares97 wrote...
I need a code so that when a policeman collides with a coin he can create a temporary stun effect on enemies. I'm new to programming and thanks in advance.
Try the following field in your MyWorld class (or your game world class): <Code Omitted>with the following line in your MyWorld constructor block: <Code Omitted>and the following in your MyWorld
act
method: <Code Omitted> Then when policeman collides with coin, set the field to some positive value -- 60 units per second of stu
How does ask() method stops the scenario
By Roshan123, with 8 replies.
Last reply by Roshan123, over 2 years ago:
danpost wrote...
It doesn't. Line 49 prevents the loop from being infinite. When the "enter" key is pressed, execution "breaks" out of the loop.
Oh, okay and thanks a lot for the explanation and all
Changing Images and Properties of an Object
By Mauckenweg, with 6 replies.
Last reply by Mauckenweg, over 2 years ago:
Thank you SO much it works perfectly
Problem with adding double to double
By Turbo_Thorsten, with 3 replies.
Last reply by Turbo_Thorsten, over 2 years ago:
Thank yall for the answers. I got an easy solution but the explanation is very helpful :)
33
34
35
36
37
38
39
X