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
Help Needed! non-static method getx() cannot be referenced from a static context
By TheGoldenBucket, with 1 reply.
Replied to by davmac, almost 11 years ago:
I take it that PlayerChar is a class. When you say 'PlayerChar.getX()', you are asking, therefore, for the location of a class. Classes do not have a location. Actors - i.e. instances of classes - have a location. You need to get a reference to the PlayerChar actor that you want the location of, and call getX() on that. See for example
tutorial #6
.
Game instantly goes to GameWon method
By Krhanos, with 1 reply.
Replied to by Krhanos, almost 11 years ago:
Nvm i fixed it lol <Code Omitted>needs to be <Code Omitted>
How to tell if another actor is clicked?
By NAZZA, with 2 replies.
Last reply by NAZZA, almost 11 years ago:
Thanks for the help.
How to set values?
By RagingAsian, with 16 replies.
Last reply by davmac, almost 11 years ago:
java.lang.NullPointerException at Greeps.movement(Greeps.java:93)
This is telling you that you are attempting to de-reference a null reference on line 93 of your Greeps class. First step: look at the line and see what might be null. <Code Omitted> ... the only thing on the left-hand-side of a dot operator is 'getWorld()', so that must be returning null. Which means: your object isn't in any world. Which probably means: your 'Small' subclass is removing 'this' instance from the world before it calls the 'move
WALKING LOOP!? Please Help!
By Prish950, with 2 replies.
Last reply by Prish950, almost 11 years ago:
Thank You that worked ;) awesome!!
Help!!!
By moraisai, with 2 replies.
Last reply by moraisai, almost 11 years ago:
thanks it works
Displaying the players health value
By DarkGhost, with 2 replies.
Last reply by DarkGhost, almost 11 years ago:
Thanks Hippo, I've got it working now :)
How can I stop my timer?
By Bluefoot98, with 3 replies.
Last reply by Bluefoot98, almost 11 years ago:
Ah, thanks, it works!
How can i make a list with body parts of a snake in the World?
By ZOE, with 1 reply.
Replied to by danpost, almost 11 years ago:
I suggest that you make your snake "move" by adding segments behind the head and removing the segment ahead of the tail and moving the tail to the position it was at. That way you only have to decide what image to make each segment once. The direction the head moves determines which image to give to the new segment behind it. If and when the snake grows in length, only move the head and add the new segment; do not move the tail and remove the one in front of it. DEMO:
Follow the mouse?
By Giantmac, with 12 replies.
Last reply by Giantmac, almost 11 years ago:
thank you ! ^^
How can I spawn something at a specific amount of scoreline
By moraisai, with 4 replies.
Last reply by moraisai, almost 11 years ago:
thanks
How can I let enemies shot in my direction?
By moraisai, with 4 replies.
Last reply by moraisai, almost 11 years ago:
It works! Thank you
How can I make my actors to automatically try to reach specific objects, which they should eat to win the game?
By CSBossmann, with 6 replies.
Last reply by danpost, almost 11 years ago:
What are the SharkEins objects shooting at -- I mean, if it takes one to 'see' a Robbe to 'eat' one? Anyway, you need to basically change what is in your 'move' method. You probably want that the closest Robbe object be the one the actor moves toward. That will require determining which one is closest, turning toward its location and moving. See what you can come up with, a continue discussion with issues.
How can i make a car do a loop from one side of the world to another
By dyl_fisher, with 1 reply.
Replied to by danpost, almost 11 years ago:
When (or 'if') the car returns a 'getY' value of zero, set its location to (getX(), getWorld().getWidth()).
How can I show how many lifes my figure has left?
By moraisai, with 1 reply.
Replied to by danpost, almost 11 years ago:
Create an Actor object, give it the image of the text you want to display and add the actor into the world (or use the 'showText' method of the World class). For a more detailed response, show what you tried, code-wise.
587
588
589
590
591
592
593
X