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
Messing about with Images
By sp33dy, with 5 replies.
Last reply by Omniscience, about 13 years ago:
@Builderboy2005 I've seen your scenarios, and they're awesome! Could you, perhaps, have a look at my issue to do with Arrays? Really need some help! Cheers.
how do i stop simulations?
By craigv, with 4 replies.
Last reply by danpost, about 13 years ago:
A 'return' statement is just that. It is a branching statement the does an immediate exit from the current method. So, let us say that if 'timeToStop()' is a method that returns a true/false value by doing a check to see if the conditions are met to stop the simulation, then in an act() method you could have (in either the world or an actors):<Code Omitted>The return statement prevents any more statements in the method from executing, which in turn allows the system to register the 'sto
Help with page 33 in the book
By joeylad, with 6 replies.
Last reply by joeylad, about 13 years ago:
Many thanks to you both and danpost in particular (I like your fractal) - I see my error(s) and I'll correct them and move on or report back if I'm stuck.
Method Minimizing
By Builderboy2005, with 5 replies.
Last reply by darkmist255, about 13 years ago:
Depending on what licenses let people do, Notepad++ has this minimizing sections feature and it's open source. If anyone takes a look through the source they might get a good prototype.
Need help on a code.....
By MakerOfGames, with 1 reply.
Replied to by Morran, about 13 years ago:
It changes depending on exactly what you want to do. But if you want to take a look at how somebody else did it, take
a look at this
getLocation
By Gazzzah, with 1 reply.
Replied to by davmac, about 13 years ago:
Hi Gazzah,
For example, object "enemy" must get the location of object "player" and store it as int playerX and int playerY.
Assuming you already have a reference to 'player' from your Enemy, then you can simply do: playerX = player.getX(); playerY = player.getY(); If you don't already that reference, then you have another problem to solve first (and from your second question, I suspect that's the case). First of all, take a look at one of the tutorials:
http://www.greenfoot.org/doc/howto-1
(And perhaps
if ("space".equals(Greenfoot.getKey()))
By programmar, with 12 replies.
Last reply by programmar, about 13 years ago:
It works now! Thank you so much to everyone who helped. Now I will add a hit counter.
Counters
By craigv, with 2 replies.
Last reply by plcs, about 13 years ago:
If you create a class that contains a static method for getting a value and also another for modifying it you can achieve it. Something like <Code Omitted> And in other classes you can call it with; <Code Omitted> And all the other commands, and this would stay consistent across all your classes. Be carefu
how do I remove objects
By craigv, with 3 replies.
Last reply by craigv, about 13 years ago:
never mind i fixed my problem :)
identifier expected
By tylers, with 3 replies.
Last reply by plcs, about 13 years ago:
Tylers, consider pressing CTRL + SHIFT+ I (please note that it is an i not an L), when inside the editor - this will attempt to fix the indentation of your class, and if you notice lines totally off with what you expect (a method's innards should be one indent more, and the closing bracket same as the methods beginning). That way you can tell if your methods start/end in the right places.
ok so im almost there....
By programmer22, with 1 reply.
Replied to by danpost, about 13 years ago:
Put it in the act() method of your scoreboard. If your scoreboard has an instance variable for the score named 'score', use 'score = c.getValue();'. When creating the scoreboard just initialize the score to zero.
shoot
By tylers, with 4 replies.
Last reply by Morran, about 13 years ago:
You're trying to make it shoot only a few times a second? Try this: Add a variable of type "int" called timeTillCanFire in your player class: <Code Omitted>After that, in your "fire()" method, do this:
it keeps saying illegal start of expression help
By tylers, with 2 replies.
Last reply by danpost, about 13 years ago:
Check the my reply to 'Identifier expected'.
why dont this work
By tylers, with 2 replies.
Last reply by tylers, about 13 years ago:
thx
Help with background music :)
By programmar, with 8 replies.
Last reply by programmar, about 13 years ago:
I moved the code into the world, and it works now! Thanks to everyone who helped!
1009
1010
1011
1012
1013
1014
1015
X