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
Ending the Game when all Trees are collected by the Camel
By Kai_LiKeAfIsH, with 2 replies.
Last reply by Kai_LiKeAfIsH, almost 11 years ago:
Thanks a lot for that quick answer! I tried it out and it worked. Tank you!
Getting the rgb values of a transparent pixel
By Super_Hippo, with 8 replies.
Last reply by Super_Hippo, almost 11 years ago:
This is very interesting. I just wrote my own testing code because I saw your post before you added the code. If I set a color and just use a method to fill an area, e.g. 'fill()', then the 'alpha' value for a single pixel is returned as 255 no matter what the color was. The red/green/blue values are the realvalue*transparency/255. So if the transparency is 255, my method works as it should. But if it is 0, it only returns zeros as rgb-values. If I set every pixel manually with a color and get this color, it works as it should (it returns the rgb and alpha of the color correctly). If I use m
Coordinate geometry and void values?
By K_wow, with 7 replies.
Last reply by davmac, almost 11 years ago:
So, if I use curly brackets after initializing a class, I can edit the methods?
You are technically
overriding
the methods - because you are creating a subclass. The method in the original class isn't changed, just in this anonymous subclass. But yes, the effect will be that you can change what the method does for objects of the subclass.
Can I also edit the variables and add new methods/variables?
You can, but you will not be able to access them directly from outside the subclass. If you want to do that, you need to use normal (named) subclasses i
How do i delay the time of removal for my actor when spawned(and does not stop entire world)?
By vegtio, with 2 replies.
Last reply by danpost, almost 11 years ago:
As I do not know exactly what your character is or what you want it to be capable of (the behavior of it), I cannot say for sure whether what I perceive is ok or not. But, it seems that you are allowing the kneepower to be on either side of the player regardless of the direction the player is facing. In other words, the kneepower could be facing either way regardless of the side of the player it is on. Somehow, it just does not appear right. Just saying.
Having problems with instanceof.
By Entity1037, with 18 replies.
Last reply by Entity1037, almost 11 years ago:
Oh yeah, it can! Cool!! Thanks!!!
How to get an actor to follow another actor.
By Dahoneybadger11, with 2 replies.
Last reply by Dahoneybadger11, almost 11 years ago:
Thank-you so much! This sure was a headache -_-.
Changing worlds when reaching a certain score?
By blueman08, with 2 replies.
Last reply by danpost, almost 11 years ago:
You can pass a reference to the old world to the other world and just set that world active later: <Code Omitted>Setting up your 'other world' with the instance field to hold the first world, you can then pass the reference with <Code Omitted>and save the reference (constructor) until needed (act).
Changing world help
By bmblevins98, with 3 replies.
Last reply by danpost, almost 11 years ago:
I does not look like you moved everything pertaining to the 'scaryman2Eaten' field into the Hero class (I do not see the 'scaryman2Ate' method in it for one thing). You probably only have one Hero, so you should be able to use this: <Code Omitted>in the bullet class when a ScareyMan2 is seen and eaten.
STUDENT IN DIRE NEED PLEASE HELP
By xstudentx, with 2 replies.
Last reply by davmac, almost 11 years ago:
Another option is to copy the 'canSee' and 'eat' methods from the Animal class into your Pie class. Or even just look at how they work and write similar code where it's necessary.
Balls hitting each other
By JDSmooth, with no replies.
So I still have my game where there are blue balls bouncing off of walls. I've gotten them to bounce off the walls just fine, but now I really want them to bounce off of each other when they hit each other. Does anyone know how I should start going about this?
Change direction of actor when moving
By vegtio, with 5 replies.
Last reply by vegtio, almost 11 years ago:
I fix my problem <Code Omitted> setRotation(getRotation()+180); was how i fixed it.
how to display text
By wahaj, with 7 replies.
Last reply by danpost, almost 11 years ago:
You can combine the String values using the '\n' escape sequence as a separator (it indicates a new line of text). This will cause each line to be centered in the image of your Instructions actor, which may not be what you want. As an alternative you can create the image of each line separately and use the 'drawImage' method to put each line exactly where you want them on one main image (you will need to know the width of the widest image and the height of one image times the number of lines to determine the size of the main image -- or, I guess you could create the image using the first wa
Compile - clears the screen each time?
By rdlatimer, with 3 replies.
Last reply by jpmyers15, almost 11 years ago:
kiarocks wrote...
There is an option called save the world if you right click on the background.
Thanks for the advice. I had the same problem and I believe it is resolved now after doing the Save The World before changing the code.
Simulation just pauses
By KevinWelch2001, with 4 replies.
Last reply by danpost, almost 11 years ago:
The greenfoot API shows the MouseInfo class (and how to acquire a MouseInfo object). It also contains all the methods you can use on a MouseInfo object. Please review the documentation.
Referring to another actor
By Hersov, with 2 replies.
Last reply by Hersov, almost 11 years ago:
Thanks alot Danpost, saving me <3
633
634
635
636
637
638
639
X