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
Just here
By holumeedey, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
With what exactly do you need help?
Too many rocks! D:
By Ariadia, with 10 replies.
Last reply by davmac, almost 11 years ago:
For some reason, I thought that a world didn't use an act method, because I had never seen one there.
Ok. You should read over the documentation for both the World and Actor classes in the
API reference
. You will see that they both have an "act" method. (Furthermore, you can put an "act" method in
any
class, though it will not have any special significance to Greenfoot unless it's in a World or Actor subclass).
Can u help me to update my health bar
By coder04, with 1 reply.
Replied to by danpost, almost 11 years ago:
It looks like you are creating a healthbar for the laser, which is not the same healthbar that you have in your Ship class. Remove line 12 and change line 50 to: <Code Omitted>You should, however, refrain from using the same name of a class as a variable name. That is, you should use something like 'Actor ship;' instead of 'Actor Ship;'. I noticed that your 'life' field starts at zero and is decreased from there. It will never be checked and found to be zero (see lines 21 through 25) . Also after that (line 26),, you are using a method that requires the actor
Projectiles removing themselves
By ajmetal, with 3 replies.
Last reply by Super_Hippo, almost 11 years ago:
The 'checkHit' method now returns a boolean. So if the Laser objects touches a SpaceFly, it will return true. Then, or if it is at an edge of the world (only top or bottom as it is right now), it will be removed from the world.
What will the following method do?
By jogit666, with 1 reply.
Replied to by danpost, almost 11 years ago:
Yes -- since 'UrRobot' is the superclass of 'AugmentedRobot', that is exactly what it will do.
I have an error in my space class
By coder04, with 1 reply.
Replied to by danpost, almost 11 years ago:
Apparently, you do not have a no-argument constructor for the Ship class and the constructor you do have required a Bar object reference be passed to it. Try changing line 96 to this: <Code Omitted>
Character won't jump properly to the left
By sunjay001, with 3 replies.
Last reply by sunjay001, almost 11 years ago:
It is indeed a hardware limitation, shift worked, thanks! @davmac
So how exactly do 3d games work?
By rrose5, with 3 replies.
Last reply by rrose5, almost 11 years ago:
Yeah but he's really helpful :)h
in range detection
By Maricano, with 7 replies.
Last reply by Maricano, almost 11 years ago:
we solved it:) thanks for all the help:)
String in switch
By erdelf, with 13 replies.
Last reply by leuveg, almost 11 years ago:
Oh, sounds good. Than i hope my shool migrate from Windows XP to Win7 or 8 so we can use Java 8. ^_^ Greetings, L.
Random Movement of 3 Actors.
By Pizza020, with 1 reply.
Replied to by davmac, almost 11 years ago:
Why do you have three subclasses? Are the requirements different between each actor? I mean: why not just have three instances of one class?
Help With Turning/Flipping!
By tReks, with 5 replies.
Last reply by danpost, almost 11 years ago:
I think you just need to add another condition (other than whether it is going left or right) for mirroring the image. That is, something like this for adjusting the image: <Code Omitted>
Need actor to only turn once
By 11770, with 2 replies.
Last reply by 11770, almost 11 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 11 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 11 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
643
644
645
646
647
648
649
X