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 setting up classes and hit detection in an actual java game.
By Entity1037, with 6 replies.
Last reply by bourne, about 10 years ago:
Since Greenfoot has this already setup in mind, you probably will be recreating something similar
How to draw a Line between two objects on my World
By Rudolf, with 1 reply.
Replied to by danpost, about 10 years ago:
You will need an Actor object to be the line while you are drawing it (click-dragging from one object to another). Whether it is to stay an Actor once the line is completed or you draw the line on the background of the world afterwards is up to you (if you want each line to maintain a link between the two objects, keeping them as actor objects might be the way to go). You will need code in your world class act method to detect the dragging and create the object for the line. The class of the line object will then take over and while dragging continues, change size, location, and rotation t
how to addobject & move it
By rohit.dudhbhate, with 6 replies.
Last reply by danpost, about 10 years ago:
Actor method 'getX' returns the x-coordinate of the actor in the world. Actor method 'getY' returns the y-coordinate of the actor in the world. World method 'getWidth' returns the width of the world (one more than the highest x-coordinate in the world, which is at the right edge; the left edge x-coordinate is zero). Actor method 'getWorld' returns the world the actor is currently in. Actor method 'setLocation' sets an actor at the given coordinates in the world it is in. Those are the methods you will need. You just have to create an 'if' statement that checks to see if the actor is at
Enemy following Player
By accucore, with 3 replies.
Last reply by accucore, about 10 years ago:
That works just the way i want it to, thank you danpost :)
「チュートリアル1:Greenfootとの対話」で最初からエラーが起きた
By funadesu, with 1 reply.
Replied to by funadesu, about 10 years ago:
報告: Greenfoot\scenarios\wombatsを自分のユーザーのドキュメントにコピーして読み込んだらうまくいった。
gif images
By Greenfootnoob, with no replies.
i have a gif images of 6 frames. can anyone give me the procedure on implementing this image in greenfoot?
How to make a text box whit questions and response options
By BasseQ47, with 12 replies.
Last reply by BasseQ47, about 10 years ago:
her is a pic of how my Greenfoot setup looks like
Greenfoot-Scenarios on Android Devices
By dibo, with 35 replies.
Last reply by dibo, about 10 years ago:
Sorry, currently I am not working on droidfoot.
Shield
By GamesGrinder1998, with 3 replies.
Last reply by GamesGrinder1998, about 10 years ago:
JetLennit wrote...
What code do you have so far?
my game is like galaga/space invaders....tell me which classes will be helpful for the code
Stop one object for specified time
By Draggondroppings, with 9 replies.
Last reply by Draggondroppings, about 10 years ago:
Woah!! I really appreciate your work! I am a student and cannot use the great improvements that you have introduced here. I will use the code that causes the Fly to stay on the Cactus though and throw back in my silly sounds. Thanks again, Paul
Reading many Intergers in one line of input
By JasonZhu, with 10 replies.
Last reply by JasonZhu, about 10 years ago:
I will show 2 solutions based on input values on a
single line
. One with a fixed amount of integer values and one with unknown amount of integer values. In both cases, rather than complicating the matter by accepting the input as a String and using the split() method to split the values between any spaces (" ") then having to parse the Strings back into Integers like I had done on my posts above, this is what I did: Fixed number of Integer input values.
The following is a remake of my above code because I realized that I needed a fixed number of input variables
:
Steam Group
By JetLennit, with 16 replies.
Last reply by JetLennit, about 10 years ago:
Anyone else interested?
How to get an OK Button?
By Rudolf, with 12 replies.
Last reply by danpost, about 10 years ago:
Maybe the last method in
this example
might help.
Error..
By mcGreen, with 18 replies.
Last reply by mcGreen, about 10 years ago:
The problem is that the boolean "onGround" is false for one or two act-cycles while walking. I dont know why it is and if you do not either its not really that important. You really helped me here danpost
Using Y position values from other classes
By qwakery, with 8 replies.
Last reply by Super_Hippo, about 10 years ago:
Actually, it is useless to use them as two classes since you can decide in the constructor, which color it should be and in which team he is. So something like <Code Omitted>Or use int instead of boolean if you may want to use more teams later. Add a Counter to the world like this then. <Code Omitted> To jump, you can orientate on this code. (not tested, coul
684
685
686
687
688
689
690
X