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
Player Chat Possible!
By DonaldDuck, with 2 replies.
Last reply by DonaldDuck, about 13 years ago:
The score updating for recency was actually bourne's idea that I implemented recently. The store() method seemed to be not storing properly during my initial testing, but it must have been a different problem in the code. Thanks for the clarification!
Crab tutorial - turn Greenfoot.isKeyDown() act/run
By rdlatimer, with 5 replies.
Last reply by SPower, about 13 years ago:
@rdlatimer I don't think you are right. When you press act, every object will run the action act(). When you press the run button, Greenfoot simply runs the act() action for every object in the world, the whole time. So actually, the run button in Greenfoot just runs a loop where every object will run the act() method. I hope this lets you understand Greenfoot al little better. (If you're wondering where I got this information: from the Greenfoot book)
Side Scroller
By woodkami, with 4 replies.
Last reply by davmac, about 13 years ago:
Well, I just need to know the concept on how a side scrolling map works.
Ok; you implement "scrolling" by moving everything to the left (or right). In Greenfoot this could be as simple as getting all the objects (World's getObjects() method) and then looping through them and adjusting their position. You should use an unbounded world so that objects can move out of the world bounds. It's a bit more complicated if you need the background to scroll as well, but to start with you could use a plain background to avoid that problem. This technique isn't particularly efficient, but
Moment of great amnesia
By darkmist255, with 5 replies.
Last reply by darkmist255, about 13 years ago:
Math.hypot(x, y), thanks for sharing that! Yeah the abs() is redundant now that you mention it. And yeah I changed it to Actor instead of Object once I realized I need to call some methods within them. Thanks :D!
Getting some basic user information
By Spilli, with 2 replies.
Last reply by Spilli, about 13 years ago:
Great, thanks for the help, much appreciated.
Side Scroller
By woodkami, with 4 replies.
Last reply by danpost, about 13 years ago:
Download and check out this
side scroll demo
. That should get you going.
Help! Error message
By e_e13, with 5 replies.
Last reply by e_e13, about 13 years ago:
No worries, I've finally figured it out :)
Crab file not working
By Siffor, with 1 reply.
Replied to by delmar, about 13 years ago:
Hit the 'Compile' button. (Hint: whenever the classes have this stripey look, they need to be compiled.)
greenfoot piano (from the book)
By wahaj, with 2 replies.
Last reply by wahaj, about 13 years ago:
well i cant take credit for this. i did get these ideas from the book. but i understand now what to do. i think the major mistake that i was that i put the increment of a inside the if statement. my mind kind of went towards that but for some reason i didnt try it. thanks for the reply.
H
By poila., with 4 replies.
Last reply by poila., about 13 years ago:
Michionlion wrote...
it is pretty self explanatory... public void lookForFly() { declares a method, and in the method... if (canSee(Fly.class)) { tests if the method canSee() returns true when you pass in Class Fly.class. if it does return true... eat(Fly.class) it calls the method eat(), passing in Fly.class, then... increments the FlysEaten variable by 1. In this example, you would need the methods canSee(Class) and eat(Class), neither of which are included in Greenfoot.
Thank you very much I know how it works now.
Detect scenario exit?
By DonaldDuck, with 6 replies.
Last reply by kiarocks, about 13 years ago:
Looks like you could try to catch the ThreadDeath Error that happens when you refresh/close, not sure how hard it would be.
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, about 13 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, about 13 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
992
993
994
995
996
997
998
X