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 I set an Image for the mouse?
By PascalFischer, with 7 replies.
Last reply by danpost, over 5 years ago:
RcCookie wrote...
Yeah, but what I meant was that you cannot just get one MouseInfo instance and use it for the rest of the time. Also it seems unreasonable to first check if the mouse moved and then get the mouse info again.
Either way, you perform one check that verifies that a
MouseiInfo
object will not be
null
. Also, in this case of PascalFisher, no actor repositioning is required unless the mouse is moved.
Loops
By saady, with 2 replies.
Last reply by saady, over 5 years ago:
Thanks, I think I know what I can use a while loop for now.
how do i do an or statement?
By MrSkyPanda, with 4 replies.
Last reply by RcCookie, over 5 years ago:
I see what you tried - „if either one of the left and right arrow key is down then execute this“. However, what you say with this in the inner part of the statement is „left or right“, and that would be an or between two strings. You can only use the or operator between two boolean values though. So the proper statement would be: „If either the left key is down or the right key is down then execute this“. Try to express that in java now.
New world not showing entirely on Greenfoot website
By Gbasire, with 2 replies.
Last reply by Gbasire, over 5 years ago:
Thanks, it worked !
Trouble with getters
By Hissss, with 2 replies.
Last reply by Hissss, over 5 years ago:
Thank you so much! I just came to that conclusion myself and your confirmation really helps!
Adding a health value that follows the actor and goes down when the actor is hit
By Sslur, with 2 replies.
Last reply by danpost, over 5 years ago:
Sslur wrote...
I'm trying to make it so that a health value (int) that follows the actor and goes down depending when he is hit or not. I don't know how to really start it off, so If someone can show me with an example it would be great!
I uploaded a demo for you. It is
here
.
scoreboard error
By NewbJava, with 4 replies.
Last reply by NewbJava, over 5 years ago:
I am still experiencing the same issue
How can I make an actor orbit another actor?
By ek11, with 16 replies.
Last reply by ek11, over 5 years ago:
danpost wrote...
In
Moon
class, add field: <Code Omitted> Change: <Code Omitted> In
prepare
method of
GameWorld
, change: <Code Omitted>(create earth before moon in prepare method)
Thank you for your help, I really appreciate it.
"Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed"
By TerminatorHD, with 2 replies.
Last reply by TerminatorHD, over 5 years ago:
Edit: I found my Issue. Instead using "this.removeTouching(Benzinkanister.class); " I used "getWorld().removeObject(Rakete.class);
Bad quality/saturated sound
By Gbasire, with 4 replies.
Last reply by Gbasire, over 5 years ago:
It doesn't seem to change, sadly.
how can I stop the Music, when I switch the World?
By PascalFischer, with 1 reply.
Replied to by danpost, over 5 years ago:
PascalFischer wrote...
I have the Problem, that the Music plays all the time, doesn't matter on which world I am. ... are there any oz´ther methods, I can do this?
Not enough info. Show all codes related to
backgroundMusic
and indicate exactly where the codes are located.
getOneObbjectAtOffset Error massage
By EddiMitY, with 1 reply.
Replied to by danpost, over 5 years ago:
No collision checking methods can be performed on an actor outside of the class(es) of that actor.
Can I pass a variable form a world to an actor?
By Jess271, with 1 reply.
Replied to by danpost, over 5 years ago:
Jess271 wrote...
I was wondering if there is anyway I can declare a variable and assign it a value within the world's code and then use that same variable within the actor's code.
In
Actor
subclass, use: <Code Omitted>for <Code Omitted>in world.
How to export with jar dependency to website
By RcCookie, with no replies.
I've got some jar packages that I'm using in my scenario. To make them work I simply add them in the greenfoot app in the preferences, and that works totally fine. However, if I upload that to the greenfoot website, it will not work, in the console it sais that it could not find one of the imported classes. Is there a way to use the jars without having to put all the source code into the scenario's directory when uploading it?
Hello everyone. i have a little problem with my codes.
By Xarloz, with 3 replies.
Last reply by danpost, over 5 years ago:
Move the last line in the
act
method up two lines (so you do not look for zombies after being removed from the world).
100
101
102
103
104
105
106
X