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
read variable from a text file
By NIRO17, with 1 reply.
Replied to by danpost, about 10 years ago:
NIRO17 wrote...
x=5 y=6 is in a text file call "location.txt". what I want to know is, how can I read this two x,y values in that txt file in green foot.. i want to make senario base on that x,y variables.Further, there is an actor class called man1 in myworld class.so what i want is set that man1 x,y location to that x,y location in that text file.how can i do this?
What have you tried? Attempt something. Keep in mind, however, that the scenario will not be able to write to a txt file when uploaded (security issues).
Code Not Working
By Freekywill, with 4 replies.
Last reply by Freekywill, about 10 years ago:
Thank you so much danpost. Not only does this code work perfectly, but it functions better than before I had the problem.
ScratchFoot: a tool for converting Scratch to Greenfoot
By vtn2@calvin.edu, with 2 replies.
Last reply by Freekywill, about 10 years ago:
This is awesome! I might tell my computer science teacher about this to see if it would beneficial for some of the lower level classes.
generate an actor during the program running
By rosh11, with 1 reply.
Replied to by danpost, about 10 years ago:
rosh11 wrote...
I want to generate an actor in the world at (500,100) during the program running (waiting 10seconds) and move it to (200,300).
Please show what you have tried, code-wise.
Project
By Footnote1, with 3 replies.
Last reply by danpost, about 10 years ago:
Nevermind my last post. I missed where you indicated 'at spawn'. However, the terminology threw me when you indicated 'turn', where more appropriate would have been 'set their rotations'.
Beam Light Problems
By Laurence, with 36 replies.
Last reply by Super_Hippo, about 10 years ago:
You mean like this? Usually you can check out the Greenfoot API and find a method which you can use. <Code Omitted>
Shopping cart scenerio need explaining
By divinity, with 14 replies.
Last reply by divinity, about 10 years ago:
okay
How to turn an object 90 degrees?
By Laurence, with 1 reply.
Replied to by danpost, about 10 years ago:
Laurence wrote...
Some of my objects face one direction and I'd like it to simply just turn 90 degrees downward.
There is a
setRotation
method in the Actor class.
my health bar wont work :(
By heeyyyoooopatty, with 3 replies.
Last reply by danpost, about 10 years ago:
Super_Hippo wrote...
I don't really think that it makes sense that the Bloctopus has to hit the enemy and the healthbar to damage the enemy.
I could be mistaken, but I think the health bar is for the Bloctopus actor and not for the enemy (which would make a little more sense).
I can't slow down my enemies animation.
By heeyyyoooopatty, with 5 replies.
Last reply by heeyyyoooopatty, about 10 years ago:
Super_Hippo wrote...
<Code Omitted>
OMG THANK YOU SO MUCH
waiting method
By NIRO17, with 1 reply.
Replied to by danpost, about 10 years ago:
NIRO17 wrote...
I am developing a scenario with two robots movements.i want to wait one robot until other robot finish it's opertion. how can i wait it
You could do it by adding boolean fields in the actor classes to indicate their active states; but is seems to me that this is something that the World object should deal with. There are three phases here (a) the first robot performs its task (b) the second robot performs its task and (c) both have completed there tasks. Therefore and int field to indicate which phase is currently being executed would be in order:
My character flying instead of jumping
By Boboy18, with 7 replies.
Last reply by Super_Hippo, about 10 years ago:
You can create an Actor subclass called 'Button', add these buttons to the menu world and pass a variable to them. Then you check if they were clicked and set the world based on the variable then. Or you let the user press a number and set the world based on that.
Add an Object in the World ?
By BrySch, with 1 reply.
Replied to by Super_Hippo, about 10 years ago:
If you have an Actor subclass named 'Rocket', the line should read: <Code Omitted>
tell me what I am missing here, practicing but need some help
By divinity, with 15 replies.
Last reply by danpost, about 10 years ago:
divinity wrote...
do I n to remove this: Loan loan = new Loan()
No. But if you want anything to print to the terminal, the 'details' method needs to be called. After that line, you could then add this: <Code Omitted>to print out the field values. I only show this as an example of having the values printed to the terminal -- but, I am quite sure you are wanting to do quite a bit more than that.
How to unload worlds?
By Laurence, with 28 replies.
Last reply by danpost, about 10 years ago:
Laurence wrote...
Since it seems I can only input one command per timer if statement (I tried putting multiple and it tears apart the whole neat sequence),
A switch statement could also be used here: <Code Omitted>
444
445
446
447
448
449
450
X