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
help
By Avik, with 3 replies.
Last reply by danpost, over 13 years ago:
You placed the code after a 'return' statement that will always execute. Therefore the snippet is actually unreachable where it is placed. The compiler was not expecting code there; hence, the error. Your 'scrollPosition' appears to change by one every act cycle. In fact, being 'scrollSpeed' is 'final' (never changes), you can change your act method to:
whats wrong with this?
By Avik, with 15 replies.
Last reply by danpost, over 13 years ago:
It what way does it not work? Are you getting an error message? if so, what does it say?
Collison Detection Problem
By geekykid2013, with 2 replies.
Last reply by geekykid2013, over 13 years ago:
Here is the code for my world import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.awt.Color; /** * * The square world. The square world has Gold Eggs that need to be collected * * @author * @version 1.0 */ public class SquareWorld extends World { // private static final int GAP = 12; private Counter counter; private HealthBar healthBar; private Paddle paddle; private Robot robot; /** * Constructor for objects of class SquareWorld. * */ public SquareWorld() {
Collision Detection Problem
By geekykid2013, with 3 replies.
Last reply by geekykid2013, over 13 years ago:
Need Help with objects approaching from horizon
By Nz-Tank, with no replies.
In my game, there is a car at the bottom screen, to which object come down from a street that is narrowed. This gives the street a horizon effect. However, i can't seem to make the objects come at me from the horizon, as they are coming from all directions. I also want to collect them, but can't.
Need help smoothing out game
By programmer274, with 3 replies.
Last reply by danpost, over 13 years ago:
For any class you want to have a delay in, add the following: <Code Omitted>Then, enclose the action(s) that you want not to happen for a certain amount of time within an 'if' block using: <Code Omitted>To start (or reset) the timer, just set the value of the 'delayTimer' field to approximately sixty times the number of seconds you want it to delay for (so to delay for abo
how to pause my timer
By MBX5, with 1 reply.
Replied to by danpost, over 13 years ago:
If you already have a timer object that works, then just enclose all the code within its act method inside an 'if' statement using 'getWorld().getObjects(Player.class).isEmpty()'.
make simple menu
By danbo, with no replies.
how to make simple menu, when clicked go to the new world and strart game this the main menu http://prntscr.com/15a8pz when I click play and then go to new world sorry my english bad
UserInfo
By Kartoffelbrot, with 5 replies.
Last reply by Kartoffelbrot, over 13 years ago:
No problem, but now I found my mistake: It was a bug, with the saving button -.- Thanks to all helpers.
getNeighbours method
By bogaboy, with 2 replies.
Last reply by davmac, over 13 years ago:
getNeighbours(...) is intended for low-granularity cell-based scenarios - it's not so useful with Greeps. Try the other collision checking methods.
Background moving
By Rudi, with no replies.
Who can help me to make the background of our scenarios moving???
Greep Method List
By bogaboy, with 3 replies.
Last reply by davmac, over 13 years ago:
I don't believe that calling getX() or getY() on another object that you can already 'see' breaks any of the rules.
How can I change the picture of something in the code?
By Yongjoon, with 1 reply.
Replied to by danpost, over 13 years ago:
Any time you use the setImage method on an actor object the old image is replaced by the new one.
Is there something wrong with this code?
By Gzuzfrk, with 2 replies.
Last reply by danpost, over 13 years ago:
'getHeight' (which is interpreted as 'this.getHeight()') is not a method in the Actor class; so the compiler cannot find it using 'this' (the actor) as the object to run the method on. 'height' is a property of an image and 'image' is a property of an actor; therefore, getImage().getHeight() (interpreted as 'this.getImage().getHeight()') is what you should be using.
I need help with a game I'm making
By TheGrape, with 2 replies.
Last reply by TheGrape, over 13 years ago:
OK thank you so much! I'm going to try to add this to my code tomorrow, hopefully it works.
842
843
844
845
846
847
848
X