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
Medical Office Management (aka MOM), what is wrong
By divinity, with no replies.
I know you all must be tired of me but anyways, I have this programme that I have build but it is not running as it should. It is called Medical Office Management where I have to used inheritance. I build the proram but something is deffinite;ly wrong, when I try to run it gave nothing, just blank and it keep running. the part of the program is working is the exit part. I am going to post all of the classes here so that you guys can take a look through my codes and tell me what is wrong and why it is not working properly. here are the classes. first one is the date the employee should be able to do this: A class variable which stores the number of patients noPat ii. Instance variables patID, first name, last name, phone number, date of birth (Date) and balance, which is used to keep track of any outstanding monies due by the patient. the patient class should be able to do this; A class variable which stores the number of patients noPat ii. Instance variables patID, first name, last name, phone number, date of birth (Date) and balance, which is used to keep track of any outstanding monies due by the patient Date class <Code Omitted> the employee class <Code Omitted> the patient class <Code Omitted> the person class (this class has a specification where u have to put a count (initialize to 0) and a company name of your choice. The person class <Code Omitted> The main class which is used to run the program, it is call MOM, short for Medical Office Management the main menu <Code Omitted> can someone tell me where i have gone wrong, why it is not working properly. can u gave me some ideas and how to fix it
Hello, i need help with my dialog class.
By Focused, with 6 replies.
Last reply by Focused, almost 4 years ago:
Thanks RcCookie and Super_Hippo for the help. I appreciate it. It works perfectly now! Firstly, just the first and second string of the dialog showed up. So I changed the isKeyDown method to getKey. Also i checked the length of array, so no arrayoutofBoundserror. The dialog gets removed from the world after last string. That text String works also now. It works perfectly fine now!
Hi, need help with Error & logic
By PastorI, with 1 reply.
Replied to by Super_Hippo, almost 4 years ago:
The code looks really messy, but the error comes because you remove the actor from the world (line 90 in GameSquare) and then proceed to continue calling getX and other methods on it. Some comments are also simply wrong. For example the comment regarding the keyword static. “static” has nothing to do with being a constant or unable to change. That’s what “final” is doing. Question: Why do you want to remove both GameSquares and add a new one in the same location? You could just remove one and keep the other. After you change the value, you only need to call the displayValue method, so the im
Please help,,is there a way to make this program work?
By syahwa_anugrah_ainu, with 2 replies.
Last reply by syahwa_anugrah_ainu, almost 4 years ago:
thanks for the information bro
Turn towards an actor without using turnTowards
By PandaBear1911, with 2 replies.
Last reply by PandaBear1911, almost 4 years ago:
Yeah my teacher wants me to do that without using this method. Then I'll just try to solve that with "manual" trigonometry, thanks.
Change the font of my text
By TheMuncher, with 3 replies.
Last reply by TheMuncher, almost 4 years ago:
Thanks Roshan123
Error java.lang.NullPointerException
By Slimey, with 11 replies.
Last reply by Slimey, almost 4 years ago:
Now it is saying non-static method takeDamage() cannot be referenced from a static context
How to flip an image when border is reached?
By Yaren, with 10 replies.
Last reply by danpost, almost 4 years ago:
Best is probably to retain both images (non-mirrored and mirrored) in fields:
Spawning a raining of bombs
By jdkdoen05, with 12 replies.
Last reply by danpost, almost 4 years ago:
jdkdoen05 wrote...
a second problem is that the game ends if the bomb is spawned in the world. I have no idea why this is because there is nothing written about it anywhere
Only time a game will end (exit a running state) is (1) an error occurred, in which case you will get some type of error message in the terminal console; or (2) a "Greenfoot.stop();" command was encountered.
Communicating actor to actor
By Harrypotamus, with 3 replies.
Last reply by Spock47, almost 4 years ago:
If the order of creation of car and cannon can be either way (car before cannon OR cannon before car), still a similar solution like the one RcCookie presented can be used, that works in any case (any number of cars/cannons in the world): <Code Omitted>This will work for multiple cars in the world, too. It would work for multiple cannons
Scrolling World
By jdkdoen05, with 36 replies.
Last reply by danpost, almost 4 years ago:
jdkdoen05 wrote...
Can you give me an example?
<Code Omitted>or just place the dimension required in the constructor call. For example: <Code Omitted>If dimensions given is larger than image, the image will be tiled onto the background.
Ending a programm
By jdkdoen05, with 44 replies.
Last reply by danpost, almost 4 years ago:
jdkdoen05 wrote...
That doent works. It also stoped after 2 seconds.
So, no errors. Correct?
Variable for all worlds
By jdkdoen05, with 14 replies.
Last reply by danpost, almost 4 years ago:
jdkdoen05 wrote...
This code doesn't work for us. Maybe it's because we have a ScrollWorld (the one they helped me with in another discussion). Do you maybe have a suggestion for a solution?
You will need to show your current ending code and be specific and complete as to what you want to happen.
Help. How do i turn my actor with the right angle??
By Claudiu, with 1 reply.
Replied to by danpost, almost 4 years ago:
Claudiu wrote...
I want to turn my actor(ball) with the right angle, like when it hits the wall or the brick to turn with the same angle but in the opposite direction.. but i have to know the angle between the actor and the wall it hits
The reflecting angle is always 180 minus twice the normal to the (tangent at the point of) surface hit minus the current rotation of the ball. So, vertical walls, or hitting a rectangle on its side, (with horizontal normals) would be: <Code Omitted>Horizontal walls, or hitting a rectangle on top or bottom, (with vertic
Help! i get error from a line of code thats not even ran :c
By Aaron-aid, with 7 replies.
Last reply by danpost, almost 4 years ago:
Aaron-aid wrote...
I realize it looks confusing but the enemy spawner is used in multiple levels and thus needs to change and adapt to each use (its used on lv 2 & 5) and I feel like it would be better management to make the code more flexible and have more opportunity's to be used but I can try to convert each l that uses it to the world exclusively
Maybe you need an intermediate class between
World
and your level worlds. Then you can put the spawning code there and use the
instanceof
conditional to check which type level world it actually is.
43
44
45
46
47
48
49
X