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
Problems with animation integers
By Aura_, with 1 reply.
Replied to by Super_Hippo, over 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, over 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, over 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, over 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, over 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, over 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, over 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, over 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
).
java.lang.NullPointerException
By HMH, with 4 replies.
Last reply by Super_Hippo, over 8 years ago:
Assigning a new Punktestand object to the Punkt variable still doesn't make it the one in the world, it is a new object as the world new tells you. There are a lot of ways to do it: - get a reference at runtime (only working if there is always one Punktestand object in the world: <Code Omitted> - pass a reference to the Spieler object upon creation
How to use this
By hosfeldli, with 11 replies.
Last reply by hosfeldli, over 8 years ago:
That fixed it thank you
Trouble making actor appear and disappear dynamically
By Justins9269, with 13 replies.
Last reply by danpost, over 8 years ago:
You could make all your worlds extend a single subclass of World and put the method there so Lucas can find it easily from any world.
Move another actor when another mouse is pressed on actor!
By LaurentiuRohan, with no replies.
Helo everyone, I have three actors in my world. Circle MoveLeft, Circle MoveRight, Puppy Player. I want that when mouse is pressed on the Cirlc MoveLeft Puppy player moves to the left when CircleMoveRight puppy moves to the right. How could I do that?This is the code for my Puppy Player. <Code Omitted>
I need help for my schoolproject! Without this problem it would be finished! Thank You!
By Lasklu, with 6 replies.
Last reply by Lasklu, over 8 years ago:
Yes davmac and danpost I am very sorry for my fault. I did not exactly tramslated everything of the text which I received. Firstly I thought the was only an error with my account. But after the fourth time I have read it exactly and i understood the message. This will not happen again.I´m sorry for that! What I wanted to write was that I have uploaded my project on greenfoot. This is the link: http://www.greenfoot.org/scenarios/20962 . It would be amazing if you could help despite this aggravting and bad mistake on my side!
Convert Greenfoot Games
By LaurentiuRohan, with 2 replies.
Last reply by Yehuda, over 8 years ago:
Look at
this discussion
, and the link mentioned in it.
HELP! Making an object turn at a certain set of coordinates.
By aidanbbbb, with 1 reply.
Replied to by danpost, over 8 years ago:
aidanbbbb wrote...
How do I make an object turn once it reaches a certain set of coordinates. If statement please!
Example code given (for use in act method in class of object): <Code Omitted>
281
282
283
284
285
286
287
X