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
Make Backgrounds change in order
By AngelusNeko13, with 7 replies.
Last reply by AngelusNeko13, over 8 years ago:
is there a way i can make the function change in the order i want them to?
Create a Score board
By ali18, with 1 reply.
Replied to by danpost, over 8 years ago:
ali18 wrote...
Hello, i don't know the code for a score board. My game is made up of a plane collecting people, and i wan't it to add 1 point to the score board for each person i collect. Can anyone give me the code for a scoreboard, and the classes i have to enter these codes in??
My
Value Display Tutorial
should be able to help you out as far as displaying a score.
Randomly spawning actors
By Nozarashi, with 9 replies.
Last reply by Nozarashi, over 8 years ago:
Super_Hippo wrote...
No, it is just what I posted, no removing of the ant.
I understand now. Cheers.
change image when object gets hit
By vbh, with 2 replies.
Last reply by vbh, over 8 years ago:
ty for replay :-) its working now
Is there any way to keep image angle consistent?
By MysteryMudokon, with 2 replies.
Last reply by MysteryMudokon, over 8 years ago:
Sorry for the delayed response. but thank you!
Explosion
By surgikar, with 1 reply.
Replied to by Yehuda, over 8 years ago:
Use an int. Increase it every act cycle and when it's at a certain value remove the explosion.
I am stuck on the last 5 questions of my assignment. Help would be awesome. I am new to coding so please dumb it down for me.
By Mjosue, with no replies.
12. Expansion: place a new key on the keyboard that is activated by pressing ‘m’. Have the ‘m’ key play a random note, one of the notes used on the 12 white keys already on the keyboard. 13. Expansion: place a new key on the keyboard that is activated by pressing ‘n’. Have the ‘n’ key play a random note, one of the notes used on the 14 black keys already on the keyboard. 15. Expansion: place a new key on the keyboard that is activated by pressing ‘b’. Create a chord, a combination of two or more notes played at the same time. Have a new key play a chord of three notes of your choosing when pressing the ‘b’ key. 16. Expansion: program each white key so that after every 10 times that the white key is pressed, a random note is played from among the 12 white keys. Write this segment using a constant: o final int KEYPRESS_LIMIT = 10; o Use KEYPRESS_LIMIT everywhere you might be tempted to use the number 10. <Code Omitted> <Code Omitted>
Help with spawning in an object a set location infinite times
By Asiantree, with 29 replies.
Last reply by Asiantree, over 8 years ago:
Okay, so I got the file to read in the BallInfo integers and managed to spawn in all of them (I believe). Using this code, about 35 BallInfo objects are spawned into the world: <Code Omitted> Essentially, I took the code you gave me from my previous project (the line
KEYPRESS_LIMIT
By Trevor713, with no replies.
If you were to change KEYPRESS_LIMIT to increasing values like 20,30,40 etc. What observations would be noticeably different? final int KEYPRESS_LIMIT = 10; private int Counter = 0; if(Counter >= KEYPRESS_LIMIT) { Greenfoot.playSound( whiteNotes +".wav"); Counter = 0;
Increasing the speed of enemies over time
By surgikar, with 6 replies.
Last reply by surgikar, over 8 years ago:
I just basically repeat the prepare code<Code Omitted>
Colission from the side/top
By Casper, with no replies.
I'm doing a mario game. I have classes Mario and Enemy. If Mario touches enemy from the top(jumps on it) the enemy should disappear but if the enemy touches Mario from the side, Mario should disappead. How can I detect if Mario is touching Enemy from the side or top?
Racing Off-Track
By DamonAG, with 4 replies.
Last reply by DamonAG, over 8 years ago:
Alright, it seems to be working, but the collision boxes on either the car or the mud is larger than it appears to be. Is there a way to tweak the entity so that if the visible section of the car is touching the visible section of the mud, then the care would reduce to half speed? I can almost guarantee this is my problem, seeing as I have collision for checkpoints and the car, and the act is called before the car is visibly touching the checkpoint.
getObjectsInRange is always empty?
By Robot_Face, with 3 replies.
Last reply by Robot_Face, over 8 years ago:
Actually, I figured it out. When I just create a Center in the GUI and press Run, it is not seen by the method getObjectsInRange. I have to either Save the World or manually create it in the world's prepare method. It's not the most convenient, but at least now I know it's not a problem with my code.
Counter which always goes up
By BrianOK, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
Have a variable: <Code Omitted>In the act method, increase it by 2: <Code Omitted>Now you have a counter which increases by 2 every act cycle (about 110 per second).
Goose game
By AURA, with no replies.
hi, i started to study Greenfoot, someone can send me the program to the Goose game i've a lot of problem for create boxes and the penitentiary. tnk
357
358
359
360
361
362
363
X