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
Issues with Fullscreen and creating worlds.
By ArchMageGaming, with 4 replies.
Last reply by Nosson1459, over 9 years ago:
danpost wrote...
I tried a copy of a scenario with it. I had no keyboard or mouse controls that previously worked with the scenario and had no file or desktop controls to work with -- could only break out of full screen by calling task manager.
I tried it and everything PRETTY MUCH worked, they just weren't as accurate. As for breaking out of full screen Gevater_Tod4711 said to use Alt + Tab, but that's also a window key shortcut and doesn't actually close the window rather it switches it to the regular Greenfoot window with the full screen window minimized. (The shortcut is used for s
Changing image when it collides
By Hondrok, with 13 replies.
Last reply by danpost, over 9 years ago:
Hondrok wrote...
I don't understand the "if (! getWorld().getObjects(GameOver.class).isEmpty()) return; " thing what it does?
It basically says to exit the method (do not have the actor do anything) if a GameOver object is in the world. If execution of the code in the act was to continue, then lines like 45, 50, 108 and 114 would undo the setting of the death image.
NullPointer when referencing value from world in class
By nat12, with 4 replies.
Last reply by nat12, almost 10 years ago:
Alright, well that's good to hear. Thank you once more.
Adding music to my game
By jacquelinereilly, with 8 replies.
Last reply by jacquelinereilly, almost 10 years ago:
I got it, thank you
How to create a method that takes as parameter any object?
By dandrei279, with 4 replies.
Last reply by dandrei279, almost 10 years ago:
Thanks! I'm going to try this.
How do I make my weapon semi-automatic?
By yungbae, with 2 replies.
Last reply by yungbae, almost 10 years ago:
Super_Hippo wrote...
You could also use this as a condition: (in addition) <Code Omitted>
This works, thank you!
If class is touching class
By MrPancakes, with 8 replies.
Last reply by danpost, almost 10 years ago:
MrPancakes wrote...
I can't run it here on my pc. Can you maybe help me with some code?
I can tell you that you will need at least four things:
a reference field for the actor that displays the bar
a control field for the value the bar is to display
a method to update the image of the bar both initially and when the control value changes
a method to change the control value that calls the method in the last item listed
These should go in, I would think (since it is a timer bar, sort of), in your World subclass.
Color
By Nosson1459, with 11 replies.
Last reply by Nosson1459, almost 10 years ago:
Thanks. (That's better.)
getKey() doesn't work für the second instance
By Thom, with 14 replies.
Last reply by Thom, almost 10 years ago:
The code-snippet of the KeyboardManager class is helpfully to understand the details. Thank you danpost.
Object out of balance
By Izzmemitch, with 55 replies.
Last reply by danpost, almost 10 years ago:
Change 'LevelGauge gauge' in the prepare method to 'this.levelGauge' -- or, just drop that line and change 'gauge' in the next line to 'levelGauge' as a LevelGauge object is already assigned to the 'levelGauge' field. In the 'buttonPressed' and in the 'win' methods, 'n == 0' should read 'n = JOptionPane.YES_OPTION' for better readability. The first change above may do something about your gauge not moving.
Resizing pictures
By jacquelinereilly, with 4 replies.
Last reply by jacquelinereilly, almost 10 years ago:
it worked, thank you!!
cannot find symbol - variable
By fonsemax, with 4 replies.
Last reply by Super_Hippo, almost 10 years ago:
You don't call the 'eat' method from anywhere. You could put the following in line 14: <Code Omitted>This will work then, but it would probably be more clever to put the code into the Person class and check for touching the block instead of doing it the other way around as you did. I mean if you have your hand on a stone (in real life), would you say that you are touching the stone or that the stone is touching you?
Shooting only once
By nat12, with 1 reply.
Replied to by danpost, almost 10 years ago:
You should use 'isKeyDown' instead of 'getKey'. Since it was spawning a bullet every act cycle, you just need to add an int timer to slow it down (so it can skip so many act cycles before shooting again).
Rotating object image and moving
By nat12, with 5 replies.
Last reply by Super_Hippo, almost 10 years ago:
(Without the "private" obviously) Glad that I could help :)
If(getImage()==Image)...
By wolfyze, with 3 replies.
Last reply by wolfyze, almost 10 years ago:
It works now. Thank you!
409
410
411
412
413
414
415
X