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
problem with ObjectAtOffset
By Talrasha, with 7 replies.
Last reply by danpost, almost 11 years ago:
Talrasha wrote...
I found my mistake. @ Danpost, i guess you already explained the solution in another discussion. The problem was, that objectatoffset calculates the distance from the player itself to the Object and not from (0;0), thats why i need to change getX() and getY() to certain number, means the Distance to the Bomb from the player. Thank you anyways for help :)
Actually, that was something I had overlooked. Glad you found it.
Search by subject
By TomazVDSN, with no replies.
Hi friends, How do I find discussion by subject ? Is there any field search or something that can take me to the subject of discussion ? Regards, Tomaz
Letter Orders
By ayoko, with 1 reply.
Replied to by danpost, almost 11 years ago:
We will need to see, at minimum, your code for the class of the letters.
Add objects randomly at same X' Y' coordinate
By 13111876, with 8 replies.
Last reply by danpost, almost 11 years ago:
The top edge of the screen is where the y-coordinate value is zero. Therefore: addObject(new YourObject(), Greenfoot.getRandomNumber(getWidth()),
0
);
multiple level creation from different text files
By Alan_c, with 6 replies.
Last reply by danpost, almost 11 years ago:
davmac wrote...
It's a bit unusual to leave it out, but the 'catch' block is not mandatory
if
there is a 'finally' block.
That actually does make sense. Thanks.
Getting the turn value
By Agent546, with 2 replies.
Last reply by danpost, almost 11 years ago:
Super_Hippo wrote...
Use the 'turnTowards' on the bullet when creating it, not in the act method.
For example: <Code Omitted>Of course, this is after you use 'turnTowards' to have the gun face the mouse pointer.
How to change my (horizontal-positioned plane) into vertical direction
By codedroid, with 4 replies.
Last reply by codedroid, almost 11 years ago:
Thanks @davmac and @danpost for your collaboration for helping me! It's all working :D
danpost wrote...
Lines 3 and 5 above should have method names of 'turn', not 'rotate'. As an alternative, lines 3 and 5 could be coded using the 'setRotation' method using value of '90' and '0' respectively.
davmac wrote...
danpost wrote...
Lines 3 and 5 above should have method names of 'turn', not 'rotate'
Absolutely correct, thanks. It should be: <Code Omitted>
Accessing another class (inside of class, not world)
By ObjektnoPR, with 65 replies.
Last reply by ObjektnoPR, almost 11 years ago:
I noticed, don't worry :D And i fixed the code and now everything works.:D I will post my code for Mesto tomorrow (i did it a bit diferent, i solved that spamming problem). Thank you for all you help, i couldn't done it without you.
how to calculate the income tax
By divinity, with 1 reply.
Replied to by danpost, almost 11 years ago:
From what I can tell, no rate of pay is being input and 'gsalary' is being used with a value of zero before its value is calculated. Also, you have two sets of lines where the second one overrides the first (lines 26 and 27 and lines 28 and 29). The value calculated in the first lines of each set is being replaced by the values calculated in the second lines of each set.
Moving multiple single classes at the same time
By jalaw02, with 3 replies.
Last reply by jalaw02, almost 11 years ago:
Oh! Sorry! I've just altered the game slightly to work around the problem. Thank you for the quick reply, though. Much appreciated.
how should acquire the correct gpa and output
By divinity, with 3 replies.
Last reply by danpost, almost 11 years ago:
divinity wrote...
so how do i correct that
You can introduce a loop structure to input the information for all courses taken. First, of course, you will need to move most of your fields into the 'main' method (any field whose value is to maintained beyond the call of another method).
Actor turning left/right issue. Please help!
By Dovy33, with 5 replies.
Last reply by Dovy33, almost 11 years ago:
Thanks very much with mirrored images, it worked! But I still don't really understand the intersection...
Editing/Saving the World
By rose_, with 2 replies.
Last reply by rose_, almost 11 years ago:
Thank you so much!
initializing a char variable
By divinity, with 3 replies.
Last reply by danpost, almost 11 years ago:
divinity wrote...
char grde=''; when i put it like this I am getting a syntax error but when I put a letter either A or B or may C the syntax is gone but i dont want it like that . I want it to accept any letter grade. how do i do that
I did not have nothing between the single quotes -- I had a space character in there. I thought that maybe you could use that as an unassigned grade character.
One variable that is shared between worlds
By Sphem, with 1 reply.
Replied to by davmac, almost 11 years ago:
In one of the worlds, declare a public static variable at the class level: <Code Omitted> Now you can access it anywhere as "MyWorld.myVariable". (Note, because the variable is static its value won't automatically get reset when you press the "reset" button in Greenfoot, you should probably initialise it in your first world's constructor).
506
507
508
509
510
511
512
X