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
boolean
By Nosson1459, with 2 replies.
Last reply by Nosson1459, about 9 years ago:
got it stupid mistake forgot 2 call da checkHit method in da act
return
By Nosson1459, with 6 replies.
Last reply by danpost, about 9 years ago:
Nosson1459 wrote...
its fine i did trial and error and da 1st one worked thnx
If you are using: <Code Omitted>then the method will only return a true value (because you are assigning 'true' to the 'hit' variable instead of comparing the two -- which '==' would do).
Spawning Random Actors Problem
By abo123, with 4 replies.
Last reply by abo123, about 9 years ago:
Ok thanks for your time!
Piano Bugs
By abby410, with 1 reply.
Replied to by danpost, about 9 years ago:
abby410 wrote...
Could this problem be due to the updating of my computer?
We cannot say whether it is your code or not because you are not showing any of it. Please all codes related to the sounds (creating, assigning to keys, conditions for playing, etc.)
How can i put counter lives of my character?
By GeomDshai, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Remove the 'lives = 3' line and place the following at the beginning of the class: <Code Omitted>You also need an act method to call the lives method.
adding time limit to my game
By NAMYA1403, with 4 replies.
Last reply by NAMYA1403, about 9 years ago:
counter was not for this timer thing, it was for the score counter thing and is not releated to it
My car doesn't behave like it should.
By josjuuNL, with 7 replies.
Last reply by danpost, about 9 years ago:
I forgot to include code to place the actor appropriately for the direction it will be moving. In the above suggested Car class, add the following: <Code Omitted>The 'addedToWorld' method is part of the Actor class -- and like the 'act' method, it is called by greenfoot. It is called when an actor is added into any world (when using the 'addObject' method of the World class).
The sound files "music02", "get", and "gameover" refuse to play.
By ginger--ale, with 3 replies.
Last reply by danpost, about 9 years ago:
NAMYA1403 wrote...
well according to me java only accepts .wav files as audios but i aint a expert so pls follow danposts codes and advices
The GreenfootSound API states the following:
Most files of the following formats are supported: AIFF, AU, WAV, MP3 and MIDI.
Question about Greenfoot sounds
By JWK3986, with 2 replies.
Last reply by JWK3986, about 9 years ago:
Thanks for the reply. Just put in the changes you specified and everything works perfectly! Thanks for the help! :)
How to get a actor method into a world class
By Horcruxia, with 6 replies.
Last reply by danpost, about 9 years ago:
A couple of things, here. First, you do not want to call 'collision' from your world constructor. This would execute the 'touching' code (1) before any touching has been detected and (2) before any actors have had a chance to even act. Second, line 32 in the 'barrelCollision' method declares a local variable that will only exist for the execution of the method. A new variable will be declared each time the method executes. To make the variable exist between calls to the method (and until the Actor object no longer has any references to it in your project), move that line outside the metho
spawning an object from a specific side?
By FaZeOpTicm8, with 1 reply.
Replied to by danpost, about 9 years ago:
FaZeOpTicm8 wrote...
so im currently devving a simple game where you pilot a ship and shoot other ships. simple right? except whenever i use the fire key the shots only fire upward of the screen regardless of the vehicle's orientation. can you help me spawn the object from a specific side to the object please?
You will need to show the codes to your vehicle class and your shot class (that which is fired).
how to get flames on my rocket
By MissionAccomplish, with 9 replies.
Last reply by MissionAccomplish, about 9 years ago:
i take my question back , no need to help me
My bombs are duds
By Betty77, with 3 replies.
Last reply by danpost, about 9 years ago:
Betty77 wrote...
I'm thinking it might work better to call for the target health reduction in the bomb's code (seems like it would be a little simpler that way) but I'm not 100% sure how I would do that.
Actually, no; it would be much simpler to remove lines 19 through 23 from the bomb class and just insert the following to the turret class at line 22: <Code Omitted>That is what was meant when:
danpost wrote...
have turrrets remove any bombs that touch them (you already get a reference to them at line 18).
This combines the two parts, touching/rem
Health Bar
By Samas, with 10 replies.
Last reply by danpost, about 9 years ago:
Okay -- first issue is in your world constructor. You are creating multiple Bug and HealthBar objects and the Bug object in the world is not being assigned a Healthbar object. Change the world constructor to this:
how to add a time limit to my game
By MissionAccomplish, with 4 replies.
Last reply by MissionAccomplish, about 9 years ago:
Can you make me a code , THAT would be a great help
436
437
438
439
440
441
442
X