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
high scores
By tylers, with no replies.
on my high scores ive got a a scroll bar and i don't want that how do it get rid of it
this is it
help
By tylers, with no replies.
on my scenario
here
it runs locally at 55fps but post it onto the gallery it runs at 21 ish fps. not sure why ?
Timer code?
By MakerOfGames, with 1 reply.
Replied to by danpost, over 12 years ago:
There is the system command: System.currentTimeMillis() which returns (as type 'long') the current time in milliseconds (if that is what you are looking for). (Download and check out my
Millisecond Timer
scenario).
New to Greenfoot
By sebaqu, with 1 reply.
Replied to by danpost, over 12 years ago:
The easiest thing to do is on each act cycle: 1) turn left (keep hand on left wall) 2) move(1) 3) if (blocked) move(-1) (wall was still there) 4) turn right 5) move(1) 6) if (blocked) move (-1) (wall in front now also) 7) turn right 8) move(1) 9) if (blocked) move(-1) (Oh no! dead end) 10) turn right 11) move(1) (back from whence I came) After step (1), you could make use of a 'for' loop to repeat 2 through 4 (4 times -- once for each direction). There are a few advanced mazes that this will not work for (they would have a path that goes forth and completes a cycle back to itself
What's the meaning of this piece of code please?
By poila., with 1 reply.
Replied to by danpost, over 12 years ago:
The 'public static int FlysEaten = 0;' statement will be used to keep track of how many flies that ALL of your spiders have eaten. I believe the 'canSee(Class cls)' and the 'eat(Class cls)' are methods inherited from the Animal class. The 'canSee' will check for intersecting flies with this object, and if there are any, the 'eat' will remove one. Then the counter increments with 'FlysEaten++'.
Playing sound if not playing?
By nooby123, with 2 replies.
Last reply by nooby123, over 12 years ago:
Thanks!
playerdata
By tylers, with 1 reply.
Replied to by tylers, over 12 years ago:
well ive fixed it now (could be a bug) i closed the program and restarted it
colours
By tylers, with no replies.
how do you change the colours of the text on the score board?
Little Problem with drawing ...
By arialdancer, with 1 reply.
Replied to by danpost, over 12 years ago:
From the code you have given, it appears that all you see is the note. You can only set one image to each object (but different objects of the same class can have different images). You are creating the fiveLine image and setting it to the object, then you are creating the note image and now setting it to the object (which replaces your fiveLine image). I do not see where you 'addObject' the note object into the world. From your act() method (drawFiveLine(); drawNote();), it appears that you are trying to create two different objects with the same object class. If this is so, you need t
Explosion help
By jdemshki, with 7 replies.
Last reply by davmac, over 12 years ago:
Okay, nevermind; (it doesn't say the URL, it just shows how to get there). Yes, the video is old and out-of-date. But you can easily get the support classes at the URL I provided above. Also Greenfoot 2.2.0 will come with several support classes that you can import into your scenarios.
Quick questions
By woodkami, with 15 replies.
Last reply by danpost, over 12 years ago:
You can just change the '8's to 'getWorld().getWidth() - 1' or 'getWorld().getHeight() - 1' (depending) and it will work for any size board. I checked up on 'Go (board game)' on Wikipedia. The corners are safe and the edges are fairly safe; so, what I had prior to the most recent code post was more to the rules of the game. That is, for lines 19 through 22 above, you would use:
help with getting objects to move towards another object
By mrub4, with 1 reply.
Replied to by Cesarferreir, over 12 years ago:
import java.util.List; public int pointTo(int x, int y) { int dX = x - getX();//get distance between mouse's X and player's X int dY = y - getY();//get distance between mouse's Y and player's Y double rotation = Math.atan2(dY, dX); rotation = Math.toDegrees(rotation); return (int)rotation; } List<Worm> crab = getObjectsInRange( 2000,Worm.class); if(crab.size()!=0){ pointAtObject(crab.get(0)); move(6.0);}
scores
By tylers, with 4 replies.
Last reply by davmac, over 12 years ago:
"Help" -> "Greenfoot Class Documentation"
Quick query...
By Omniscience, with 1 reply.
Replied to by danpost, over 12 years ago:
No. That is not possible. Although, you could create a public method that will except a keystroke and store it for future use, if that is what you want. Why would you want to 'pause' the execution of the scenario and still allow keystrokes to be directed to it? Maybe(?) you did not explain what you wanted clearly enough and there IS(?) a way to do what you want.
Greenfoot Help Radius
By Moritz, with 5 replies.
Last reply by Moritz, over 12 years ago:
Ok it is running =) thank you - But there is still an other problem: When I want the snake to jump and I push the "jump key" two or more times while the snake is jumping for the first time, it also will jump two or more times after landing - also when I donĀ“t push the "jump key".
990
991
992
993
994
995
996
X