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
Randomly spawn & remove actor
By eekje87, with 7 replies.
Last reply by danpost, about 11 years ago:
I was suggesting something like this: <Code Omitted>
Access and change a variable from another actor
By TheUnknown, with 14 replies.
Last reply by TheUnknown, about 11 years ago:
Thank you very much! Everything works perfectly!
Pushing crates.
By hesh, with 7 replies.
Last reply by danpost, about 11 years ago:
@kristal, although I cannot say how JetLennit solved this, I can say how I would solve it (which is a bit different from the method used above). I would add a method in the Crate class for moving the crate. The method would check to see if it can move in the direction given as parameter value(s), move in that direction (if possible), and return a boolean value (true/false) to indicate whether it moved or not. The method could start something like this: <Code Omitted>Then, the code to move or move while pushing a crate in the Player class could use l
MouseInfo.getButton() only works when mouse moves fix?
By Entity1037, with 2 replies.
Last reply by Entity1037, about 11 years ago:
Got it. Thank you!
How do I upload a Scenario?
By Green_Code, with 3 replies.
Last reply by danpost, about 11 years ago:
You do have a member page -- and any scenarios you upload will be accessible through it. This is your page:
http://www.greenfoot.org/users/24176
.
Drawing a line from one object to another
By jshallow86, with 14 replies.
Last reply by Super_Hippo, about 11 years ago:
Edit last post: Line 28 should be the following of course: <Code Omitted>
My Pong score counter isn't working
By jbrown401, with 5 replies.
Last reply by danpost, about 11 years ago:
By instance reference field, yes. However, you do not need a 'Score1' and a 'Score2' class; you just need a 'Score' class that you create two instance objects with: <Code Omitted>The 'get' methods will allow obj
Why Isnt the Code Working For The Red Bike(Light Cycle Game)
By tReks, with 3 replies.
Last reply by danpost, about 11 years ago:
tReks wrote...
Lol don't worry its not like a hack or anything Idk how to do dat stuff
It does not have to be coming directly from you. Dormant malware is not non-existent.
Information game.
By Greenfootnoob, with no replies.
i am currently doing a project, this project requires students to have a interactive with the speech, in which the other students can play or look at.... i was thinking of making an application in which when my class mates click a button, text comes up. anyone have any ideas? THANKYOU
Color in alpha values?
By Entity1037, with 7 replies.
Last reply by Entity1037, about 11 years ago:
Ah! Thank you!!
World constructor
By wslade, with 4 replies.
Last reply by davmac, about 11 years ago:
It does compile
It couldn't possibly compile, for the reasons I gave above - the score_field variable is not accessible from the method in which you use it. Are you now talking about different code (perhaps the second variant that you posted originally)?
Just here
By holumeedey, with 1 reply.
Replied to by Super_Hippo, about 11 years ago:
With what exactly do you need help?
Too many rocks! D:
By Ariadia, with 10 replies.
Last reply by davmac, about 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, about 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, about 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.
643
644
645
646
647
648
649
X