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
Can somebody tell me if this is good?
By Claw76, with 1 reply.
Replied to by danpost, over 7 years ago:
Claw76 wrote...
This is my idea for a Button class and I wanted to know if it is a good idea. I saw some ideas how to create Buttons, but nobody never really came up with a solution like this (as far as I know). However, I also wanted to know if there are improvements that could be made and if there is a way that the Button class doesn't need to inherit from the Actor class. Please reply. This is the code from the Button class: << Code Omitted >>
As far as inheriting Actor, you will need an
Actor
object to display the button in greenfoot unless you modify the background image o
Help with this code.
By WhiteSorcerer03, with 12 replies.
Last reply by danpost, over 7 years ago:
When I said:
Right click on the boy and select '
Inspect
'. Do the values appear to be okay, or is something off?
you responded with
No it seems to be fine.
Did you not see a bunch of
null
values (for the images)? Would that not seem off?
Score is not increasing when I pickup a coin
By denizkb, with 1 reply.
Replied to by Claw76, over 7 years ago:
<Code Omitted>This is the code I came up with, when seeing your project and your problem. You need to put it into the sprite class I hope it will help you. (I didn't test it)
Turn towards mouse help
By 343qwm29, with 1 reply.
Replied to by Claw76, over 7 years ago:
<Code Omitted>Hey 343qwm29, I hope this line of code will help you... A little hint: When you don't know how to do something, but you have an idea what your code has to do, go to your Greenfoot Scenario and click on "Help" and then on "Greenfoot Class Documentation" where you can find almost every method that Greenfoot has, and how to use it.
Object should know which objects another object touches
By Kilian, with no replies.
I want that my object trefferpunkte changes the value of a private int variable when the ball which is touching trefferpunkte is touching a patrone.
Music Doubles Over On Restart
By ErnieBoi, with 2 replies.
Last reply by ErnieBoi, over 7 years ago:
danpost wrote...
Try starting line 17 in the Maps class with the word
static
.
OH THANK YOU DANPOST I HAVE BEEN ILL AND HAVE NOT BEEN AT FULL CAPACITY TEE HEEEE, I AM ERNIE AND I LOVE YOU SO HERE, AS A GIFT FROM ERNIE TO DANPOST HAVE A SEXY NUDE U NAUGHTY BOY.
░░░░░▄▀▓▓▄██████▄░░░ ░░░░▄█▄█▀░░▄░▄░█▀░░░ ░░░▄▀░██▄░░▀░▀░▀▄░░░ ░░░▀▄░░▀░▄█▄▄░░▄█▄░░ ░░░░░▀█▄▄░░▀▀▀█▀░░░░ ░░▄▄▓▀▀░░░░░░░▒▒▒▀▀▀▓▄░ ░▐▓▒░░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▓ ░▐▓░█░░░░░░░░▄░░░░░░░░█░ ░▐▓░█░░░(◐)░░▄█▄░░(◐)░░░█ ░▐▓░░▀█▄▄▄▄█▀░▀█▄▄▄▄█▀░
Leaderboard bug
By ant, with 3 replies.
Last reply by danpost, over 7 years ago:
When you move a value in your arraylist, you destroy what was previously in the position you set. Change line 88 in HighScores class to: <Code Omitted>
I am trying that an object removes an object which is touchung another Object???
By Kili, with 1 reply.
Replied to by danpost, over 7 years ago:
A method with protected access can only be executed on '
this
', which is implicitly understood if no object is explicitly given to execute the method on. That being said, to use
isTouching
on a
ball
object, it must be coded in the
ball
class. You can add a
public
method that returns a
boolean
value depending on the touching state in the
ball
class and call it from the other class.
I am trying to make the enemy hinder dissapear after a multiple hits. This code doesn't even remove the Enemy.??
By JoNGrEeNfOoT, with 10 replies.
Last reply by danpost, over 7 years ago:
JoNGrEeNfOoT wrote...
Then I called the method in my public void act! if(getWorld() != null)destroyHinder();
That should work.
Error in code
By 343qwm29, with 1 reply.
Replied to by danpost, over 7 years ago:
343qwm29 wrote...
I can normally turn, move, and fire at the same time but it does not work while using the left key. << Code Omitted >>
It may just be a keyboard thing, Try a different key combination (maybe use 'x' instead of 'e').
Limiting the spawning/creation of objects or classes based on ints
By Notted, with 15 replies.
Last reply by Notted, over 7 years ago:
Ok, now it works. Thank you very much.
Classes, subclasses and coords. can you help out a beginner?
By Andrew.2, with 9 replies.
Last reply by Andrew.2, over 7 years ago:
Thanks! Or should i say tanks! Ok bad joke aside this seems to work and most importantly i learned some useful things from this. I'll let you know if i have any other issues.
Help on generic pointers
By RenoJackson, with 1 reply.
Replied to by danpost, over 7 years ago:
RenoJackson wrote...
I'm creating a program that contains multiple instances of an object. These instances spawn in a while loop and I want to say if ANY one of those instances is touching object x then do delete all further instances which I plan to do by using the break method in the loop. The problem I'm finding is that there is no direct way to say if ANY of the instances are touching object x. I was wondering how you guys would work around this problem.
Let me get this straight. You want to stop creating these object once any placed into the world ends up touching this object x.
Subclasses
By Adi18, with 9 replies.
Last reply by Adi18, over 7 years ago:
I just fixed it, thanks for help
Help with collision system
By TheSlorrow44, with 12 replies.
Last reply by nccb, over 7 years ago:
As I understand it, clone() copies all object fields exactly. But Actor keeps an internal identifier number, so clone() copies that identifier. Using clone() is almost certain to mess Greenfoot up, as it assumes each actor has a unique identifier. Instead, write a copy-constructor that copies the state you want.
217
218
219
220
221
222
223
X