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
Programming A Bot!
By comlink, with 2 replies.
Last reply by comlink, about 8 years ago:
Okay, I'll try it out! Thanks for your quick response!
Writing a proper randomly generated map
By Xolkiyr, with 3 replies.
Last reply by Super_Hippo, about 8 years ago:
What did you try?
pausing greenfoot
By mole2003, with 3 replies.
Last reply by mole2003, about 8 years ago:
Nevermind it iis fixed now
Variable kept across all classes
By mole2003, with 1 reply.
Replied to by Super_Hippo, about 8 years ago:
Store the variable in your world and make it possible to access the variable with a getter method. <Code Omitted>Then, to access value of the score variable from an object inside this world, you can do: <Code Omitted>
getX, getY problems
By Ticker175, with 6 replies.
Last reply by Ticker175, about 8 years ago:
Ok awesome thanks for the help =)
Keeping a jump code whilst scolling
By mole2003, with 11 replies.
Last reply by danpost, about 8 years ago:
mole2003 wrote...
Which bits do I need from the code and where shall I put them
Actually, all you probably need is: <Code Omitted>in the
Trex
class
act
method.
Greenfoot version 3.5.0
By davmac, with 21 replies.
Last reply by davmac, about 8 years ago:
Homer wrote...
By the way: as it seems the same error occurs when an Actor subclass has a second constructor ("An object with this name already exists.").
Thanks, added to ticket.
Decimals
By mole2003, with 1 reply.
Replied to by Super_Hippo, about 8 years ago:
You can't. However, you can use doubles. Import the SmoothMover class and make your class a subclass of that. Then you can use doubles as a speed variable.
How can I make an object disappear as soon as it hits the edge of the map?
By MinexTheOne, with 1 reply.
Replied to by danpost, about 8 years ago:
MinexTheOne wrote...
I was trying to use this code, it doesn't show anything wrong with it when I wrote it down, but when it comes in contact of the edge of the map an error message pops up saying; at hook.Vanish(hook.java:35) at hook.act(hook.java:23). (Hook is the subclass I wanna make it disappear. And vanish is what the method is called which tries to make it vanish.) << Code Omitted >>
Although you did not include what type of error you were getting, it is not to difficult to tell it was probably an IllegalStateException (due to actor not in world). If your actor touches the righ
Greenfoot isTouching() issues
By Facehugger, with 2 replies.
Last reply by Facehugger, about 8 years ago:
Thank you for the clarification, it help me figure it out.
Using Gevater_Tod4711's Infinite Scrolling World
By Xolkiyr, with 1 reply.
Replied to by Xolkiyr, about 8 years ago:
This is my workaround that I'm trying.. not exactly accurate because I'm sure there's a much more efficient way to do it.
Cell quantity
By Parth27, with 1 reply.
Replied to by danpost, about 8 years ago:
Parth27 wrote...
How many cells are there by default in a, 600 by 480, world
With a World constructor call of <Code Omitted>a world will have WIDTH*HEIGHT number of cells (regardless of CELL_SIZE). A world that is 600x480 will have 288 thousand cells.
How to make a bullet destroy an enemy
By BurnLikeSiracha, with 2 replies.
Last reply by danpost, about 8 years ago:
BurnLikeSiracha wrote...
I am trying to make a tank game where my tank shoots an enemy tank but I get an error code every time I try and make it destroy an enemy. << Code Omitted >>
You cannot check for a Computer object after checking edges without first ensuring the Bullet object is still in the world. Change line 12 to: <Code Omitted>or just switch lines 11 and 12.
scrolling world
By mole2003, with 27 replies.
Last reply by mole2003, about 8 years ago:
Thanks all
Math.hypot
By Ticker175, with 12 replies.
Last reply by Ticker175, about 8 years ago:
ok so i should have 4 if statements (right, left, up, down) that are triggered if that direction is available. and if more than one is triggered, use math.hypot to determine which would get me the closest and to check like the above 2 comments mention RIght: <Code Omitted>Left: <Code Omitted>Up: <Code Omitted>Down:
244
245
246
247
248
249
250
X