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
rocket fuel
By scypax, with 1 reply.
Replied to by danpost, almost 11 years ago:
Review the first few pages of
this
tutorial.
How do I get my game to stop?
By Danny765C, with 4 replies.
Last reply by Danny765C, almost 11 years ago:
thank you so much, it worked! you just saved my grade
Glowing maze
By BrownBoii333, with 1 reply.
Replied to by danpost, almost 11 years ago:
Did you ever get this resolved?
HElp
By Elden, with 1 reply.
Replied to by danpost, almost 11 years ago:
What you have got is equivalent to this: <Code Omitted>My line 3 is basically what you have on lines 3 through 5. The 'if' condition will NEVER be true because 'getX()-5' will always be at least 6 less than 'getWorld().getHeight()' (the highest y-coordinate value an actor can have in a bounded world is one less than the height of the world) and the 'setLocation' in the 'else' block does not change the location of the actor from where it was placed on line 5. Do you want your actor to move down th
Problem with keyboard input
By Thieves, with 1 reply.
Replied to by danpost, almost 11 years ago:
The best thing to do is to keep them off the walls: (1) move (2) if intersects wall, move back
Floating Danpost "Progress Bars" (Health Bars)?
By Cam9731, with 6 replies.
Last reply by danpost, almost 11 years ago:
One more thing needs to be dealt with. We need to remove the healthBar of the zombie before removing the zombie. So the 'act' method should be more like this: <Code Omitted>
Boolean true false statements
By zyxelementxyz, with 3 replies.
Last reply by danpost, almost 11 years ago:
Another thing -- with the code as it is written (referring to the last 'if-else' segment), you have no movement to the pinball after contact with the bumper. It will just rotate in place (it will still be on the bumper on following act cycles).
How do i make my program detect when 2 objects have collided?
By LiquidFang, with 2 replies.
Last reply by LiquidFang, almost 11 years ago:
OK, thank-you. Completely forgot about the tutorials!
Function call?
By Dalvengyr, with 4 replies.
Last reply by davmac, almost 11 years ago:
How about calling getWorld() over and over again? Is that an excessive process?
No, as I've said, it's unlikely that you'll see a measurable cost to function calls.
How to make an int go up once
By BrownBoii333, with 7 replies.
Last reply by danpost, almost 11 years ago:
Add an instance boolean field to the class for tracking the state of the button -- call it 'buttonDown' (or you can be more specific and give the button name in the field name; like 'spaceDown' or 'xDown'). The two conditions for incrementing on a button down action would be (1) the 'buttonDown' field is currently 'false' and (2) the 'isKeyDown' method returns 'true'. The two conditions for the button up action would be (1) the 'buttonDown' field is currently 'true' and (2) the 'isKeyDown' method returns 'false'. In both 'if' blocks, you will change the value of the 'buttonDown' field and i
Passing variables to other classes
By gamer121, with 3 replies.
Last reply by danpost, almost 11 years ago:
The value of the constant CELL_SIZE in your Ground class is declared with an assigned value of 20. My last post shows ways you can use to have that value accessible to other classes.
Help with image
By emilpro01, with 7 replies.
Last reply by danpost, almost 11 years ago:
Maybe you do not understand the reason behind my last comment. If you do not set anything to the image fields ('image1' and 'image2') then what do you think would happen if you tried to set one of them as the image for your actor?
invalid method declaration return type required
By greenfoot1, with 3 replies.
Last reply by danpost, almost 11 years ago:
This message, 'invalid method declaration return type required', is trying to tell you that you need to include type declarations to the elements within the round brackets. When the compiler reads this line (line 22 above), it recognizes that you are declaring a method or constructor. It will then need to know certain things about it so it can direct the calling statement(s) to it. Mainly, it needs to know the name of the code-block and the
order
and type
of the arguments passed to it. I have never seen literal values as arguments -- only have I seen variable names (with thei
Let an object face another object not working
By UNDEAD_DC, with 5 replies.
Last reply by UNDEAD_DC, almost 11 years ago:
Yes your code worked. Made it so that when the Humvee hits the side now it gets "teleported" to the other side of the screen. Thank you so much for helping
Defining an instance constant?
By CKnox, with 12 replies.
Last reply by danpost, almost 11 years ago:
You need to draw the lines on the world background to produce the edges of the cells (horizontal and vertical lines gapped by the value of CELL_SIZE pixels). The default background image of the world has a default drawing color of WHITE, so it will need to be changed before drawing the lines.
628
629
630
631
632
633
634
X