Advertisement
Guest User

soundTrigger.nlvm

a guest
Jan 26th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import com.nolimitscoaster.*;
  2. import nlvm.math3d.*;
  3.  
  4. public class soundTrigger extends Script implements TrackTriggerListener {
  5. private static final String sSoundFile = "Music.ogg";
  6. StaticSound sSound;
  7.  
  8. public soundTrigger() {
  9. sSound = StaticSound.loadFromFile(sSoundFile, StaticSound.E_ENVMODE_LOCAL);
  10. if(sSound == null) {
  11. System.err.println("Sound file not found");
  12. return;
  13. }
  14. sSound.setPosition(new Vector3f(-14.0f, 35.0f, 50.0f));
  15. sSound.setGain(10.0f);
  16. }
  17.  
  18. public void onTrainEntering(TrackTrigger trigger, Train train) {
  19. sSound.play();
  20. }
  21.  
  22. public void onTrainLeaving(TrackTrigger trigger, Train train) {
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement