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
Greenfoot version 3.5.0
By davmac, with 21 replies.
Last reply by davmac, over 7 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, over 7 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, over 7 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, over 7 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, over 7 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, over 7 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, over 7 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, over 7 years ago:
Thanks all
Math.hypot
By Ticker175, with 12 replies.
Last reply by Ticker175, over 7 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:
Broken code
By Ticker175, with 4 replies.
Last reply by Ticker175, over 7 years ago:
thanks i realised what your saying and when i inverted the up and down cordenets (from - to + and visa versa) and it worked!!! Thanks Thomas
Lightbot
By anelio21, with 1 reply.
Replied to by danpost, over 7 years ago:
anelio21 wrote...
hello guys :) how can i create a game like lightbot?? please help
What ideas do you have about how (what have you tried)?
Can't add onscreen message
By idk1234, with 8 replies.
Last reply by danpost, over 7 years ago:
idk1234 wrote...
It works without a timer, but it spawns an infinite about of Yellow_Crushed. So I commented that I would like it fixed and with a Timer, and so I tried to follow Danpost's code, but as I said it does not appear currently.
Try this for the Yellow_Crushed class: <Code Omitted>and this for the display2 method:
Re: Unable to loop/Restart Code
By idk1234, with 4 replies.
Last reply by danpost, over 7 years ago:
You have the following line near the top of the class code: <Code Omitted>You can give it an initial value -- maybe something like: <Code Omitted>
Greenfoot Freezing after a few seconds.
By strange_Robotics, with 1 reply.
Replied to by danpost, over 7 years ago:
strange_Robotics wrote...
Please point out if I did something wrong. << Code Omitted >>
I do not see anything that would cause the scenario to "freeze" as you suggest. I do, however see something that could (potentially) cause a lagging issue (if you happen to have lots of little CPU time-wasting code as shown here). You are creating your images every act cycle (see animateShot method). You can create them once when you declare the fields, replacing line 15 with:
Greenfoot lagging then screen turning white
By Ryan478, with 2 replies.
Last reply by Ryan478, over 7 years ago:
thanks
243
244
245
246
247
248
249
X