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 With Spawning Actors Randomy
By TimeScorpion7, with 7 replies.
Last reply by MusicPenguin, over 12 years ago:
Thanks for the answer :)
Problem
By BradH, with 38 replies.
Last reply by Y0ger, over 12 years ago:
Yes it helped :D
GamePad Errors Please Help!
By eaglejack, with no replies.
Hello, I have downloaded the GamePad Tester and Template scenarios, but on compiling both I am getting the following error log - anyone understand what is going on here? java.lang.IllegalArgumentException: Given klassFile must be a file at GamePad.loadLib(GamePad.java:55) at GamePad.<clinit>(GamePad.java:128) at ControllerWorld.<init>(ControllerWorld.java:24) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at greenfoot.core.Simulation.newInstance(Simulation.java:581) at greenfoot.platforms.ide.WorldHandlerDelegateIDE$3.run(WorldHandlerDelegateIDE.java:409) at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:468) at greenfoot.core.Simulation.maybePause(Simulation.java:281) at greenfoot.core.Simulation.runContent(Simulation.java:212) at greenfoot.core.Simulation.run(Simulation.java:205) java.lang.NoClassDefFoundError: net/java/games/input/ControllerEnvironment at gamepadlib.GamePadLoader.getGamePads(GamePadLoader.java:110) at GamePad.refreshGamePads(GamePad.java:363) at GamePad.getGamePads(GamePad.java:334) at GamePad.getNumGamePads(GamePad.java:320) at ControllerWorld.<init>(ControllerWorld.java:24) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at greenfoot.core.Simulation.newInstance(Simulation.java:581) at greenfoot.platforms.ide.WorldHandlerDelegateIDE$3.run(WorldHandlerDelegateIDE.java:409) at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:468) at greenfoot.core.Simulation.maybePause(Simulation.java:281) at greenfoot.core.Simulation.runContent(Simulation.java:212) at greenfoot.core.Simulation.run(Simulation.java:205) Caused by: java.lang.ClassNotFoundException: net.java.games.input.ControllerEnvironment at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 15 more
Gradually decrease and increasing speed
By alexpg95, with 2 replies.
Last reply by alexpg95, over 12 years ago:
It worked. Thank you so much!!
Ai shooting in my game
By Y0ger, with 7 replies.
Last reply by Y0ger, over 12 years ago:
Thanks a lot! It works.
Winning before the timer ends?
By miku622, with 1 reply.
Replied to by danpost, over 12 years ago:
Nice timer. But what does it or its code have to do with the player reaching the door. It will obviously still be running at that time (or the You Lose page would have shown beforehand); but, the timer is of no consequence ONCE the player reaches the door. Have the door or the player check for the other intersecting it and show the You Win page if so. My only concern, beyond that, is will what actions you take at that time prevent the timer from still running out and show the You Lose screen afterwards. If you use 'Greenfoot.stop()', there should be no problem. Otherwise, you may want to
java.lang.NullPointerException: The given world cannot be null.?!?!?!?!
By miku622, with 3 replies.
Last reply by miku622, over 12 years ago:
Ok i get it thanks!
Can't work out how to use <code>getText()</code>
By basil60, with 7 replies.
Last reply by danpost, over 12 years ago:
Maybe you should consult
this page
of the java tutorials.
How do i figure out what pixels are with color/alpha values?
By blangley83, with 1 reply.
Replied to by danpost, over 12 years ago:
The fourth number is called the 'alpha' value. It is the value that is changed when you use 'setTransparency' on an image. The value you give in the 'setTransparency' call is what the alpha value is set to. Unfortunately, the name of the method is sort of the opposite of what it does (it should probably be called 'setOpaqueness'). That is, the lower the value given, the higher the actual transparency. At the high limit of the value, 255, the color (or image) is completely opaque (totally non-transparent). The lower the value set on the color, the fainter and less apparent the color beco
mouse input?
By blangley83, with 3 replies.
Last reply by danpost, over 12 years ago:
The five methods you mentioned above are all the Greenfoot class methods that deal with mouse input. The 'getMouseInfo' method does not deal with input; but, instead, provides a way to get more information about the mouse input (actor clicked, buttons pressed, click count and location of mouse).
Can't work out acceleration issues.
By Heavenly_Father_Banting, with 4 replies.
Last reply by danpost, over 12 years ago:
The fix was changing the last 'getY' in the angleTo method of the Mover class to 'getX' and changing the last 'getX' in the distanceTo method to 'getY'. You do not have to add the 'getExactX' and 'getExactY' methods if you do not want to. The exactX and exactY fields have protected access from within the Mover class meaning that can be directly referred to in its subclasses. You should, however, change the 'getX()'s and 'getY()'s within the first statements of the act methods of your sub-classes of Mover (Mass1 and Mass2) to 'exactX' and 'exactY' (or 'getExactX()' and 'getExactY()' if you
addObject (new Face) populates the wrong face.
By dhollan8, with 6 replies.
Last reply by danpost, over 12 years ago:
dhollan8 wrote...
Thank You, I will try this and see what happens. I went ahead and sent this to the instructor so it was on time, with the same question that I sent you. I'll let you know if removing the bracket helps.
It is the removal of line 12 that will help. The change in the 'lookForMe' method was to limit when the image of the actor is set to only when the state of intersection of a Me object changes (only at the time the Me object starts intersecting and at the time the Me object ends intersecting). Having the image set every act cycle is a CPU-hogger.
Calling a Method on an Actor Not Currently in the World
By ddemarco06, with 2 replies.
Last reply by ddemarco06, over 12 years ago:
@danpost That worked perfectly. Thanks very much!
Differentiating between mouseMoved and mouseClicked
By MontclairState, with 5 replies.
Last reply by MontclairState, over 12 years ago:
Sorry guys I just realized what was wrong. I was making the isMouseDown boolean false unless I clicked. Fixed it in the following.
I'm have problems making a flower blink
By meganw21, with 4 replies.
Last reply by sengst, over 12 years ago:
Ok, great!
665
666
667
668
669
670
671
X