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 loop stopped working?!
By Dustin.Ross, with 2 replies.
Last reply by danpost, over 8 years ago:
You have to create a
new Enemy()
for each enemy you wish to place into your world.
Two Specific Actors Remove Eachother
By Jacob_Chapman, with 6 replies.
Last reply by danpost, over 8 years ago:
Jacob_Chapman wrote...
The problem comes from the full code. <Code Omitted>First, A2 is removed. Then, there is an illegal state, because A1 is no longer touching A2, so the condition to erase itself is no longer met.
Line 3, in itself, does not rely on the two objects touching. You are not correct as to why you are getting the error. There is some broader context which you have yet to provide. Post the code of the entire class for review.
String a class name
By Miguel.Valdez, with 9 replies.
Last reply by Miguel.Valdez, over 8 years ago:
Never mind I finally figure it out... there might be another way(please share it there is), but this worked. <Code Omitted><Code Omitted>
How to remove an actor when the background changes?
By TiltedTowers, with 2 replies.
Last reply by TiltedTowers, over 8 years ago:
Ok thanks
if key is down
By Miguel.Valdez, with 12 replies.
Last reply by Miguel.Valdez, over 8 years ago:
danpost wrote...
You should compare the field value against the current state: <Code Omitted>to detect a change in the state of the key. When they are different, update the boolean field to match the new state: <Code Omitted>and check to see if the key way pressed: <Code Omitted>This is when you either add or remove the instructions to/from the world. A simple check to determine which to do is:
java.lang.OutOfMemoryError: Java heap space
By Lavenger, with 4 replies.
Last reply by Lavenger, over 8 years ago:
nccb wrote...
If you find your greenfoot installation (C:\Program Files (x86)\Greenfoot, usually) and look in the lib directory, there is a file greenfoot.defs. If you find the line beginning "bluej.vm.args=" then you can add a parameter to the end to increase heap space: -Xmx1G So where the old line said: <Code Omitted>Change it to: <Code Omitted>
Thanks ^^ this has solved the issue of it running out of space
java.lang.OutOfMemoryError: Java heap space
By Lavenger, with no replies.
I have searched many posts about this problem(in greenfoor.org and sstackoverflow.com) and most of the time when this comes out, it means that either i have a memory leakage or my scenario uses way too much heap space. I think that my problem here is that i have a memory leakage because it starts out fine but if i played too many Minigames(or if i reset the scenario), the error pops up. But the question is: how do i stop this memory leakage? Situation1: I was playing my game halfway and decided to tweak some things inside of the game(this happened quite long ago so i dont quite remember what did i do for that to happen) and when i reset the game, the error popped out. The error pointed out to the GifImage class Situation2 I was test running my game for a few minutes and when i played the minigame too many times, the error pops up The error pointed out to the PIP class these are my world class codes: Main game world class code: <Code Omitted>1st minigame world class code: <Code Omitted> 2nd Minigame world class code: <Code Omitted> 3rd Minigame world class code: <Code Omitted>
HELP - Frogger game remake
By Ticker175, with 2 replies.
Last reply by Ticker175, over 8 years ago:
I figured out what was wrong after looking over the code closely a few times i had getX (in my frog class) where i needed getY. so i replaced it and it now works flawlessly =)
Making an invisible square in greenfoot
By LobsterL, with 22 replies.
Last reply by Ticker175, over 8 years ago:
nice Mitch
Help with minesweeper squares with an value of 0
By StrauXX, with 10 replies.
Last reply by danpost, over 8 years ago:
A correction to my last post: with the more suitable numbering system, 10 would need to be added for flags (if zero was to be used for blanks and 9 for mines). By using actors, everything becomes more complicated. Each click would be on some individual actor instead of on the world. It even complicates things more when you have the actors store cell states. All data is scattered among the actors and that means it would take a lot of data fetching with each exposure of a blank cell. With the entire state of the game tracked by the array in the world, all that needs done is to offset an
Issue with space invaders enemy movement.
By SPCWW, with 1 reply.
Replied to by danpost, over 8 years ago:
You issue is probably due to the fact that you are having each Enemy object control its own movement. Therefore each one that hits an edge and causes a direction change does not know that another enemy may have already changed the direction. You really want to control the entire Enemy army as a whole when having them move. I have a
Space Invaders Movement Demo
which has the world control the movement of the army using invisible Row objects that group the ranks of the enemy army. There is a bit of communication that goes on between each en
Greenfoot Terminal Window: NullPointerException
By Lavenger, with 11 replies.
Last reply by Lavenger, over 8 years ago:
if it helps figuring out why it wont start: I opened the debugger as the world is being created and it says this under the instance variables in the first call sequence(java.util.HashMap$HashIterator.<init>): HashMap.Node next = null HashMap.Node current = null int expectedModCount = 1 int index = 12
Detect if an actor is intersecting an actor class
By Lavenger, with 3 replies.
Last reply by Lavenger, over 8 years ago:
Lavenger wrote...
create a string that states which map in being used and will tell the
Restart
method which coordinate to use based off which map is being used
oh hey this worked; well idk why am i thinking so hard for these 6 hrs
How to get from one level to another with 2 players?
By Shabir, with 5 replies.
Last reply by Shabir, over 8 years ago:
this is the game
here is the game link. Can you fix it
Timer
By KKobra, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
For example like this: <Code Omitted>
261
262
263
264
265
266
267
X