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
I'm having trouble drawing a String and setting Fonts!
By Mushi, with 4 replies.
Last reply by Mushi, almost 9 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, almost 9 years ago:
Awesome thanks alot.
Where is greenfoot API 2.7.1
By bromung, with 2 replies.
Last reply by danpost, almost 9 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, almost 9 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, almost 9 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, almost 9 years ago:
okay it works. thank you!
how to add animation when player is moving
By Nitinbc, with 1 reply.
Replied to by danpost, almost 9 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, almost 9 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, almost 9 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, almost 9 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, almost 9 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, almost 9 years ago:
Alright thanks, that worked.
How to make actor appear to world
By gudgurl123, with 1 reply.
Replied to by danpost, almost 9 years ago:
What do you have so far for the game over and loose class codes?
How to place objects in order as they are read from a text file
By Dom05, with 14 replies.
Last reply by Super_Hippo, almost 9 years ago:
I just threw this together. Not tested or anything. Hope it works and/or helps.
Can I have help flipping my Immage
By Bandito, with 5 replies.
Last reply by Bandito, almost 9 years ago:
That worked. Thanks for your help!
306
307
308
309
310
311
312
X