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
How to Change Icon in Complied Project
By nmoleo64, with 1 reply.
Replied to by danpost, almost 11 years ago:
This question is not related to java or greenfoot. It is related to your particular computer system.
Problem with shooting
By ..., with 2 replies.
Last reply by danpost, almost 11 years ago:
You are currently using the state of the 'space' key for shooting. You need to use one of the changes in the state of the key (key pressed or key released) which requires you to be able to compare the last state of the key with the current state of the key. and then when a change occurs and it is currently in the state you want for shooting, shoot.
problem with code
By mollmatt2, with 2 replies.
Last reply by mollmatt2, almost 11 years ago:
Thanks so much Danpost. I did what you suggested and I got it to work great!! thanks again.
half-world
By Haloman13445, with 1 reply.
Replied to by danpost, almost 11 years ago:
Haloman13445 wrote...
How would I modify this code so that only half the Leaves in the World change image when I click.
Put line 9 inside an if block whose condition is a 50:50 random chance. The result will not be exactly half -- but that may be more to your liking anyway.
Cant remove Actor
By Arivarasan, with 4 replies.
Last reply by Arivarasan, almost 11 years ago:
Thanks! That solved my problem.
tell me what I am not seeing here
By divinity, with 8 replies.
Last reply by divinity, almost 11 years ago:
no danpost okay danpost i think i have got it now. ah now see it thanks danpost and davmac very much
starting screen
By shane727, with 9 replies.
Last reply by danpost, almost 11 years ago:
shane727 wrote...
So have a world class that has all the actors and actually starts the game, and have a separate world that has code like "if( "1" is pressed) add this and this and change worlds?
Something like that.
Starting Game
By ironphoenix20, with 1 reply.
Replied to by danpost, almost 11 years ago:
You have one block of code in the class -- the 'public Start' constructor block. This code is executed once -- when you reset (or compile) the project and a new Start object is created. Once the Start object is created, space detection will not take place (as the code is now). As a general rule, never place mouse or keyboard detection code in the constructor of a class.
Changing direction at world edge
By hoothoot, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
Change the 'if' in line 9 to an 'else if'. As it is right now, 'edge' will immediately change back to 0 when is set to 1. This should do the same (unless edge can be something different than 0 and 1). <Code Omitted>If you use -1 and 1, it would be even easier: <Code Omitted>
Error message
By jalaw02, with 6 replies.
Last reply by jalaw02, almost 11 years ago:
Sorry. Thank you for the help anyway!
Joy of Code tutorial 5 - problems with getOneObjectAtOffset
By michaelxhermes, with 3 replies.
Last reply by michaelxhermes, almost 11 years ago:
The latest version works fine! Your prompt reply and assistance is much appreciated. Michael
Exporting to .jar problems
By matttic97, with 29 replies.
Last reply by matttic97, almost 11 years ago:
No,I tried that and it doesn't work I mean nothing shows up..
Need help with a simple school assignment
By aachabuk, with 1 reply.
Replied to by danpost, almost 11 years ago:
I have noticed that the instructions said "Keep a score by increasing some variable...". This does not say that this score value is visible in the world -- only that a variable should exist. An instance field in the character from #5 should be sufficient. Instance fields (member fields) are discussed on
this page
of the java tutorials. Loops are discussed on the following pages:
'for' loops
Help!!! I am making a vertical ping pong game and the ball wont bounce off left side
By velasmic002, with 1 reply.
Replied to by davmac, almost 11 years ago:
Please indent your code properly (see
this page
). The problem is that your code (in the wallBounce() method) only checks if the ball reaches the right-hand wall. It does not check if the ball reaches the left wall. Quite simply, there is no code to make the ball bounce off the left-hand wall, and so it doesn't. You check for collision with the right-hand wall with this code: <Code Omitted> That is, it checks if the current X co-ordinate (
getX()
) is near the
Spawning next to an object when it is clicked.
By Loled85, with no replies.
Hi, problem is in the title: when I click on one object I want an other object to spawn above it. How do I do that? o -> object that spawns after click o -> object that gets clicked. EDIT: Problem solved, never mind.
508
509
510
511
512
513
514
X