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
Need actor to only turn once
By 11770, with 2 replies.
Last reply by 11770, almost 12 years ago:
i'm trying to make a pacman style game and the issue i'm having atm is with the ghosts turning too much/getting stuck. there a way i can do somthing like if within.1 of Wall.class turn?
Help with this simple problem
By sunjay001, with 1 reply.
Replied to by NikZ, almost 12 years ago:
In World_1: <Code Omitted><value> should be a data type.
Trouble with spawning (not so) random object
By christinem024, with 14 replies.
Last reply by davmac, almost 12 years ago:
When I compile it, I get an issue with the "addObject(new Fruit(), x, y); " part (I understand now that this is not a method for Actors, but I don't know what to use instead to cause a Fruit instance when the Car class catches the down key). Any suggestions?
Because the 'addObject' method is a World method, you need to qualify the method call with a World instance. In this case you can use the 'getWorld()' method to obtain a reference to such an instance. The code would look like this: <Code Omitted> This really should have be
Add objects whit different image
By vbh, with 2 replies.
Last reply by davmac, almost 12 years ago:
In fact, the 'shields' array is an array of GreenfootImage, not of String. So this line: <Code Omitted> ... should not actually compile. Since you did not post the code for your Shield class, I don't know whether the constructor expects a string or a GreenfootImage parameter. Please
use code tags
to avoid the formatting issues that you have in your post.
Can't find a mistake
By kangmj, with 3 replies.
Last reply by Super_Hippo, almost 12 years ago:
It looks like you want to create a list with all cards in it. If it is this case, you can get a list of all cards with: <Code Omitted>
Networking
By seniorjerry, with no replies.
Is it possible to make a client and server with green foot where two different people can connect such as a simple tic tac toe game?
Heelp
By kangmj, with 1 reply.
Replied to by danpost, almost 12 years ago:
If you are wanting to find out what type an object is, then use the 'instanceof' keyword. See the bottom of
this page
of the java tutorials.
Help with the "getOneObjectAtOffset()"
By kangmj, with 1 reply.
Replied to by danpost, almost 12 years ago:
I do not see how the 'getOneObjectAtOffset' method has anything to do with adding music! Anyway, Greenfoot provides two ways to implement sound into your projects. One is through the static Greenfoot method 'playSound' and the other is by creating GreenfootSound objects and calling instance methods to control them. With the static method, you have no control over the sound; it will play once through and then stop (t will not loop) and you cannot pause or check to see if it is still playing or not.
Create Game
By Boobathi, with 1 reply.
Replied to by davmac, almost 12 years ago:
Start by going through the tutorials in the
documentation
section.
Can someone translate this alrgoritm for me?
By Nnacheta56, with 8 replies.
Last reply by danpost, almost 12 years ago:
Nnacheta56 wrote...
do you know What is it called when open { and close } braces surround and group together lines of code?
That is called a block, or a block of code. A set is used to enclose the code for a class, others are used to enclose the code for methods and constructors, and still others are used to enclose the code for specific operations (such as 'if', 'while', 'do', 'for', 'switch', etc.).
turn (12); won't work as flawlessly as the tutorial vids
By philycheesesteak.java, with 5 replies.
Last reply by danpost, almost 12 years ago:
davmac wrote...
This topic was posted in 2011... maybe the time to answer it has passed :)
You are most certainly correct. I wonder why jogit666 replied to it :0
Need help using World.showText
By ILOVELABRADORS, with 3 replies.
Last reply by danpost, almost 12 years ago:
ILOVELABRADORS wrote...
Thanks, but do I have to create a new actor or do I just do it in a certain actor's action codes?
No. All you have to do is call the method on a World instance.
i'm trying to make something move back and forth but its not working
By DragonGirl, with 4 replies.
Last reply by danpost, almost 12 years ago:
You really need to give more background to your questions. Also, you should at least try something on your own and then, if you come across problems that seem to overwhelm you, post the code you tried with a brief description of what you were trying to do. Asking "How do I make a character shoot a bullet" leaves way to much to guesswork:
Rube Goldberg Challenge
By Game/maniac, with 7 replies.
Last reply by NikZ, almost 12 years ago:
Next Challenge is
here
.
Bouncing - Ball stuck at the edge
By Niles, with 4 replies.
Last reply by danpost, almost 12 years ago:
Try using 'move(-5)' before changing the rotation (see line 17 of the code Zamoht supplied). You may be able to remove 'oldEdge' from the code after inserting this line. However, I think it could still be buggy if both edges are encountered simultaneously. Maybe simplifying might help. Try this:
646
647
648
649
650
651
652
X