This site requires JavaScript, please enable it in your browser!
Greenfoot back

mjrb4's Comments

Back to mjrb4's profile

Ah, sorry, I'm running the development version of 1.5 at the moment - does it not open at all in 1.4.6?
Incidentally, is it just me or do the keyboard controls not seem to work?
http://greenfootgallery.org/scenarios/535
Ah fair enough :) The ball motion does work nicely even if the notes appear random! Incidentally, there might be a way round uploading loads of individual sounds, I'll see if I can throw a quick demo together of what I mean and upload it.
Nice idea, but after having a look at the code, it looks like there's a bug on this line: count1 = score[place1] + score[place1+2]; (And the equivalent with count2.) After a while left running the scenario, I was proven correct :P java.lang.ArrayIndexOutOfBoundsException: 800 at Xylophone.act(Xylophone.java:90) at greenfoot.core.Simulation.runOneLoop(Simulation.java:200) at greenfoot.core.Simulation.run(Simulation.java:129) Couple of other points - you do know you can use Greenfoot.getRandomNumber rather than Math.random? It's just simpler and doesn't require all the integer casting. Oh and you could reduce a lot of code duplication by cutting your act method down into a few seperate methods ;)
3D seems to be taking the gallery by storm lately ;)
Very nice!
Adding the with-source tag doesn't add the source automatically, you also need to select the "publish source code" check box.
It keeps generating a nullpointerexception for me - it's hard to know what exactly is going on without the source to look at, but a good start would be to make sure that you're referring to all the images you're using in the right case and you've declared them all properly. If it helps you sort the problem, the console output I'm getting is: java.lang.NullPointerException at greenfoot.util.GraphicsUtilities.toCompatibleTranslucentImage(GraphicsUtilities.java:274) at greenfoot.util.GraphicsUtilities.loadCompatibleTranslucentImage(GraphicsUtilities.java:221) at greenfoot.GreenfootImage.loadURL(GreenfootImage.java:143) at greenfoot.GreenfootImage.loadFile(GreenfootImage.java:167) at greenfoot.GreenfootImage.<init>(GreenfootImage.java:70) at greenfoot.World.setBackground(World.java:152) at Mar.iniciaJuego(Mar.java:190) at Iniciar.act(Iniciar.java:24) at greenfoot.core.Simulation.runOneLoop(Simulation.java:199) at greenfoot.core.Simulation.run(Simulation.java:128) If you want to post the source, I and others might be able to help a bit more :) Also, what's the scenario meant to do?