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
getOneObjectAtOffset
By davemib123, with 13 replies.
Last reply by davemib123, about 11 years ago:
great. i used the last option, seems more understandable to me :)
Start Menu for game?
By ddemarco06, with 2 replies.
Last reply by ddemarco06, about 11 years ago:
That worked perfectly, thank you, sir!
gaining access to a public variable
By davemib123, with 3 replies.
Last reply by danpost, about 11 years ago:
Looking into your TileSet trees class from your other discussion thread.
Need Help With MouseClicks and Setlocation
By thatsnice1, with 2 replies.
Last reply by danpost, about 11 years ago:
erdelf wrote...
why is the code u provided in a static method ?
The error message does not suggest that the code provided was in a static method. It is saying that the call to 'setLocation' was written as if 'setLocation' was a static method when, in fact, it is not. The use of a class name (and not an object of that class), 'HeroWizard', as the object of the method call is what threw the exception. You can set the location of an instance of an Actor class; but, you cannot set the location of the Class Name or Type. Because you can create multiple instances of an Actor subclass, you
Selling java games
By Game/maniac, with 4 replies.
Last reply by lordhershey, about 11 years ago:
Excellent, I hope it goes well.
Accessing World from Actor constructor
By vtn2@calvin.edu, with 12 replies.
Last reply by danpost, about 11 years ago:
No nerves struck here.
So, it shows that I can get the World object handle in Boy before act() is called the first time. That's really what I was after
Like I said, there are multiple ways to accomplish this.
I wish GreenfootImage had a setPenWidth() method -- get that added to 2.4 quick, ok? :-)
Do not hold your breath. Try implementing your own.
I wish there was a way to set the "rotational center" of an image so you could rotate it around that point.
You can accomplish this programmatically by drawing the image on a larger image base with
java.lang.IndexOutOfBoundsException
By MontclairState, with 4 replies.
Last reply by NikZ, about 11 years ago:
IndexOutOfBounds just means you are calling a part of a list not in the list. For example: Your list of integers is 1, 3, 4, 7, 8. Then you call the tenth integer in the list. There is none, so it prints out an error.
Problem with my Project
By KTSB, with 2 replies.
Last reply by KTSB, about 11 years ago:
Thank you very much
Explotion class not removeing other class.
By efx22, with 5 replies.
Last reply by danpost, about 11 years ago:
In the act method of your Missile class you are checking to see if a Hero object intersects the missile. The method call 'getOneIntersectingObject(Hero.class)' returns that Hero object you need to remove. Replace line 21 with an actor removal statement that removes that Hero object. You can also remove line 20, as you are not actually using 'w' anywhere (nor are you even assigning anything to it).
Binary project
By drpotts2000, with 6 replies.
Last reply by danpost, about 11 years ago:
(1) How does the 'for' loop on line 4 accomplish this: * Use a for loop to iterate over each card returned by getCards() (2) Where is there any reference to a card that is already in the world; (3) Where are you using 'isShown' and 'getValue' to complete this: * On each iteration use it’s ‘isShown’ method to check if it is visible. * If it is then call the card’s ‘getValue’ method and add this to ‘total’ (4) The 'calculateTotal' method needs to return an 'int' value (as per the return type given in the method declaration line. Where is the return statement that satisfies this:
Adding more objects than expected...
By MusicPenguin, with 2 replies.
Last reply by danpost, about 11 years ago:
MusicPenguin wrote...
I can't test it right now, but I think it's because of where it's being called from. shiftTiles() is being called within a for loop which is the methods in which addNewTile() is being called.
That would make sense. Try placing the call after the switch block in the countNumberOfEmptyCellsInFront method.
Help on a game engine that uses frame skip please?
By Entity1037, with 8 replies.
Last reply by Entity1037, about 11 years ago:
Awesome! This is pretty interesting actually. Thanks for the help!
New Greenfoot install: canvass not showing
By greenkar23, with 4 replies.
Last reply by danpost, about 11 years ago:
If you wish to view the source of the World and Actor classes, you can download them. Look in the lower-right corner of
this page
.
Loop Problems
By ILOVELABRADORS, with 4 replies.
Last reply by ILOVELABRADORS, about 11 years ago:
Thanks.
How do I delete one of many actors?
By Evil_Lan, with 36 replies.
Last reply by Evil_Lan, about 11 years ago:
NikZ wrote...
That means there is nothing stored in get(0). You can prevent that by: <Code Omitted>This might work--you might need to save the code in the if into a List.
Great thanks it works
661
662
663
664
665
666
667
X