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
question on how to detect actor in the world
By javanoob, with 2 replies.
Last reply by javanoob, almost 13 years ago:
thank you!!! XD it worked!
Help me plz
By RedFox92, with 8 replies.
Last reply by skyhighh, almost 13 years ago:
tyvm:)
HELP! COLOUR CHANGE WHEN BOUNCEATEDGE
By USER67, with 4 replies.
Last reply by Gevater_Tod4711, almost 13 years ago:
Try replacing 'image' trough 'getImage()'. This method returns the image of your actor.
Setting Defaults
By ksksks, with 5 replies.
Last reply by Gevater_Tod4711, almost 13 years ago:
I'm still not quite shure what you need. To create a random double you can use Math.random() which return a random value beteween 0 and 1.
Let objects of the same class interact
By sihaco, with 3 replies.
Last reply by danpost, almost 13 years ago:
In Aircraft. You did want each
aircraft
to know whether a gate was available or not.
Removing an object after obtained item.
By bananafin, with 8 replies.
Last reply by danpost, almost 13 years ago:
Well done!
How to make the camera follow the actor?
By tartags11, with 1 reply.
Replied to by SPower, almost 13 years ago:
You're better off not having a world with scroll bars, since the scroll bars are only there when the display someone's using it too small to display your world. It's easier and better to use something like this:
http://www.greenfoot.org/scenarios/5806
which is a re-usable engine I made, which allows you to have a world you can walk around in.
Title Screen Help
By quicklearner, with 1 reply.
Replied to by davmac, almost 13 years ago:
You just have two world classes - one for the title screen and one for the main game. Use Greenfoot.setWorld(...) to transition from one to the other. For example: <Code Omitted> If you put that in the act() method of your title-screen world, it will switch as soon as you press Greenfoot's run button.
"Cannot find symbol- variable counter"
By quicklearner, with 6 replies.
Last reply by quicklearner, almost 13 years ago:
Okay Thanks A lot to You Both! Got It working = Happy me!!!!!!!!
Health help
By Zelmarea, with no replies.
I'm making a scenario where you play a bunny throwing knives at a slime. Right now, my code is working, but only if I have the damage done by the slime and the bunny's health equal. This is the code I've been using, in the code for the knife. The code in the slimeball section is the same just with different variable names. private int damage = 5; private int life = 50; private int slimeLife = 5; private GreenfootImage knive; { knive = new GreenfootImage("knife.png"); } public void act() { setImage(knive); if(life <= 0) { getWorld().removeObject(this); } else { move(-3); Actor Slime = (Slime) getOneIntersectingObject(Slime.class); if(Slime != null){ getWorld().removeObject(this); slimeLife = slimeLife - damage; } else { life--; } } if (slimeLife<=0) { Greenfoot.playSound("win.wav"); Greenfoot.stop(); } }
How to let an object know it has a weight?
By 13111876, with 3 replies.
Last reply by 13111876, almost 13 years ago:
This helped me a lot, thank you very much! @SPower @danpost
Help with movement
By Rhino1181, with 2 replies.
Last reply by Rhino1181, almost 13 years ago:
yeah, ive got that working, all of them turn the other way and move down but they dont do it in time, they like, take it in turns, so one will hit and turn, the next will hit the wall and turn and so on and so forth. what im trying to figure out is how to get it to when the alien furthest to the right hits the right wall, all of the aliens turn at the time of the impact. oh, and i have them moving down as well, i just need to get them in time
How can i simply open one of my worlds in the view?
By gamer9999, with 2 replies.
Last reply by danpost, almost 13 years ago:
Once you get your project back (and have full control of it), uncomment little by little what you commented out and compile after each section uncommented. If you run into the same problem as before, you know that the problem resides in the last part you uncommented.
Help with a command please.
By Dillybar, with 5 replies.
Last reply by Dillybar, almost 13 years ago:
Thank you so much! I really appreciate all of your help. It works now :). thanks
Help with getX()
By tartags11, with 10 replies.
Last reply by danpost, almost 13 years ago:
Again, the assignment of 'locationA', rather the use of 'getX()', cannot be done before the object is added into the world. You should have something like this:
788
789
790
791
792
793
794
X