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 player jump in a different angle like 45
By Mounirmoon, with 5 replies.
Last reply by danpost, about 8 years ago:
Mounirmoon wrote...
i do not now how to make it
You will use basically the same format for jumping as for firing a bullet, tracking the state of the jumping key. You will also need to retain the horizontal direction that the jump is initiated at:
shot problem help
By Mounirmoon, with 2 replies.
Last reply by danpost, about 8 years ago:
You will never fire a bullet with the current code because you are guaranteed to use getKey method previously in either the
if (!onGround)
or its
else
part. Each time the method is called, it will return a new key or, if no key remains in the keyboard buffer, null. Also, with Greenfoot, the buffer is loaded at the beginning of each act cycle while the scenario is running, meaning that if you use the getKey method multiple times, only the one first acted on will be guaranteed to get any key. For player controlling, better is to use the
isKeyDown
Simulating a Keypress
By xtay2, with 1 reply.
Replied to by danpost, about 8 years ago:
xtay2 wrote...
Hi, i have build a game just like doodlejump. You are moving upwards in a world which is 10000 pixels high, but you have to scroll manually with your mouse to keep the camera on the player. Can I move the camera or just simulate that I use the scrollwheel on the mouse? Thx in advance xtay
Please refer to my
Scrolling Tutorial
scenario.
Removing object after some action
By sajmon1998, with 3 replies.
Last reply by danpost, about 8 years ago:
sajmon1998 wrote...
I have the assignment in which my animal(Wombat) after 50 steps must disappear. I did something like this: << Code Omitted >> And i got error: "cannot find symbol - variable Wombat". How to make this work?
If your code above is in the
Wombat
class, then use
this
instead of
Wombat
.
help me
By Jovas007, with no replies.
¿como le hago para que si un avion no atrapa en 5segundos a un cometa este cambie de posicion? HELP ME!
help me
By Jovas007, with no replies.
¿como le hago para que si un avion no atrapa en 5segundos a un cometa este cambie de posicion? HELP ME!
NEED HELP ANIMATION
By Mounirmoon, with 8 replies.
Last reply by Mounirmoon, about 8 years ago:
problems exporting to a stand alone jar file
By vbh, with 2 replies.
Last reply by vbh, about 8 years ago:
thank you :-)
Need help
By Student2394, with 2 replies.
Last reply by danpost, about 8 years ago:
Student2394 wrote...
I am trying to make a basic movement system but my if statements will not work for some reason I can only get one of the iskeydown statements running at a time << Code Omitted >>
As is, your
else
part will execute regardless of the state of the
D
key (since
else
is linked only to the
A
key part). Move line 12 to the beginning of the method and then instead of
else
, just ask if it is still
false
at line 11.
Problems using Counter in Text Actor
By KGCSTeacher, with 4 replies.
Last reply by danpost, about 8 years ago:
The same can be said for the
Good component
field. That is, the line: <Code Omitted>would need to read <Code Omitted>for the field to obtain a value and for the
getGood
method to return that object (and not
null
).
Right click on Actor not working
By ggongwer, with 4 replies.
Last reply by davmac, about 8 years ago:
I filed a
ticket
for this in our bug database, thanks.
Space Fighter
By ChristieK, with 1 reply.
Replied to by danpost, about 8 years ago:
You start with a World object and some Actor objects. What have you tried? (your question does not conform to site standards -- not specific enough and no code given).
Problem to access variable from world
By R4ylot, with 11 replies.
Last reply by R4ylot, about 8 years ago:
I tried now different solutions and I think I solved my problem now. Thank you for helping.
Send numbers of one array between two classes
By DanielG99, with 1 reply.
Replied to by danpost, about 8 years ago:
You can use a "getter" and a "setter" method in the class where the array is located. Like the following (presuming the array holds int values): <Code Omitted>Then in Class_B. you could use something like: <Code Omitted>
How to view documentation
By dr979312, with 1 reply.
Replied to by Super_Hippo, about 8 years ago:
Good question. The required HTML-Files come with the download. However, the program doesn't seem to find it. In the title it says "null" and you get an error when trying to open it in a browser telling you that the requested file can't be found. Unfortunately, I didn't find a way to make them appear by clicking on Actor/World. Seems to be a bug in 3.5.0. You can also find the Greenfoot API here:
https://www.greenfoot.org/files/javadoc/
242
243
244
245
246
247
248
X