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
How to tell if all of one class is null inside the world?
By Fadawar, with 2 replies.
Last reply by Fadawar, almost 10 years ago:
Thank you!!
My character keeps falling through the platform
By AdamSteele, with 1 reply.
Replied to by danpost, almost 10 years ago:
The main problem that beginners have when creating a "jump-n-run" type scenario is that they do not account for the vertical direction of movement when performing collision checking. The direction of movement will determine whether the jumper should be positioned above or below the object collided with. In either case, the vertical speed should be reset to zero. In your code, I do not see any repositioning of the jumper when a collision occurs. Also, your 'onGround' method does not really determine if the platform is really 'under' the jumper. By using the sign of the vertical speed (the
Setting up a vertical background scroll
By wslade, with 3 replies.
Last reply by danpost, almost 10 years ago:
wslade wrote...
Okay, thanks! I had done a google search and it was from a previous
discussion
. I guess it was from some time ago.
Yeah. I found it. it was almost 3 years ago.
How do I make the player strafe left and right?
By RedCreeper, with 8 replies.
Last reply by RedCreeper, almost 10 years ago:
Sorry, It seems that the code works now, for some reason my computer wasn't responding to the code and with a restart of greenfoot it seems to work. Thank you!!
2 Actors will not have the same X-Position value
By Decapitated, with 4 replies.
Last reply by Decapitated, almost 10 years ago:
Fix: I just had the "bird" on a certain X so as the pipe went <Code Omitted> it would end up meeting. "Bird" code:
Shooting; setting rotation of bullet?
By alexanderwrobinson, with 3 replies.
Last reply by danpost, almost 10 years ago:
alexanderwrobinson wrote...
Thanks! this was exactly what I need, how would I now put a delay on each bullet shot, such as shoot a bullet wait a second shoot another etc. ?
Add an instance int field to be used as a timer (count act cycles to track the sense of time passage). If its value is zero, the actor can fire a bullet. When a bullet is fired, set the value of the timer to, say -- '50'. Add a line in the act method that decreases the value of the timer if its value is greater than zero.
Kara Sokoban scenario upload
By danpost, with no replies.
Hey everyone, I have set a two week limit on voting on my
Poll Taker
scenario. The issue is whether I should upload a remake of the 108 level
Kara Sokoban
scenario RoyalFool has on this site. The main differences are as follows: * of course, the no code or images where taken from the scenario by RoyalFool * mine does not compare different users scores; * mine shows your best as well as known best scores for levels after completion; * mine does not have codes to access levels; but tracks your progress, saving it when signed in on the site, and opens each level as you complete the one prior to it; Vote while you can !!! EDIT: I know this should be under 'Other' and not 'Programming'. In fact, I had clicked on the Other icon when I started editing; however, when I left the page and returned when getting a link, it seemed to have reset back to 'Programming' (which I did not notice until after it was posted). Maybe the 'Edit' on an initial discussion post should allow modifying the Title and the Category as well.
How do I add a timer in my game
By ryguy, with 1 reply.
Replied to by danpost, almost 10 years ago:
You could check out my
Value Display Tutorial
scenario on that.
Assigning names
By tRapkIng, with 4 replies.
Last reply by danpost, almost 10 years ago:
Actually, lines 3 through 6 are not needed. Each subclass will have something like this, for example: <Code Omitted>Come to think about it, the field is not really needed (as well as the intermediate 'Racer' superclass). You can use the class name to determine the winner: <Code Omitted>Of course, with a 'getter' method for the field in the Racer class Super_Hippo suggested, you would not need but one class for all the racers (the 'Racer' cla
Most simple way for wall
By Gyracks, with 1 reply.
Replied to by danpost, almost 10 years ago:
Gyracks wrote...
what would be the most simple way to make sure the walls would stop the car?
Basically, in the movement code of a single act cycle: (1) move (2) check wall intersection (3) if intersects, move back.
Labyrinth: Wall and Actor
By Maryjo, with 1 reply.
Replied to by DogeOverlord, almost 10 years ago:
We're going to need to see your code.
Help using the GreenfootSound class
By dogzilla, with 6 replies.
Last reply by danpost, almost 10 years ago:
dogzilla wrote...
That is what I expected too, simple and intuitive. The way it stands now its neither simple nor intuitive. Is there a reason to have the volume logarithmic? I'm not sure why they would code it like and want to understand. Also @danpost are you a moderator on here? Seems like every discussion on here is answered by you haha. If so you should know where I can find the the site/forum/posting rules, couldn't find them anywhere.
No -- I am not a moderator here; just an experienced member who likes to help out. There are links below the reply box you could check out. I cou
Create a new Ball when you right-click on an existing Ball
By chrisbsports, with 1 reply.
Replied to by danpost, almost 10 years ago:
Create a method that detects a click on the actor and then creates a ball and adds it into the world at a random location. Then add a call to the method in the act method.
prime number divisible by 3
By divinity, with 7 replies.
Last reply by danpost, almost 10 years ago:
divinity wrote...
hi danpost that is not working, i tried it and am getting an empty output. nothing is outputting. blank output
Where did you try it? Show the code you used (method and all).
Greenfoot.isKeyDown not working?
By Hunter1471, with 1 reply.
Replied to by danpost, almost 10 years ago:
I think the problem comes from your use of the 'Greenfoot.Delay(int)' calls. These calls stop your entire program for about a second each time it is called using '50' as the parameter. I do not think that is what you are wanting. If I am not mistaken, you want to add apples on alternate sides of the world about one apple per second. This would require an iinstance int field to count the act methods between spawnings. You can have it count to 100 and repeat and when it is evenly divisible by 50, then add an apple. Use the quotient (the value of the counter divided by 50) to determine whic
473
474
475
476
477
478
479
X