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
run methode once
By ZiweZhang, with 3 replies.
Last reply by danpost, almost 8 years ago:
Change line 10 to: <Code Omitted>
Disable JavaScript version of scenario
By Game/maniac, with 2 replies.
Last reply by Game/maniac, almost 8 years ago:
Thank you.
spawning arrows
By doglover555, with 2 replies.
Last reply by danpost, almost 8 years ago:
I agree that only one subclass for the arrows is the way to go. I also believe you should have actors for the pads (again, using only one subclass of Actor). The rotation of a pad can be given to any arrow that approaches it and the arrows can be placed into the world at the location of its pad and immediately moved to the other end of the alley so it can begin its approach.
Removing object
By ZiweZhang, with 1 reply.
Replied to by Super_Hippo, almost 8 years ago:
This should work: <Code Omitted>
Show only one object of a class after hidden
By Rapoo, with 5 replies.
Last reply by danpost, almost 8 years ago:
Instead of using 'clear' on the image, it might be better to set the image of the actor to 'null' <Code Omitted>It can then be easily checked as to whether it is showing or not: <Code Omitted>
Getting error message cannot find symbol - methodCanSee
By IlikeThePrequels, with 2 replies.
Last reply by IlikeThePrequels, almost 8 years ago:
Thanks man
Falling Objects
By LarsisYoloo, with 1 reply.
Replied to by Super_Hippo, almost 8 years ago:
Create the objects from the act method of the world. Create a random number and check if it is zero, if yes, create a random fruit with a random x value and a y value of 0 (or a bit negative).
Problems with animation integers
By Aura_, with 1 reply.
Replied to by Super_Hippo, almost 8 years ago:
What do you think !time++ could do? ! is used to change (a boolean, ) true to false or false to true, ++ is used to increase a variable (for example int) by one. It is not clever to check for keypresses so often. Check it once and then nest the ifs. In the second part, it can't work at all. The conditions in lines 91, 94, 97 and 100 will never be met because they are only checked when the condition in 87 is not met which is part of the condition in the other lines. Animations are easier to handle when you have the images in arrays and simply increase a variable used to hold the current
java.lang.NullPointerException
By Roel, with 6 replies.
Last reply by Super_Hippo, almost 8 years ago:
If you really want to have the score in the Bullet class, then you could place this piece of code before you remove the bullet.
Play charater idle animation if there aren't any keys pressed
By LaurentiuRohan, with 100 replies.
Last reply by LaurentiuRohan, almost 8 years ago:
danpost wrote...
I see at lines 39 and 40 that you change the code for left, but not for right.
At least solved the problem in another way. But now in Android Studio I get an error " incompatible types: Bitmap cannot be converted to BufferedImage" in these lines:
How do i add a .gif as my world background?
By Lavenger, with 11 replies.
Last reply by Lavenger, almost 8 years ago:
danpost wrote...
I did not look to see exactly how the list of images were passed as (the type). So, I took each element from the list as an Object type and cast each as a GreenfootImage in the scaling code. I probably could just as well have had this: <Code Omitted>now that I see it returns as type 'List<GreenfootImage>'.
oh thanks ^^ I now understand how the gif scaling and animation works, couldn't have done it without you :D
How to get an actor location?
By Kestroz, with 1 reply.
Replied to by danpost, almost 8 years ago:
Unless it is a magical sword, it should not follow the actor holding it. The actor should control the orientation/location of the sword.
Continue
By doglover555, with 4 replies.
Last reply by danpost, almost 8 years ago:
Change your line 3 to: <Code Omitted>and change PauseMenu as @Yehuda suggested.
More help with my rhythm game
By Aura_, with 5 replies.
Last reply by Yehuda, almost 8 years ago:
You need two equal signs (==) when cheking equality, one sign (=) is for storing to a variable. If the topic of your question does not have anything to do with the topic of discussion, then you should start a new discussion for your topic. It would be easier to help if you posted the entire class code (in this case it doesn't make a difference, since no line numbers were mentioned) from the beginning of line 1 to the last place the caret can go. Also, it would be helpful if you showed where the problem is, if your class was bigger it would be hard to find without mention.
Removing multiple actors that are in a row
By DrCrane, with 7 replies.
Last reply by Yehuda, almost 8 years ago:
You can
View applet version
(I think the updates were never uploaded but this version works), and anyway I explained how it was done: With a list of all the intersecting objects, and the code is in the Pop class (see
previous post
).
279
280
281
282
283
284
285
X