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 do setImage when in collision
By CaiDampier, with 4 replies.
Last reply by Yehuda, over 8 years ago:
danpost wrote...
Yehuda wrote...
but the image will change back when you press a key
Not if the code for collision checking is after the key checking code.
But no one said where that code is going to go, but it does make sense to be after the movement code (which is when/where the collision happens).
trouble need help
By B4Programming, with 3 replies.
Last reply by Yehuda, over 8 years ago:
danpost wrote...
However, the way Yehuda has shown it will not allow you to set the rotation of the Cherry object created.
I was just saying that adding an Object into the World then right afterwards changing the location is unnecessary. (But I guess I did have in mind that a new cherry should be created each time, forgetting about the rotation).
Greenfoot Glitch
By n_ibra, with 2 replies.
Last reply by Yehuda, over 8 years ago:
Since the code is in an Actor the code is being run in every Actor that's in the World, so the more Actor's that are in the World the more this code is being run, so the amount of Vehicles multiplies (exponentially).
Not able to understand wait methd
By Kalpshah6, with 5 replies.
Last reply by danpost, over 8 years ago:
Yehuda wrote...
The 'wait' method can also be used for time, not only until notify() is called but it's a method in Object meant to be called on/from an Object, it doesn't stop the whole execution of a program.
It will not "stop the whole execution of the program"; but, it will delay the whole execution for the wait duration (meaning all actions are suspended until the wait is over).
I can't remove a GreenfootImage
By JonahZW, with 2 replies.
Last reply by JonahZW, over 8 years ago:
Thank you!
color help
By batuts1, with 3 replies.
Last reply by Yehuda, over 8 years ago:
The only thing needed to be done is: <Code Omitted> If that's the error then that means that there is a greenfoot.Color class, meaning that the GreenfootImage.setColor method needs a greenfoot.Color (not a java.awt.Color). The error is coming since there are two Color classes you can be referring to, so you have to specify which one you're talking about.
Wall combine corner and rotation
By Yannickk, with 3 replies.
Last reply by Yehuda, over 8 years ago:
Yannickk wrote...
I did everything i could but it won't work. Sorry i am trying to do my best i can but i can't understand it.
What can't you understand, it's your class (I would think). The only (other) reply that's here is the one by danpost and that's saying how he doesn't understand your code.
Greenfoot doesn´t support .Wav?
By JanJet2000, with 6 replies.
Last reply by Yehuda, over 8 years ago:
JanJet2000 wrote...
Fixed it by myself Needed to add the Name in the new GreenfootSound brackets... But still thank you
Naturally you have to say which sound you want to play, Greenfoot can't play a sound if you don't say which to play.
Actor won't disappear when it hits the edge of the screen
By WhiteRoseAshes, with 6 replies.
Last reply by Yehuda, over 8 years ago:
The problem is that the X is always less than 600 so doing 'else' will make that 'if' not run. The 'if' statements should not both be checking for the same area (599). You can use 'else' if you lower the value in the first 'if' statement.
How to make an actor stay always in the centre of the scene
By GreenfootNewbie2000, with 1 reply.
Replied to by danpost, over 8 years ago:
Use the world act method to move the player back to the center and move everything else the same amount in the same direction including the background image.
text doesn't update (counter) – please help
By ProgrammingPanda, with 1 reply.
Replied to by danpost, over 8 years ago:
You really should not create a new GreenfootImage object every act cycle if not necessary. Add methods to the class that the player classes can call to bump the score (instead of changing the field values directly) and update the image only when the score changes:
I need help with my code the actor is supposed to run and jump but it just floats and moves left and right need help due monday
By Programmingprodigy, with no replies.
<Code Omitted>
how to make platforms?
By chlo, with 8 replies.
Last reply by chlo, over 8 years ago:
I added that line of code but I'm unsure how to change it to fit the width and height of the platform. I have my game set up where the world that I'm trying to put the platforms in, calls from an imported class that allows the background to scroll as the actor moves but I don't know if that would have anything to do with the actor not being able to land on the platforms. Here is the jump code I have for my actor when it jumps and where I added the code you suggested:
How do I add a visible timer that counts down?
By ProgrammingPanda, with 2 replies.
Last reply by ProgrammingPanda, over 8 years ago:
Thanks! It worked perfectly! :)
Programming A.i. for Pong
By Kronos, with 35 replies.
Last reply by Kronos, over 8 years ago:
danpost wrote...
Kronos wrote...
Line 20 and 32 needed to have '==' not '=' Line 32 was not indented enough, so it was being called as the else statement to line 18
I missed all that in the one class (I had expected the corrections in the other class to be made in that one also -- but, they were not).
No problem. I had not been looking for minor errors like that either. Anyway, the entire game now works. Thank you so much for your assistance. It is much appreciated.
345
346
347
348
349
350
351
X