import director, random from constants import * OUTSIDE_CHANNEL = "left"; INSIDE_CHANNEL = "right"; switch_sound = director.load_sound("scenes/p2/audio/switch.ogg") ghost_story_sound = director.load_sound("scenes/p2/audio/ghost_story.ogg") def reset(): director.set_on(WELCOME_SIGN_RELAY) director.set_on(CHAIR_SPOT_RELAY) director.set_off(GREEN_LIGHT_RELAY) director.set_off(RED_LIGHT_RELAY) director.add_trigger(PROXIMITY_TRIGGER, welcome, (), bouncetime=2) director.add_trigger(DOOR_TRIGGER, enter, (), bouncetime=2) director.add_trigger(CHAIR_TRIGGER, play, (), bouncetime=2) director.play_sound(ghost_story_sound, loops=-1, channel=INSIDE_CHANNEL) def welcome(): director.play_sound("scenes/p2/audio/welcome.ogg", channel=OUTSIDE_CHANNEL) def enter(): # Stop the idle sounds ghost_story_sound.stop() director.play_sound("scenes/p2/audio/take_a_seat.ogg", channel=INSIDE_CHANNEL) director.set_off(WELCOME_SIGN_RELAY, 2) director.remove_trigger(DOOR_TRIGGER)
import director, random from constants import * OUTSIDE_CHANNEL = "left" INSIDE_CHANNEL = "right" switch_sound = director.load_sound("scenes/p2/audio/switch.ogg") ghost_story_sound = director.load_sound("scenes/p2/audio/ghost_story.ogg") def reset(): director.set_on(WELCOME_SIGN_RELAY) director.set_on(CHAIR_SPOT_RELAY) director.set_off(GREEN_LIGHT_RELAY) director.set_off(RED_LIGHT_RELAY) director.add_trigger(PROXIMITY_TRIGGER, welcome, (), bouncetime=2) director.add_trigger(DOOR_TRIGGER, enter, (), bouncetime=2) director.add_trigger(CHAIR_TRIGGER, play, (), bouncetime=2) director.play_sound(ghost_story_sound, loops=-1, channel=INSIDE_CHANNEL) def welcome(): director.play_sound("scenes/p2/audio/take_a_seat.ogg", channel=OUTSIDE_CHANNEL) def enter(): # Stop the idle sounds ghost_story_sound.stop()
import director, random from constants import * SOUND_CHANNEL = "right" RUN_TIME = 10 hammer_sound = director.load_sound("scenes/p1/audio/toxic_hammer.ogg") def play(): # TOXIC_HAMMER_RELAY # TOXIC_LIFT_RELAY director.play_sound("scenes/p1/audio/toxic_trigger.ogg", delay=1, channel=SOUND_CHANNEL) director.set_on(TOXIC_LIFT_RELAY, 0, 15) def limit_switch(): director.set_off(TOXIC_LIFT_RELAY) # Setup a hammer to play at random intervals def hammer_time(): director.play_sound(hammer_sound, channel=SOUND_CHANNEL); director.set_on(TOXIC_HAMMER_RELAY, 0, random.randrange(2000, 5000)/1000) director.schedule(random.randrange(20, 120), hammer_time, ()) print('Load the toxic man') director.add_trigger(TOXIC_TRIGGER, play, (), bouncetime=RUN_TIME+2) director.add_trigger(TOXIC_LIMIT_TRIGGER, limit_switch, (), bouncetime=1) # Ambient track to loop in background director.play_sound("scenes/p1/audio/toxic_idle.ogg", delay=0, loops=-1, channel=SOUND_CHANNEL)