Advertisement
Guest User

Untitled

a guest
Jan 24th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 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 = "Wicked Twister NL2.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(0.0f, 15.0f, -10.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