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
Prevent different objects from completely overlapping with each other
By Abwatts, with 17 replies.
Last reply by Abwatts, over 7 years ago:
danpost wrote...
Abwatts wrote...
I don't know if there's a way to pause the game without using the while loop which essentially prevents other methods from executing in the same time (they wait for while loop to finish its thing first and then they execute, I guess).
I think you want something like: <Code Omitted>
Thanks a lot!
I truly appreciate all
When do I use World. and when getWorld().
By RedMine360, with 2 replies.
Last reply by RedMine360, over 7 years ago:
ok makes sense now :D thx
Need help with a health counter...
By charliejustshrekedyou, with 2 replies.
Last reply by charliejustshrekedyou, over 7 years ago:
That worked!!! Thank you!!!
Getting actors to shoot
By charliejustshrekedyou, with 2 replies.
Last reply by charliejustshrekedyou, over 7 years ago:
Thank you! It's working now :)
Help with Ping pong game
By Melissa, with 1 reply.
Replied to by Melissa, over 7 years ago:
Right now i got this <Code Omitted>
Scoreboard not working
By dammnn, with 4 replies.
Last reply by dammnn, over 7 years ago:
It works! Thanks a lot
I cannot see the Greenfoot program
By Illumiknight07, with 1 reply.
Replied to by danpost, over 7 years ago:
Try what is given
here
.
read file always catch IOException
By mrbrook, with 6 replies.
Last reply by mrbrook, over 7 years ago:
I got it, it just the problem within filename, so I just need to rename the filename, actually it was basic mistakes xD u don't have to write your own file extension because greenfoot can read it automatically, i.e I changed my filename from "highscore.txt" to just "highscore" and save it to the folder that you pointed, thanks it helps! have a nice day
Using EasyMock with greenfoot.Greenfoot
By Xevinaly, with 2 replies.
Last reply by Xevinaly, over 7 years ago:
Thank you for the advice. I created an identical wrapper and it worked perfectly for mocking :)
Having trouble with the jump machenic and sound using it
By Chelrieo, with 17 replies.
Last reply by danpost, over 7 years ago:
Try a number like 0.8 for gravity and remove lines 56 thru 58 in the Hero class.
Limiting Actor's Movement to a Maze
By flipWiz42, with 2 replies.
Last reply by flipWiz42, over 7 years ago:
woooah, I can do that? How exactly would I word that to make the actor look for that color?
Individual Shots
By t3mp3st_0, with 3 replies.
Last reply by danpost, over 7 years ago:
Erasedsword wrote...
<Code Omitted>
Line 4 is not where the spacebar is only down. Its state is not determined until after line 5. An
else
clause following the
if
block (lines 5 thru 8) would be used for key down state. Line 4 is only for a unknown change in the state of the spacebar.
Power Up issues
By Erasedsword, with 6 replies.
Last reply by danpost, over 7 years ago:
In the DUP class code, add the following line after line 18: <Code Omitted>Then, in the act method, add the following line after line 34: <Code Omitted>These lines will immediately cause an exit from the methods so that no further code that require the actor be in the world be executed.
Code for Spawner
By Brandon13, with 1 reply.
Replied to by danpost, over 7 years ago:
Brandon13 wrote...
I am trying to make my spawner spawn a certain number instead of unlimited spawing but unsure of the code
Add a counter field to count number spawned: <Code Omitted>Add the following line immediately after spawning: <Code Omitted>Adjust the limit (10) as needed.
Error:java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
By rma943, with 8 replies.
Last reply by danpost, over 7 years ago:
Dr.Blythe wrote...
Of course, since we didn't cover how to use the results of getObjects (or even mention the get() method), there must be another (much simpler) way to do this!
You could keep a reference to the Runner object in your World subclass along with a "getter" method: <Code Omitted>Then, use the following in your Actor subclass:
204
205
206
207
208
209
210
X