it throws this error:
java.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\Brian Davis\Desktop\csc121\zombies\sounds\HalloweenRemix.wav read)
you have to put the wav files in the sound folder.
because of java applet security, you can't access your midi file like you normally do.
instead, you have to use some java.net stuff.
I coded this b4, so here you go, just replace the play code with this.
//you have to import these. put it at the top of the code.
import java.net.URL;
import java.io.IOException;
/**
* Play a Midi file.
*/
public static void playMidiFile(String fileName)
{
try {
URL url = getClass().getClassLoader().getResource(fileName);
if(url == null)
throw new IOException("File not found: " + fileName); //file does not exist
Sequence sequence = MidiSystem.getSequence(url);
sequencer.open();
sequencer.setSequence(sequence);
sequencer.start();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
It's a good rule of thumb to keep the sizes below 10mb (unless there a good reason for the size).
Are you trying to use wave as music? If so, there are some scenarios around here that demonstrate usage of midi, which is much smaller. I also have a scenario that uses mp3 as music, so that might help u.
Yes, there is a way (if you look around the scenarios here, there are like a couple that do that already).
My idea is that you write a separte collision check method. One that will get a list of objects, and check each of the x,y coords of those objects for collisions (also, you have to calculate into the code how tall/wide the object is so you can collision check correctly.)
Ah xD. Sorry about that. I placed the wrong map down. I'll fix it real soon, after I get some more maps in because !A||B map would be as far as I programmed so far.
2010/1/10
zombies vs you
2009/12/24
SimuPark
2009/12/24
waste
2009/12/24
Andres' Codepoint Scenario
2009/12/20
Maze Beta
2009/12/20
Maze Beta
2009/12/18
Maze Beta
2009/12/12
Maze Beta
2009/12/12
Midori World