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 ;)
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?
2009/1/8
MidiDemo
2009/1/8
Render Engine
2009/1/8
Animusic
2009/1/8
Animusic
2009/1/8
Animusic
2009/1/8
Render Engine
2009/1/4
Rasterizer
2009/1/4
Carrera acuatica
2009/1/4
Carrera acuatica