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.mousePressed() condition to exit while loop behaving unexpectedly
By PaperJaxon, with 2 replies.
Last reply by PaperJaxon, about 2 years ago:
oh ok that makes sense! thanks for the reply. ill look into that!
programming game
By yuton, with 1 reply.
Replied to by danpost, about 2 years ago:
yuton wrote...
how to make an image impassable by the character and make the character jump up and down like adding gravity?
You may want to look at my
Jump and Run Demo w/Moving Platform
scenario to view its codes for such a function.
Adding gravity to my program
By linvs1, with 2 replies.
Last reply by linvs1, about 2 years ago:
Thanks for your reply!! I am using Greenfoot in school and my teacher said i should do it like this...
spawn villains
By Magzium, with 3 replies.
Last reply by danpost, about 2 years ago:
Magzium wrote...
do you also know how i can get a SpawnTimer. Or can you change the code so my SimpleTimer can be used?
The
SimpleTimer
support class uses real time, which is not the best for this purpose. Any lag in your system will cause inconsistent timing of spawns. Just use a simple
Actor
object to display the
spawnTimer
value:
hi
By alex90, with 1 reply.
Replied to by danpost, about 2 years ago:
alex90 wrote...
i want to make getWorld a static variable but i dont know how. is it even possible?
Why would you want to do that? If for an actor to access a field or method in your world class, you can just typecast what world is returned from using
getWorld
. Like so: <Code Omitted>If the actor can be in more than one type of world, you can check its type before typecasting it: <Code Omitted>
Font List
By geeeech, with 1 reply.
Replied to by danpost, about 2 years ago:
geeeech wrote...
I need a list of fonts that can be used in Greenfoot. And because some people here are a bit slow, what I mean is a list of fonts just like in word or openoffice which I can choose from. I just want the names, preferably one which looks like pixel graphics. The API of greenfoot is horrible so any help is welcome.
Download my
TextImage Support Class
scenario. Then open it in your Greenfoot application. Do not run the scenario. The
TextImage
class has a
listFonts
method in it that can be executed manual
Error cannot find symbol
By Egg, with 2 replies.
Last reply by Egg, about 2 years ago:
Thank you! It works now!
Changing health bar for just one actor
By 84mu3lC3p4C7, with 5 replies.
Last reply by 84mu3lC3p4C7, about 2 years ago:
It works! Thank you so much, now I finally understand. :D
How Do I make Camera movement only go Horizontal and vertical at a certain height?
By Fire, with 32 replies.
Last reply by danpost, about 2 years ago:
Fire wrote...
There is an error with check escape how do I fix that?
Remove the line: <Code Omitted>
Can you help me?
By BigBoy, with 1 reply.
Replied to by Super_Hippo, about 2 years ago:
Check the API here and look through the available functions. You can probably find what you need :)
https://www.greenfoot.org/files/javadoc/greenfoot/Actor.html
Can you help me?
By BigBoy, with 1 reply.
Replied to by Super_Hippo, about 2 years ago:
Could be like this if you world class is called MyWorld: <Code Omitted>
Pathfinding
By N8TH1N6, with no replies.
Hey, I wanna make my enemy find the best path to the player Class and also recognize the borders Borders work like this <Code Omitted>The movement of the enemy is just simply move(int) and when he connects with a border he turns and again moves in another direction. I want just a simple pathfinfing so the enemy follows the player around the borders etc.
Objekte runterfallen lassen
By AlexMue, with no replies.
ich habe diesen Code benutzt um Objekte von oben nach unten fallen zu lassen jetzt möchte ich Einfügen eines nach jede 5 Sekunden welche von oben nach unten fahren lassen // Objekt fallen lassen setLocation(getX(), getY() + 1); // Bodenkollision if (getY() == getWorld().getHeight() - 1) { getWorld().removeObject(this); } for (int zaehler = 0; zaehler < 10 ; zaehler++) { Banane banane = new Banane(); addObject(banane, Greenfoot.getRandomNumber(1080), Greenfoot.getRandomNumber(1)); } die beiden codes habe ich benutzt um Objekte von oben nach unten runter fallen zu lassen
Adding gun to a player
By 84mu3lC3p4C7, with 5 replies.
Last reply by 84mu3lC3p4C7, about 2 years ago:
I wasn´t able to post messages, sorry I wasn´t responding. I got little bit closer to what I want by looking at this:
How to rotate an object orbiting another object without making the object rotate
, so thank you danpost.
Add text to txt instead of overwriting (FileWriter)
By tylermwise, with 2 replies.
Last reply by tylermwise, about 2 years ago:
Oh! Thank you it works :)
25
26
27
28
29
30
31
X