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 need help with my code again. I can't get my actor to jump at all.
By jjc289, with 6 replies.
Last reply by Super_Hippo, over 6 years ago:
In your checkFall-method, you say that it should jump whenever it is on ground. The only time the jump-method should be called is in line 25. Replace line 62 with this: <Code Omitted>
resizing actor (smaller)
By annika.g, with 3 replies.
Last reply by danpost, over 6 years ago:
annika.g wrote...
Ok thank you, but that didn't really work.
What happened and what codes are you using? In what way is it not what you want? Did you set the image as the default image of objects created from the class?
Can I make this new actor the size of an actor that's already there and already has the correct size? Couldn't I just tell this new actor to adapt to the size of the already correct one?
Better to fix from above. If total fail, could try something along these lines.
I Need Help With Adding complexity to my game
By jackmads8, with 1 reply.
Replied to by danpost, over 6 years ago:
jackmads8 wrote...
how I would add a timer (counting up) on screen
See my
Value Display Tutorial
scenario.
how I would save the score of that timer into a high score table.
Multiple factors will determine this -- mainly, location and structure of high score table.
The game starts lagging
By Alexkr, with 4 replies.
Last reply by Alexkr, over 6 years ago:
I fixed it, thank you.
How do I have a prompt appear after a certain amount of time?
By arm0123, with 2 replies.
Last reply by danpost, over 6 years ago:
arm0123 wrote...
<Code Omitted>
With this part of your code, line 1 will not ever be true. The two String object are not the same object, regardless of the contents of the strings. Use the following to compare their contents: <Code Omitted>I cannot see any reason to have line 3 in this part of your code as the scenario would already be in a running state.
How do I move my work to another desktop?
By Faizcon, with no replies.
I am a beginner using greenfoot in high school and I am trying to put the work I did at home, on a different compute but I am not sure what to do, I tried using google drive, dropbox but was not sure exactly what to do since the best I could do was put the folder on google drive and open it from the other computer but the work is not saved.
How do I get the actors to spawn?
By Aden, with 1 reply.
Replied to by Aden, over 6 years ago:
i fixed it by myself nvm.
Please help with my assignments
By muller25, with 1 reply.
Replied to by danpost, over 6 years ago:
muller25 wrote...
i would like to ask how type the codes for mastermind game in greenfoot?
This is too general of an ask. Are you wanting someone to do your assignment for you? Try anything. Show what you tried and ask for help when you get stuck on something specific. I will say this much: in turn-based games (which mastermind basically is -- guess, followed by hints), your world will "control" the game.
Need help with simulation.
By addiehackney, with 1 reply.
Replied to by danpost, over 6 years ago:
addiehackney wrote...
I am making a simulation where planes fly from one city to another. How do I make the actors move from one city to the other?
Basically, your plane would need to retain a destination, or coordinates, to turn and move toward.
Problem with Limiting the use of a function
By PatrikBurris, with 7 replies.
Last reply by PatrikBurris, over 6 years ago:
Thank you very much for all the help
I need help with my code
By jjc289, with 3 replies.
Last reply by jjc289, over 6 years ago:
nevermind. It is figured out.
Stop player from moving after intersecting actor
By comfortablyNumb, with 1 reply.
Replied to by danpost, over 6 years ago:
Never use thread ops in greenfoot -- and only use Greenfoot.delay when you want the entire scenario to pause for a specified amount of time. It would be better to have the player detect this actor and the
canMove
field should not be a
static
one. How can one tell whether a field should be
static
or not? Ask what happens if you have more than one instance of the class (two or more players, in your case). If the state (field value) is at all times the same for all instances, then you can make the field
static
. In your case, I doubt you would want all to not mov
Contact with transparent images
By PowerDj, with 7 replies.
Last reply by danpost, over 6 years ago:
PowerDj wrote...
Ah, I see what you mean here. I think it would be better to describe my problem with an image: << Image Link Omitted >> Basically, the red block has already been placed while the blue block is being controlled. I want to use color methods to check when the red block is underneath the blue block, which will prevent the blue block from being placed (obviously I could just use isTouching(), but I'm using the squares to get the hang of the color detection for other images). Getting colors from the background of the image only returns grey, so I need something that checks the color
get random value from array based on level
By comfortablyNumb, with 4 replies.
Last reply by Super_Hippo, over 6 years ago:
The equals method compares the characters/content in the string (true if they are the same), == is only true if they are both the same string (the same object). As a simple rule: Always use equals instead of == for strings. (Unless you actually want to check if it is the same object of course.)
Greenfoot Bug again? - NullpointerException
By ITStudent, with 1 reply.
Replied to by danpost, over 6 years ago:
You cannot call a method (
showText
-- on last line) on a non-existent object. The reference to a
World
object returned by
getWorld
will be
null
if
this
actor is removed from the world (previous line). Change last line to: <Code Omitted>
163
164
165
166
167
168
169
X