示例#1
0
def levity_walk(actor, point):
    print "Walk handler called..."
    
    levity = state.myscene.actors['levity']
    next_point = point
    if point == "levity_left" or point == "levity_right":   
        if point == "levity_left":
            state.myscene.global_dict['levity_direction'] = 'right'
            next_point = "levity_1"
        elif point == "levity_right":
            state.myscene.global_dict['levity_direction'] = 'left'
            next_point = "levity_4"
        #levity.prepare_walkpath_move(next_point)
        pyglet.clock.schedule_once(make_dt_wrapper(levity.prepare_walkpath_move), 1, next_point)
        pyglet.clock.schedule_once(levity.next_action, 60)
        
    else:
        if point == "levity_1":
            next_point = "levity_2" if state.myscene.global_dict['levity_direction'] == "right" else "levity_left"
        elif point == "levity_2":
            next_point = "levity_3" if state.myscene.global_dict['levity_direction'] == "right" else "levity_1"
        elif point == "levity_3":
            next_point = "levity_4" if state.myscene.global_dict['levity_direction'] == "right" else "levity_2"
        elif point == "levity_4":
            if state.myscene.global_dict.get('levity_exposition', False) == False:
                state.myscene.global_dict['levity_exposition'] = True
                #begin convo
                actor.update_state("stand_right")
                state.myscene.begin_conversation("introduction")
            else:
                next_point = "levity_right" if state.myscene.global_dict['levity_direction'] == "right" else "levity_3"
        
        if next_point is not point:    
            levity.prepare_walkpath_move(next_point)
            print "Moving from %s to %s..." % (point, next_point)
示例#2
0
def potato_drop(actor, point):
    if point == "potato_drop_end":
        squeak_snd = pyglet.resource.media("sound/squeak.wav", streaming=False)
        squeak_snd.play()

        actor.walk_speed = 200
        # stanislav is surprised at the critter
        pyglet.clock.schedule_once(make_dt_wrapper(state.myscene.begin_conversation), 1, "a_visitor")

        actor.update_state("run_note_4")

    if point == "shake_4":
        actor.prepare_walkpath_move("potato_exit")
        pyglet.clock.schedule_once(make_dt_wrapper(actor.next_action), 3)
        actor.update_state("run_4")
示例#3
0
def potato_drop(actor, point):
    if point == "potato_drop_end":
        squeak_snd = pyglet.resource.media('sound/squeak.wav', streaming=False)
        squeak_snd.play()
        
        actor.walk_speed = 200
        #stanislav is surprised at the critter
        pyglet.clock.schedule_once(make_dt_wrapper(state.myscene.begin_conversation), 1, "a_visitor")
    
        actor.update_state('run_note_4')
 
    if point == "shake_4":
        actor.prepare_walkpath_move('potato_exit')
        pyglet.clock.schedule_once(make_dt_wrapper(actor.next_action), 3)
        actor.update_state('run_4')