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
Coding a ramp?
By Entity1037, with 17 replies.
Last reply by Entity1037, over 11 years ago:
I have pinpointed the problem. The issue only happens when the player's code setsLocation more than once per cycle. It appears that it does has something to do with the interaction of the player setLocation from the player itself with the setLocation of the scrolling engine. I can, however, work around this issue by adjusting the height of the player's image and just moving that instead of the player (which I probably should of done in the first place, honestly).
Test 2
By jesper2411, with no replies.
<Code Omitted>
Test
By jesper2411, with no replies.
<Code Omitted>
Why is my character flying across the screen???
By GP2, with 2 replies.
Last reply by GP2, over 11 years ago:
Thank you so much! Your advice worked and I changed my class name to player to avoid complications . Again thank you
Null pointer exception in making an actor point at another actor
By Drew, with 8 replies.
Last reply by danpost, over 11 years ago:
@SullyFish, you should avoid using 'Greenfoot.delay' in scenarios that require constant movement by actors. You will probably have to adjust your 'countdown' value to compensate. BTW, this discussion is two years old and there is now a 'turnTowards' method in the Actor class. Your 'pointAtObject' method can be written like this now: <Code Omitted>
How to stop an actor while letting the other actors keep moving?
By Discovery530, with 3 replies.
Last reply by Discovery530, over 11 years ago:
lordhershey wrote...
Do you want the actor to stop forever and just sit there? If so, just make a Boolean variable call it something like NeverMoveAgain, set it to false upon construction. When the edge of the world is detected set this variable to true. In the act have this <Code Omitted>
Pretty smart actually :) I'll try that when I get back on my program
danpost wrote...
If you use a World constructor 'super' call with only three int arguments, 'super(int, int, int)', then your world is
Starting the Game
By jmdreyer, with 5 replies.
Last reply by jmdreyer, over 11 years ago:
Thanks for all your help.
How to Shoot
By wasp1928, with 5 replies.
Last reply by danpost, over 11 years ago:
What is the class of the object that spawn the bullets? if it is an Actor object of some kind, what is its movement code, if it moves (which I presume it does)?
Making an actor unable to walk through other actors
By gamer121, with 6 replies.
Last reply by danpost, over 11 years ago:
gamer121 wrote...
Should the 'if (isTouching(Wall.class)) move(-2);' should go in the act method?
It could go after 'checkKeys();' in the act method; but, I think it might be better placed at the end of the 'checkKeys' method itself (below and outside the last 'if' block).
Trouble with Tic Tac Toe AI
By JasonZhu, with 2 replies.
Last reply by JasonZhu, over 11 years ago:
It's most likely in the checkForTwo(), the rest are seemingly functional.
How do you ask a user to type in his/her name in Greenfoot?
By BeYouself, with 3 replies.
Last reply by danpost, over 11 years ago:
That is the whole code, but if you want it in method form, it would be something like this: <Code Omitted>This method will return an empty String, or a String object of zero length, ( "" ) if the user is not logged in.
Kinect
By Alexander, with 1 reply.
Replied to by BeYouself, over 11 years ago:
http://www.greenfoot.org/doc/kinect
Why does the snake start as 6 squares instead of as 1 square?
By Tommy99, with 7 replies.
Last reply by patrick26, over 11 years ago:
'
Get an actor to change color
By anonymousse, with 58 replies.
Last reply by danpost, over 11 years ago:
Please refer to the middle section,
The condtional operators
, of
this page
of the Java tutorials.
Companion?
By SullyFish, with 1 reply.
Replied to by lordhershey, over 11 years ago:
You could try something like have the bat turn towards the player, Use a countdown variable that gets set when you turn towards the character and each act method minus 1 from it, when it reaches zero turn towards the player and reset counter, this would be kind of like a gnat buzzing around your guy. Is that what you are looking for?
685
686
687
688
689
690
691
X