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
How to access .ini Files?
By Crydsch, with no replies.
Hello Greenfoot Community While trying use an .ini File to store and load Data from, i ran into some problems. Maybe some can help me out with this... I know that a cant access Files the "normal" way and used the method explained here
here
. I wanted to use the
ini4j api
to access said file and did a first try with the example dwarfs.ini. This is what i tried: <Code Omitted> Thanks in advance Crydsch
What is wrong with my code?
By LordGaben, with 1 reply.
Replied to by danpost, over 10 years ago:
The only line, that when executed, that will change the value of the counter is line 59; however, it is located in a method , 'try2Eat', that is not being called to execute.
Creating gravity with different strengths.
By RedPanda98, with 1 reply.
Replied to by danpost, over 10 years ago:
I have a set of support classes that may help here. The first is my QActor class which gives instances of its subclasses precision movement and turning. The second one is a subclass of QActor, called 'GQActor', which additionally provides instances of its subclasses variable gravity. They are located in my
GQActor Superclass Demo
scenario. You can download and open the scenario within greenfoot to check out the two classes.
System runtime code acting strange
By bobbyjones2000, with 4 replies.
Last reply by Super_Hippo, over 10 years ago:
Change line 12 to 'setTimer();' OR change the 'setTimer' method to the following: <Code Omitted>
I need help with string variables + addObject
By Boogabacon, with 3 replies.
Last reply by danpost, over 10 years ago:
Boogabacon wrote...
Thanks for the help, This code is much easier to use than huge If statements!
Usually, if you find yourself using "huge If statements", there will be a much easier, more simple way.
How can one actor do something, wait a second and then do something else?
By TheTimon, with 6 replies.
Last reply by danpost, over 10 years ago:
TheTimon wrote...
Alright it works, thank you very much. Now I want to do a different level, where instead of rocket lasers are fired and in a way, that in an instant a whole row is filled up and if the person is in that row then the person dies. Is this possible and if it is possible, how?
Of course, it is possible. Just create a subclass of Actor called Laser and add the implementation to it (put code in the class to have it do what you want).
Stories on how you managed to learn programming.
By bilibull, with 5 replies.
Last reply by bilibull, over 10 years ago:
Thank you all that have answered for your recommendations
how to push another object
By 103200, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
It will look a bit like this: <Code Omitted> And in the Ball class (useful to import the SmoothMover class and let the Ball be a subclass of it)
background music in my project is playing before i run it
By fearDnine, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
Instead of placing the 'playLoop' code into the constructor of your world (I guess you do so, you didn't provide any code), use these methods in your world class: <Code Omitted>
I need help with four things. Newbie here. URGENT :(
By starworld31, with 3 replies.
Last reply by starworld31, over 10 years ago:
That's the wrong code sorry here is what my bullet class contains
changing world and adding a actor to it
By Cameronte10, with 2 replies.
Last reply by Cameronte10, over 10 years ago:
Thanks. Helped me a lot.
Create as many actors as the user wants, How do I do that?
By Dino.Chia, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
I just tested it out. For me, this code works as long as I only type in numbers. Actually I don't know how the 'ask' method can return 'null'. If I type in a letter, then it gives me this error too (with the String instead of null). (I created a new class and removed the parameters for the creation of them (azul+rojo) and the method called on them (setTribu) to test it out.)
Change position, but don't turn image
By Bassusour, with 3 replies.
Last reply by Super_Hippo, over 10 years ago:
Try out this: <Code Omitted> The idea is to save the rotation. At the beginning of the act method, the actor rotates to the saved rotation and in the end, it rotates back to 0°.
How do i get an object to follow another?
By Stratmoss, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
The 'turnTowards' methods needs two int parameters and not an object. Change line 9 to: <Code Omitted>
find out the number of objects from the world
By Heliox00, with 12 replies.
Last reply by Heliox00, over 10 years ago:
Hab meinen Fehler jetzt gefunden auf Grundlage von deinem Tip (mit der act Methode) funktioniert jetzt alles super. Vielen dank für die Hilfe ^^
492
493
494
495
496
497
498
X