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 stop the game?
By agiastaee, with 2 replies.
Last reply by agiastaee, over 7 years ago:
its work! thanks for your help
Invisible Object Problem
By donysamdhila, with 6 replies.
Last reply by donysamdhila, over 7 years ago:
danpost wrote...
Replace lines 42 through 60 with my 2-liner above and replace lines 24 an 25 with this: <Code Omitted>Then test it out. If it is still not working, show the revised class (so it can be verified that the changes were done correctly) and explain in what way it is not what you wanted. You may also need to show the Boss class code (since that class is what this class extends and may influence what is going on).
Thanks !! It's working..
Greenfoot Lifes
By StudentGR, with 1 reply.
Replied to by danpost, over 7 years ago:
StudentGR wrote...
Hello so I am working on a project that my character is tracing items in my world and i wanted to add lifes for better marks. but whenever my character is touched by an item is dying. I want him to die after three times he is getting touched.
You will need to show the codes you ended up with (the World subclass, the HealthBar class, and the Actor subclass that has health).
I'm having trouble drawing a String and setting Fonts!
By Mushi, with 4 replies.
Last reply by Mushi, over 7 years ago:
EDIT: It was drawing the label, but adding the object of the label too far off the screen for me to see. Sorry!!!
Sharing variables through Actors
By XD-69, with 4 replies.
Last reply by XD-69, over 7 years ago:
Awesome thanks alot.
Where is greenfoot API 2.7.1
By bromung, with 2 replies.
Last reply by danpost, over 7 years ago:
Super_Hippo wrote...
I think I never heard of 2.7.1...
Neither have I. (2.4.2 was last one before 3.0.0)
the newer Greenfoot versions don't support awt anymore.
It is not the newer versions of Greenfoot; it is HTML 5 that does not. You can still use java.awt in your scenarios; but, when uploaded, they will only work in the legacy version which requires the java plug-in.
It should be possible to change your code and make it work again ... I am not sure how much work that will be.
Both imports for java.awt.Font and java.awt.Color will need removed. The
Incorrect Values
By CavemanWrath, with 6 replies.
Last reply by CavemanWrath, over 7 years ago:
What you guys gave me worked perfectly for what I want. Thanks!
HELP plz
By _The_Black_Swordsman_, with 2 replies.
Last reply by danpost, over 7 years ago:
The code Hippo provided is not quite the same as what you had while at the same time keeping the image from rotating. Your original code will have 4-way movement and is biased toward the last one being checked along each axis (right and down take priority). What Hippo provided is unbiased 8-way movement where the conditional check on the last line is optional (not really needed). For 4-way unbiased movement, change the condition on the last line to this: <Code Omitted>which ensures that at least one of them is zero. Optionally, this could be used:
Object not found
By Simon1122111, with 5 replies.
Last reply by Simon1122111, over 7 years ago:
okay it works. thank you!
how to add animation when player is moving
By Nitinbc, with 1 reply.
Replied to by danpost, over 7 years ago:
Nitinbc wrote...
can anybody hellp me to explain about adding animation to the image while moving
It is the regulated cycling of a specific set of images on an actor dependent on the current situation or conditions. If the situation changes or the conditions change, the image set may need changed. The regulating of the cycling of images controls how long each image in the set is to be displayed by the actor. So, one field required will be a timer int field to regulate the rate of changing of the images in the set. The information asked for was quite general in nature; that is, no de
Randomly pick specific number
By ari21, with 9 replies.
Last reply by danpost, over 7 years ago:
Yehuda wrote...
I think the word "between" in your first post mixed me up.
What clued me in was "between 65
or
75" -- not
and
.
update the height of stacked objects
By spaceleaf, with 3 replies.
Last reply by danpost, over 7 years ago:
I do not know the movement of the actor(s) or what moves them. I do not know how accurate you want to be in the placement of the objects. All I know is you are trying to limit how high the actors stack and, now with your last post, I am presuming that the placed actor is to align horizontally with a Plate object (which it may or may not be touching). Maybe you can give a synopsis of what you want to happen and how -- so any answer given is an informed one.
how to make space for automatic shooting
By kogen, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Basic code: <Code Omitted>You will notice that it will constantly shoot when you press space. To avoid that, you need a timer.
Transform isKeyDown to mousePressed
By blblewah, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Your condition could be that either the key or the mouse is pressed. Note that pressing the mouse is a little bit different. There is no "isMouseKeyDown" method. You can only check when the mouse changes from one state to another. So when it is pressed and when it is released. But you could check if a mouse press is detected on the button and then check the location of the mouse (if it is still over the button) and if the button was released. If one of that happened, "isMouseKeyDown" would be false.
Getting Rotation
By Bandito, with 2 replies.
Last reply by Bandito, over 7 years ago:
Alright thanks, that worked.
303
304
305
306
307
308
309
X