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
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:
sending variables between 2 files
By yaronbr, with no replies.
hello. im new to greenfoot, and im trying to create a board game where the board of the game is revealed to all players but each players hand can only be seen by that player. i created two different greenfoot projects and am trying to send a variable between them so one project can influence the other. tried doing this with an abstract java class but it doesnt seem to work a) is there a way to get two projects to communicate with each other? b) is there a better way of creating a game like this? thanks
Stoping sound when a world changes
By Erasedsword, with 3 replies.
Last reply by Erasedsword, over 7 years ago:
I just figured out that I had the methods called in the wrong order. It’s working fine niw
Greenfoot debugger when adding sound
By Erasedsword, with 11 replies.
Last reply by Erasedsword, over 7 years ago:
Yes that was it thank you
How to make an actor appear after something happens?
By Poseidon420, with 4 replies.
Last reply by Poseidon420, over 7 years ago:
Thank you dan it worked now
Multiple worlds
By Andrew0739, with 1 reply.
Replied to by danpost, over 7 years ago:
Andrew0739 wrote...
How could i save all the states of my main world, create a different one, lets call a battleWorld, do some stuff in it, and then go back to the main world without resetting everything (saving the progress). For example i have the main world where the player walks around, if the player comes in contact with some particular object then it will initiate battle and once the battle ends the world will continue running where it left off. Not too sure how to implement this. I was told that a possibility could be to create the new "battleWorld" and have it point to the original world
Animation help?
By MadameMinuit, with 3 replies.
Last reply by MadameMinuit, over 7 years ago:
Thank you so much! I don't think I did quite what you intended, but this new code does what it's supposed to do.
204
205
206
207
208
209
210
X