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
Get the nuber of Objects of one Class
By BloodMate, with 18 replies.
Last reply by BloodMate, over 9 years ago:
It works Great! Thank you two
Collision Distance
By Ty1erH00ven, with 13 replies.
Last reply by Ty1erH00ven, over 9 years ago:
SPower wrote...
In the Mover class: <Code Omitted> In the class doing the collision: <Code Omitted>
This worked great! Thank you so much!
How do I get the postion of an object in Greenfoot?
By Michael1000, with 1 reply.
Replied to by danpost, over 9 years ago:
A few things here: (1) to refer to the object being worked on by the 'act' method (or any other non-static method within a class on an object created from that class or any subclass of that class), use the 'this' keyword; so, instead of 'move(10);', you could use 'this.move(10);'; and instead of 'projectile.getX()', you could use 'this.getX()' or just 'getX()' (as 'this' is understood when no object is given to execute a non-static method on). (2) when using the standard 'super' call to create a World object, the world is made a bounded one -- meaning that no object can have a coordinate va
Help With Beam Attack
By AreebRaza, with 1 reply.
Replied to by SPower, over 9 years ago:
You're going to have to post more than just your basic goal. This forum isn't meant for others to do all of the designing and programming work, it's to help you with what you're trying to achieve. Now, if you have an idea of how to do this, but have trouble finding a way to implement it, that's when you'd post it here.
Have a bullet being detected on any part of an enermy
By Cragster25, with 3 replies.
Last reply by danpost, over 9 years ago:
Cragster25 wrote...
which method would you recommend?
There are not that many to choose from. Take a look at your options
here.
Problem with Live counter
By LittleMiiMe, with 1 reply.
Replied to by danpost, over 9 years ago:
Things to make things easier: (1) add a constructor to set the initial image (or set the initial image as the default image for objects of the class); (2) set the appropriate image immediately after changing the 'live' value instead of every act cycle; the check for game over can be done there also; (3) there is no need for an 'act' method in the class; everything is done when the counter is created or when a field changes its value due to other classes calling for it. In other words, you only need the constructor to set the initial values and image and a method that is called from outs
cant find my last post
By divinity, with 20 replies.
Last reply by danpost, over 9 years ago:
divinity wrote...
hey danpost do you guys have any tutorials on object oriented programming
First, I am only one guy. But, as far as tutorials go, you can check out the trails at the java website. Start with the 'Trails Covering the Basics' links on
this page.
Killing Off Mobs (a.k.a. Making the Stupid Enemy Sprites Go Away)
By ZacBuzzsaw, with 2 replies.
Last reply by danpost, over 9 years ago:
As far as actors spawning atop one another, the code given above looks awfully bulky; although, it would appear to do the trick as far as keeping them from spawning atop one another. Where exactly are you declaring the variables given ('spriteOnLeft', 'spriteInMid' and 'spriteOnRight')? With a little organization, the bulkiness can be practically eliminated. Using a 'switch' structure (or one-line 'if' statements) to create the appropriate actor to spawn would eliminate the need for multiple 'if' structures for placing the actor properly. Using an int array to hold the x-coordinates that a
I need help with getting one object following another object
By Bat8, with 4 replies.
Last reply by danpost, over 9 years ago:
Bat8 wrote...
Do you know a different way to slow the enemie down?
You could have the class extend my QActor class which allows a factor of 100x fine tuning to the movement and rotation of actors. Check my support classes collection for it (it is in the
Asteroids w/Improved QActor class
scenario). Then, your original code would have 1/100th the original speed. You can now increase 'move(1)' to 'move(50)' to produce half the original speed or adjust it to your liking from there.
HELP ME
By aaron1011, with no replies.
Hi , im trying to use kinect server in windows 10 , but doesnt works :( , i followed these l steps : http://www.greenfoot.org/doc/kinect SO : WINDOWS 10 x64 GREENFOOT VERSION : 3.0.2 please healp me ::(
Cars scenario
By Trunks, with 10 replies.
Last reply by Trunks, over 9 years ago:
Thank you for all your replies, I have made one of the stupidest mistake of my life, it was just a problem with a name, GreenFoot didn't recognize "Explosion.png" because the file's name was " Explode.png" hahaha !
Sound Out-of-Bounds and Mobspawning
By ZacBuzzsaw, with 3 replies.
Last reply by danpost, over 9 years ago:
I think that is because you have information tags in your sound file. Try resaving the files without them.
Can't produce actors on any scenario
By Laurence, with 1 reply.
Replied to by davmac, over 9 years ago:
This looks like a partial stack trace. The first part (including the exception type) has been cut off. Are you able to get the full stack trace? (Try turning on the "unlimited buffering" optional from the terminal menu). Also, what version of Greenfoot are you using?
I need help with The words were stained as they set
By Kevin.irwanto, with no replies.
Help me with the code please.. I want to make "the words were stained as they set". thanks
I keep getting a terminal window when my projectile hits something and dissapears.
By bjornjulian00, with 1 reply.
Replied to by danpost, over 9 years ago:
All your methods called from the act method, except for the 'move' method, could potentially remove the actor from the world. If any but the last one does, you will get that error. You could either place the following line between each method: <Code Omitted>or you can preceed each method call like this example <Code Omitted>
461
462
463
464
465
466
467
X