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
Greenfoot Java Problems (can`t use Greenfoot)
By Stern, with no replies.
Everytime I try to use installed greenfoot, for example if I want to create a new Project, Open an old one, try to compile ... Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Win32ShellFolder2.java:571) at sun.awt.shell.Win32ShellFolder2.access$400(Win32ShellFolder2.java:72) at sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:298) at sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:296) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:547) at java.lang.Thread.run(Thread.java:745) So i can not do anything :( I am using Win 7, Greenfoot 3.0.4, Java 1.8.0_112 installed (just both new downloaded and installed) and it doesn't work Debuglogfile: Greenfoot run started: Wed Nov 09 11:54:37 CET 2016 Greenfoot version: 3.0.4 Java version 1.8.0_112 Virtual machine: Java HotSpot(TM) 64-Bit Server VM 25.112-b15 (Oracle Corporation) Running on: Windows 7 6.1 (amd64) Java Home: D:\Programme\Java\jdk1.8.0_112\jre ---- Opening project: D:\Programme\Greenfoot\lib\greenfoot\startupProject 1478688881892: Listening for JDWP connection on address: javadebug Connected to debug VM via dt_shmem transport... Communication with debug VM fully established. I tried the portable Version - and again, it does not work: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130) at rmiextension.wrappers.RBlueJImpl_Stub.getOpenProjects(Unknown Source) at rmiextension.BlueJRMIClient.initialise(BlueJRMIClient.java:85) at greenfoot.core.GreenfootLauncherDebugVM$1.run(GreenfootLauncherDebugVM.java:81) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:211) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613) ... 6 more java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130) at rmiextension.wrappers.RBlueJImpl_Stub.getSystemLibDir(Unknown Source) at greenfoot.core.GreenfootLauncherDebugVM$1.run(GreenfootLauncherDebugVM.java:82) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:211) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613) ... 5 more =============== Any idea how to get at least 1 working? (Both fresh downloaded today, include java)
Spawn Objects every second
By Blattstein, with 3 replies.
Last reply by danpost, almost 10 years ago:
You could repeat lines 47 and 48 (omitting the 'Fireball' at the beginning of the first line on the repeated lines); or you could enclose those lines in a 'for' loop, the limit of which could be a random value ( maybe '3 + Greenfoot.getRandomNumber(2)' ).
Object floating above my platform and not touching
By Jochends, with 2 replies.
Last reply by Jochends, almost 10 years ago:
Thanks, That helped!
Greenfoot.playSound() vs GreenfootSound play() method
By hans.vandenbogaerde@gmail.com, with no replies.
In the piano-case from the Greenfoot book chapter 5 (1st edition, in Dutch), it would be normally be wiser to instantiate a GreenfootSound object once, reading the wav-file just once as in sound = new GreenfootSound("3a.wav") and then playing the sound as much as desired with sound.play() opposed to executing Greenfoot.playSound("3a.wav") over and over again. But, in fact, it seams that exactly the opposite is true: Greenfoot.playSound("3a.wav") performs clearly better than sound.play(). This is counter-intuitive! How come?
Finally was able to produce a code that makes a vacuum sense dust, but now it gets stuck under barriers. What to do?
By thebruus, with 1 reply.
Replied to by danpost, almost 10 years ago:
thebruus wrote...
Finally was able to produce a code that makes a vacuum sense dust, but now it gets stuck under barriers. What to do?
Question: what are lines 56 through 59 supposed to do? It appears you want to move the Roomba object toward a Barrier object, if one is below it.
Checking if there is an object
By LimeLava, with 5 replies.
Last reply by LimeLava, almost 10 years ago:
Never mind
Trying to display score on Goldfish actor wherever it is located
By JWK3986, with 1 reply.
Replied to by danpost, almost 10 years ago:
You may have to save the location where you originally had shown the score. That way, you can remove it using 'null' for the string and update the location when showing the new score: <Code Omitted>
types
By Nosson1459, with 1 reply.
Replied to by danpost, almost 10 years ago:
Nosson1459 wrote...
<Code Omitted>This code worked and then in middle of nowhere it said incompatible types actor cannot be converted to Box. Why not and why did it work before, when I didn't change anything, and I can't change the "Box box" to "Actor box" because then I cant access "isThere" .
You just need to let the compiler know that the returned object of 'getOneObjectAtOffset' is indeed a Box object. The method is designed to return an Actor
Side-scrolling
By Nosson1459, with 9 replies.
Last reply by danpost, almost 10 years ago:
Nosson1459 wrote...
How do you set where you can, and can't see?
What kind of side-scroller are you trying to create -- one that scrolls continuously regardless of any actor in the world or one that follows a specific actor? I will presume that this is for your Pengu project, in which case it follows an actor and scrolling occurs when the actor has passed a specific limit toward the right only. That is, no matter how far pengu is allowed left, no scrolling will occur (pengu would just be limited to some nominal x-coordinate value). So, anytime the world "sees" that pengu is on the ri
Help with Math.Pow and doubles.
By Chip, with 3 replies.
Last reply by Chip, almost 10 years ago:
Cheers for your help guys , sorry I didn't replay sooner, I was away for the weekend :)
font
By Nosson1459, with 1 reply.
Replied to by danpost, almost 10 years ago:
Nosson1459 wrote...
how do I set a font other than the reg. greenfoot one??
You cannot programmatically change the font used by the World class method 'showText' or the GreenfootImage constructor 'GreenfootImage(String, int, Color, Color)'. However, my
TextImage Support Class
scenario can be studied or the TextImage class from it can be used directly to create TextImage objects (which ARE GreenfootImage objects) when the class is included in your project.
nullPointerException
By Nosson1459, with 4 replies.
Last reply by Nosson1459, almost 10 years ago:
thnx
move
By Nosson1459, with 3 replies.
Last reply by danpost, almost 10 years ago:
Nosson1459 wrote...
but I want it to door 2 override move that is if door ==true and x>342 move should = false
Then change line 50 of the Pengu class to this: <Code Omitted>
Switch to the hitting animation and back to normal
By theotherroom, with 2 replies.
Last reply by theotherroom, almost 10 years ago:
Thank you, it worked!
Trying to display points on actor
By JonnyB7, with 1 reply.
Replied to by danpost, almost 10 years ago:
Try replacing line 36 of the Goldfish class with this: <Code Omitted>
430
431
432
433
434
435
436
X