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

kenshinakh's Comments

Back to kenshinakh's profile

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.
Nice job zerg, and congratulations xD.
kenshinakhkenshinakh

2009/12/24

congratulations!
great job! even though I'm not in your category lol. Congratulations!
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.
How big is your scenario? Because I got that message once before, but it went away after Dave freed up some space on the server.
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.