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
Quick questions
By woodkami, with 15 replies.
Last reply by danpost, about 14 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, about 14 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, about 14 years ago:
"Help" -> "Greenfoot Class Documentation"
Quick query...
By Omniscience, with 1 reply.
Replied to by danpost, about 14 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, about 14 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".
keep getting an error message
By michelman, with 23 replies.
Last reply by michelman, about 14 years ago:
thanks! I did what you said and it now works. changed the getOneIntersectingObject method to the getOneObjectAtOffset method.
How to make something circle?
By kiarocks, with 8 replies.
Last reply by mik, about 14 years ago:
To answer your first question: You could use turnTowards and then turn(90). You would always move at a tangent...
mouse click question
By Tomc84, with 9 replies.
Last reply by mik, about 14 years ago:
A similar thing (changing the image by rotating through a set of different images) is explained in the
Joy Of Code, Episode 17
(towards the end). However, there it uses an if-statement instead of the modulo operator (%). The modulo operator is a little more elegant, using an if statement is (initially) easier to understand. The bit about changing images starts around 16:40.
Creating custom GIFs for Greenfoot??
By NJoson, with 17 replies.
Last reply by NJoson, about 14 years ago:
I agree with Morran. I like the interface of Gimp but learning to navigate through it can be hassle.
greenfoot
By malre, with 1 reply.
Replied to by Morran, about 14 years ago:
Greenfoot is very easy to learn. It is a good application. It is used by people learning computer programming. It is also used to make serious games. For example,
Biomechanoid Chicken
,
Nightmare: Emergence
, and
RockSmash
. Look around this website to see what Greenfoot can do.
Moving enemies towards hero
By sst0005, with 3 replies.
Last reply by danpost, about 14 years ago:
The possibilities are endless! (I always wanted to say that)
Can't seem to get around this.
By nfinch1992, with 4 replies.
Last reply by nfinch1992, about 14 years ago:
i think that makes sense... i have seen this enacted in the program i made. So this does make some sense.
help quickly please
By helpme, with 3 replies.
Last reply by Morran, about 14 years ago:
Your Ball class only accepts one Counter for each Ball created. You gave one Ball 2 Counters in your PongWorld. Unless you want to have two different Balls for each Counter, you need to have your Ball class accept 2 Counters. It's not too hard, maybe something like this:
Timer that continues through different worlds
By freddekl, with 8 replies.
Last reply by freddekl, about 14 years ago:
Hey again, must say thanks for your help, but I have one final question. On the final level, I want the timer to stop and display the time as soon as the Actor reaches the world so I would have text in the background that says -------- Your Time: # (the # being the final time) How do i display a stopped final time as soon as it reaches the level?
Jar file World size issue
By danpost, with 3 replies.
Last reply by danpost, about 14 years ago:
NVM, I was the peculiar thing. I just figured something out.
997
998
999
1000
1001
1002
1003
X