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
Can isTouching(class) be used in a constructor for world?
By ye-roon, with 5 replies.
Last reply by danpost, almost 13 years ago:
ye-roon wrote...
Thanks! That works. But can you explain why it works? Especially the addedToWorld method? Because i do not call on it anywhere in the code.
Well, you do not call the 'act' method either. They are called by the system at specific times. The 'act' method is called on the active world and all actors in that world while the scenario is running. The 'addedToWorld' method is called by the system one time immediately upon an actor being entered into a world. These are both methods in the Actor class. While the 'act' method is also included in the World class, it has tw
Scrolling Super World errors
By Baenefin, with 2 replies.
Last reply by Baenefin, almost 13 years ago:
Thank you Gevater_Tod4711, That did fix the problem indeed. I need to remember that i have to define everything and if 2 seperate things have the same definition, it won't work.
shooting things
By smilyface999, with 2 replies.
Last reply by smilyface999, almost 13 years ago:
i have put the code in but it says that i need to put in a string direction and i dont know what that is
getColor (Project for School)
By MoizRashid, with 12 replies.
Last reply by danpost, almost 13 years ago:
If you have a way to distinguish between the players in the player class you can qualify the picking up of the powerup to the specific player that is allowed to. Having an instance boolean field in the class to signify if the powerup is picked up or not can be used to control the rest.
NullPointerException
By ddvink, with 6 replies.
Last reply by danpost, almost 13 years ago:
Things would be a lot easier to work with if you just coded the Experience class like a basic Text class and controlled the text in the actor class whose values are to be displayed. Because the image is a mystery to me, I could not exactly what needs to be done, but it would be something like this: <Code Omitted>Then in you
When adding to statusboard when and object leaves the world.
By Cyan002, with 12 replies.
Last reply by Cyan002, almost 13 years ago:
Oh I just realized what you meant by the third line. xD
Serialization
By Kartoffelbrot, with 19 replies.
Last reply by mjrb4, almost 13 years ago:
Sorry, thought I'd posted after I removed it!
How to acces a method of another class
By jesusOrtaHdz, with 2 replies.
Last reply by jesusOrtaHdz, almost 13 years ago:
thanks for help me..
setDirection
By ye-roon, with no replies.
Hello everyone, I'm quite new to all this and i dont know how to properly explain it, but i will try my best. Also, this would probably work best if i could upload the whole scenario somewhere, but i can not seem to find the upload button. My problem is as follows, i am currently creating a simple game, where a nerdy guy/loser needs to get to school. The main blueprint is done, and he can move and if he hits the wrong obstacle he fails. The powerups are in place but currently do not do anything, this was just done to see where they would be. Its for a school project and we were designated team L, hence the Loser ^^. The loser has 2 different kinds of moving enemies and 1 kind that is stationary(they are girls! so stationary is scary enough for our nerd). The moving enemies consist of a couple of Dogs and some Jocks that are always eager to make our Losers life misarable. So i was digging around in some code and i found that i could re-use some code from the wombat game to make our Enemies move. I made North 0, and South 1 and removed East and West since its a topdown game and the enemies do not have to move in another direction for now. Maybe if we expand on this project in the future, for now moving up and down is enough. So i changed the code from the wombat scenario in such a way that the enemy will turn around when he hits a piece of Furnature, we have put all our immovable objects as a subclass of Furnature(so walls, the doghouse, school tables). The reason for this is it makes it easier to program, for i can now just use: (Furnature.class), rather then having to make different statements for every piece of furnature. Our walls are set in a maze like pattern. The dogs move between their doghouses and the outerwall of the school. What it does now is: it will automaticly move towards the South. When it hits the the wall in the south, its set the direction to the North and they will happily move north. But then when they hit the north wall they get stuck in a loop and the only thing you can see is the image changing from setDirection(180) to setDirection(0). It doesnt move down anymore. I have tried this with both the isTouching() method and the getOneIntersectingObject() but both end up with the same problem. So i thought, well the images have different pixel sizes, what if i change one with a 30x30 image. But that didnt work either. I will paste the code below. So if anyone has an idea where this goes amiss, that will be gladly appreciated. Also, english is not my native language, so excuse my grammar/spelling mistakes, if applicable. Kind regards, ye-roon <Code Omitted>
make a rocket move
By smilyface999, with 2 replies.
Last reply by smilyface999, almost 13 years ago:
cheers:)
Jump away from the rope
By ddvink, with no replies.
[Disallowed URL] In the image below the red arrows shows the way the char goes. I made a class with an image over the rope to climb on. Sometimes it works well and sometimes it kinda jumps away when he's almost finished climbing. Can someone explain why this happens? Yours, Dennis [Disallowed URL]
X-coords of a specific object
By ddvink, with 7 replies.
Last reply by SPower, almost 13 years ago:
Did you also improve it like danpost said?
Broken Code?
By Y3llowMustang, with 3 replies.
Last reply by davmac, almost 13 years ago:
It is as danpost says. The documentation for the method clearly states:
Set the current drawing color. This color will be used for subsequent drawing operations.
Cannot writeln()
By benskii93, with 2 replies.
Last reply by benskii93, almost 13 years ago:
Yep, Don't really know why I got that wrong. Thanks a lot.
more getKey's
By ddvink, with 2 replies.
Last reply by ddvink, almost 13 years ago:
Thanx!!!!!
785
786
787
788
789
790
791
X