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
Zombie spawn
By ortizme93, with 1 reply.
Replied to by danpost, almost 12 years ago:
I believe the problem stems from the statement that subtracts 5 from the time. I do not see any code that counters that statement (prevents 'time' from going below zero, when no more zombies will be spawned). Maybe you should explain what the variable 'time' is supposed to do. Also, the 'if' condition on line 10 will always be 'true'. The previous statement sets 'spawn' to a number between zero and two inclusive.
Getting dx, dy relative to x,y?
By Monson, with 6 replies.
Last reply by Monson, almost 12 years ago:
Got it! Cheers! Here's the code for a 'left wing' object:
Greenfoor.mousePressed() & Greenfoot.mouseClicked() , happening in one go
By jainmanish, with 3 replies.
Last reply by davmac, almost 12 years ago:
I'd also suggest that you want to 'return' at line 35 since otherwise the next 'if' block will always be processed if a click causes the piece to be selected, i.e: - line 31 sets selected=true - line 38 - in "if(selected)" - the condition is now true. - line 49 - in "if(Greenfoot.mouseClicked(null))" - the condition is also true.
Scrolling ground help?
By zombiedude789, with 1 reply.
Replied to by danpost, almost 12 years ago:
If you mean, "Do I implement the ground class scrolling with my background scrolling, then certainly. As the background moves, move all the Ground object the same amount. If 'scrollAmt' was the number of pixels to scroll by each act method, then: <Code Omitted>You will have to add new ground into the world on the one side and remove it from the world on the other. It is best to use an unbounded world.
Stopping an Object
By Gingervitis, with no replies.
I am making a maze game and I am having trouble getting my ball to stop and not go through the wall when it hits it. Here is my attempted code.<Code Omitted>
Tor Programieren HILFEEEEEEE
By SASCHA, with 4 replies.
Last reply by Gevater_Tod4711, almost 12 years ago:
In line 63, 64 you are just checking whether the X component of the actors location is in a certain area. You also have to check the Y component. So after line 64 you should add some code like this: <Code Omitted> You will have to do the same after line 71. If you want your goal to get bigger you have to use a greater value than 100. For a smaler goal a smaler value.
Problem with a side
By JetLennit, with 2 replies.
Last reply by JetLennit, almost 12 years ago:
Hadn't thought of directly making it a negative number with all the other ones........ but i can't believe i made that mistake!!!! Thank you sooo much
Set a counter for the points
By JesusJesus, with 2 replies.
Last reply by JesusJesus, almost 12 years ago:
Thank you very much :D
How to use type boolean variable?
By new2programming, with 1 reply.
Replied to by davmac, almost 12 years ago:
A boolean variable is just like any other variable (like an 'int' variable). Except whereas an int variable can hold a lot of different values - 0, 1, 2, 3, 1000, -1, etc - a boolean variable can only have two possible values, 'true' and 'false'. There's nothing magic about them otherwise - they work exactly as other variables do. Because the value of a boolean is already true or false, you don't need to compare them in 'if' statements, i.e. instead of writing: <Code Omitted> you can write: <Code Omitted>
I mean how
Setting the score through different worlds
By welleid, with 17 replies.
Last reply by welleid, almost 12 years ago:
Thanks it works perfectly, I didn't think about setting the method in the subclass, meaning that we keep the same Score in fact.
Problem
By djEthen, with 2 replies.
Last reply by djEthen, almost 12 years ago:
Ohk.. thanks will look into it.
problem using Greenfoot.mouseClicked(this)
By jainmanish, with 6 replies.
Last reply by jainmanish, almost 12 years ago:
Greenfoot.mouseClicked(null) worked thank you very much @danpost
Scroll World trouble
By Draymothisk, with 1 reply.
Replied to by Draymothisk, almost 12 years ago:
Never mind.. I fixed it.
Changing the uploaded size
By JetLennit, with 7 replies.
Last reply by FlyingRabidUnicornPig, almost 12 years ago:
JetLennit wrote...
Oh... duh! *facepalm* i was just having problems in my browser!!! never mind
oh, well there you go
How to move on the y-axis
By OxiClean, with 6 replies.
Last reply by JetLennit, almost 12 years ago:
Your welcome!
854
855
856
857
858
859
860
X