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
Needing help at making a artificial intelligence
By MrXeth, with 1 reply.
Replied to by danpost, about 8 years ago:
MrXeth wrote...
I need help at returning the closest object of one class for this and going to the y coordinate of this object. I will be very happy if you can help me.
What have you tried? or (if not anything), how do you think this can be appoached (what individual steps, specifically, do you think can be used to accomplish this)?
Null pointer exception error
By bryanz1345, with 2 replies.
Last reply by bryanz1345, over 8 years ago:
Hey danpost! thank you for the quick reply , moving lines 49 - 54 was a super simple solution thank you for your help it was greatly appreciated!
I need to make my game end after 60 seconds.
By SPCWW, with 4 replies.
Last reply by SPCWW, over 8 years ago:
Actually ive found a way.
Trouble Idling.
By Beamo, with 2 replies.
Last reply by Beamo, over 8 years ago:
Oh! Thanks for the hint I got it now! In regards to creating fields for the idle images, that's a great idea thanks! Thanks for replying danpost!
I cant get enemy to shoot back at oponents
By pzb0024, with 1 reply.
Replied to by danpost, over 8 years ago:
Your Enemy actors are not turning -- that is, their rotation is always zero. So, passing 'getRotation()' for the direction of a new Bullet object does not make any sense. There are a couple other anomalies in your code. Line 10 appears to do nothing. Line 55 adjusts the direction of a bullet one degree left for no apparent reason. All your speeds (for both the enemies and the bullets) are negative values which is counter-intuitive. As far as the direction of the bullets, you need to use 'turnToward' with the coordinates of the opponent (or calculate, using trig functions, the angle of
Animate while move
By MrKryptus, with 4 replies.
Last reply by Yehuda, over 8 years ago:
@MrKryptus See the following. "Posting code?
read this!
"
Add object
By Confringo, with 1 reply.
Replied to by danpost, over 8 years ago:
Remove the line that is causing the error: <Code Omitted>You cannot execute that method until the Spaceship1 object is created and added into a world. Where you have the line, it is executed while the object is being created and before it is added into a world. Change all remaining 'world' in your code to 'getWorld()'. The only thing that should be new in the class are lazer objects. When the 'act' method is executed, which executes the 'shoot' and 'checkKeyPress' (missing from given code) methods, a Spaceship1 object exists and is in a world. You do not want
Corrupted Code of Sorts
By Agent40, with no replies.
I have never experienced this before but my code has turned into something I've never seen before unless opening a .jar or .dll in notepad. This area was the base parent class for my characters and now it has turned into this. <Image Omitted> So my question is, is that Has anyone else ever seen this happen in greenfoot and if so does anyone know a fix for this to revert the code back to it's original state. Greenfoot is running off of a external hard drive as well and I don't know if that could a contributing factor. Thanks in Advanced,
SetVolume() creates NullPointException
By LuizAntonio, with 4 replies.
Last reply by LuizAntonio, over 8 years ago:
danpost wrote...
You could try . If your enemy death sound is from a "wav" type file, then the only thing I could imagine is that the one sound file is not properly formatted or corrupted. Otherwise, you might try reformatting it to the same type as the enemy death sound file.
You were right. I downloaded a WAV to MP3 converter and used the new MP3 file and it worked successfully. Sorry to waste your time, I should have guessed this was the problem all along. Thank you.
Instance variable
By Vishnusadagopan, with 1 reply.
Replied to by danpost, over 8 years ago:
An instance variable is (a non-static) one that is declared outside of any method (as opposed to being declared within a method).
Objekte übereinander, welches oben
By Jonas0602, with 1 reply.
Replied to by danpost, over 8 years ago:
Use 'setPaintOrder' method of World class (possibly -- if understood correctly).
runtime error on database
By divinity, with 5 replies.
Last reply by danpost, over 8 years ago:
divinity wrote...
another I got is on line 4, so it is two errors, line 27 and line 4
It is line 27 that is the issue. You should have a line of output starting with "'con' is ...". How did that line in the output finish up??
HEALTHBAR
By rinariirin, with 4 replies.
Last reply by danpost, over 8 years ago:
rinariirin wrote...
i try to use its code in my game try to at world it not works
Cannot help without seeing what you tried. Post world class code (use
code tags
).
Using loops to add objects in my prepare methd.
By Faheem, with 1 reply.
Replied to by danpost, over 8 years ago:
A simple loop looks like this: <Code Omitted>The 'count = 0' part is the initial value. The 'count < loopLimit' part is the condition to execute the block of 'code to repeat'. The 'count++' part is executed immediately after the block is actually executed and before the condition is checked to see if it should be executed again. If the value of 'count' is not needed outside the loop and the loop limit is always the same, it can be written as follows:
clickAndGen
By xusui, with 1 reply.
Replied to by danpost, over 8 years ago:
You are getting responses to button action(s) -- but, you are not specifying what action. Use the 'mouseClicked' method of the Greenfoot class (with that, you will not need the 'boolean isDown' variable).
318
319
320
321
322
323
324
X