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 can I make my stride program check if the answer is right?
By D0dZi3, with 1 reply.
Replied to by danpost, almost 2 years ago:
D0dZi3 wrote...
Hey all, I am making for class a stride scenario program and I am trying to figure out how to make the program check if the answer is right or not and for it to output correct or false. Any help would be really appreciated
Will need to see your current codes to help.
Is it possible to create a timer or a block cade for the maximum number of objects?
By Mordanto, with 3 replies.
Last reply by danpost, almost 2 years ago:
AlexMue wrote...
if i could get your email address i will send my file via email
If you have errors, you can post your classes here. If not, you can upload the scenario here with the "Publish source code" checkbox checked.
drop objects
By AlexMue, with 7 replies.
Last reply by danpost, almost 2 years ago:
AlexMue wrote...
1.I want to insert a red banana when The Monkey It Velvet will no longer fall ten bananas from top to bottom, but 30 bananas
Not sure what you want here.
2.I would also like to add a timer. When you start the game it must count down from 1 minute to zero and when it hits zero the game must be over
That requires an
int
field to keep the count of act steps taken and a basic actor to display the time remaining based on that count.
3.When the game is over, it must say how many bananas you have collected
The
int
field in
Actor has been removed from the world error
By Makuro, with 2 replies.
Last reply by danpost, almost 2 years ago:
Another way to "solve" this is to change line 44 in
Projectile
class to the following: <Code Omitted>
placing object on another object
By Mordanto, with 4 replies.
Last reply by danpost, almost 2 years ago:
Mordanto wrote...
Thank you I have exchanged the two lines but I don't quite get what you meant in the first post and how to implement it.
The second post shows how to use that reference to acquire the object's location coordinates.
Why does my background start glitching when i go left or up?
By Shire, with 1 reply.
Replied to by danpost, almost 2 years ago:
Shire wrote...
I made some code to make it look like my game is focused on my actor, and the background moves accordingly when I press the arrow keys. It works fine when I move down and to the right, but in the other two directions, it glitches and starts to repeat the texture a lot. I wanted to know why this happens and how to fix it, i inserted the code that I'm using << Code Omitted >>
Line 16 should use a plus 10, not a minus 10. Lines 17 and 22 use coordinates that are outside the bounds of the world. No positive coordinate should be beyond the dimension of the image to be dra
making actors shoot each other
By xuperL, with 1 reply.
Replied to by danpost, almost 2 years ago:
Are these shooting actors player controlled or auto shooting? Show any attempted codes for this.
Greenfoot.mousePressed() condition to exit while loop behaving unexpectedly
By PaperJaxon, with 2 replies.
Last reply by PaperJaxon, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 2 years ago:
Thank you! It works now!
Changing health bar for just one actor
By 84mu3lC3p4C7, with 5 replies.
Last reply by 84mu3lC3p4C7, almost 2 years ago:
It works! Thank you so much, now I finally understand. :D
23
24
25
26
27
28
29
X