herdem_dog.c
/**
 * Initialises new herdem_dog structure. Called by 
 * `new_hedem_dog` automatically
 */
Initialises new herdem_dog structure. Called by
`new_hedem_dog` automatically
Initialises new herdem_dog structure . Called by ` new_hedem_dog ` automatically
herdem_dog *herdem_dog_init(herdem_dog *dog)
{
    dog = (herdem_dog *)jty_actor_init(
            (jty_actor *)dog,
            HERDEM_DOG_GROUP_NUM,
            jty_engine->map,
            16,
            108, 71, "images/sprites/dog/E_walking.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/NE_walking.png", herdem_engine->dog_c_shapes,
            71, 108, "images/sprites/dog/N_walking.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/NW_walking.png", herdem_engine->dog_c_shapes,
            108, 71, "images/sprites/dog/W_walking.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/SW_walking.png", herdem_engine->dog_c_shapes,
            71, 108, "images/sprites/dog/S_walking.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/SE_walking.png", herdem_engine->dog_c_shapes,
            108, 71, "images/sprites/dog/E_still.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/NE_still.png", herdem_engine->dog_c_shapes,
            71, 108, "images/sprites/dog/N_still.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/NW_still.png", herdem_engine->dog_c_shapes,
            108, 71, "images/sprites/dog/W_still.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/SW_still.png", herdem_engine->dog_c_shapes,
            71, 108, "images/sprites/dog/S_still.png", herdem_engine->dog_c_shapes,
            127, 127, "images/sprites/dog/SE_still.png", herdem_engine->dog_c_shapes
            );
    dog->normal_speed = 1.7;
    double half_life = 20;
    dog->drag = 1 / half_life *  0.6931471805599453;
    dog->acceleration = dog->normal_speed * dog->drag;
    dog->player_actions = 0;
    dog->scare_radius_min = 110;
    dog->scare_radius_max = 210;
    jty_actor_add_i_handler((jty_actor *)dog, herdem_dog_input_handler);
    jty_actor_add_i_handler((jty_actor *)dog, herdem_animation_handler);
    jty_actor_add_m_handler((jty_actor *)dog, herdem_dog_wall_handler, "bc");
    herdem_engine->dogs = jty_actor_ls_add(herdem_engine->dogs, (jty_actor *)dog);
    return dog;
}
herdem_dog * herdem_dog_init ( herdem_dog * dog ) { dog = ( herdem_dog * ) jty_actor_init ( ( jty_actor * ) dog , HERDEM_DOG_GROUP_NUM , jty_engine -> map , 16 , 108 , 71 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes , 71 , 108 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes , 108 , 71 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes , 71 , 108 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes , 108 , 71 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes , 71 , 108 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes , 108 , 71 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes , 71 , 108 , " " , herdem_engine -> dog_c_shapes , 127 , 127 , " " , herdem_engine -> dog_c_shapes ) ; dog -> normal_speed = 1.7 ; double half_life = 20 ; dog -> drag = 1 / half_life * 0.6931471805599453 ; dog -> acceleration = dog -> normal_speed * dog -> drag ; dog -> player_actions = 0 ; dog -> scare_radius_min = 110 ; dog -> scare_radius_max = 210 ; jty_actor_add_i_handler ( ( jty_actor * ) dog , herdem_dog_input_handler ) ; jty_actor_add_i_handler ( ( jty_actor * ) dog , herdem_animation_handler ) ; jty_actor_add_m_handler ( ( jty_actor * ) dog , herdem_dog_wall_handler , " " ) ; herdem_engine -> dogs = jty_actor_ls_add ( herdem_engine -> dogs , ( jty_actor * ) dog ) ; return dog ; }
Initialises new herdem_dog structure.
Initialises new herdem_dog structure .