Exemplo n.º 1
0
        public ReturnChaseEnemy(LevelState parentWorld, float initial_x, float initial_y)
        {
            position              = new Vector2(initial_x, initial_y);
            dimensions            = new Vector2(48.0f, 48.0f);
            original_position     = CenterPoint;
            velocity              = new Vector2(0.0f, 0.0f);
            enemy_damage          = 10;
            enemy_life            = 15;
            distance              = 0.0f;
            angle                 = 0.0f;
            angle1                = 0.0f;
            angle2                = 0.0f;
            knockback_magnitude   = 2.0f;
            disable_movement_time = 0.0f;
            return_timer          = 0.0f;

            direction_facing      = GlobalGameConstants.Direction.Right;
            change_direction_time = 0.0f;
            enemy_found           = false;
            state = EnemyState.Idle;

            component = new IdleSearch();

            this.parentWorld = parentWorld;

            walk_down                       = AnimationLib.getSkeleton("chaseDown");
            walk_right                      = AnimationLib.getSkeleton("chaseRight");
            walk_up                         = AnimationLib.getSkeleton("chaseUp");
            current_skeleton                = walk_right;
            current_skeleton.Animation      = current_skeleton.Skeleton.Data.FindAnimation("idle");
            current_skeleton.Skeleton.FlipX = false;
            chaseAnim                       = AnimationLib.getFrameAnimationSet("chasePic");
            animation_time                  = 0.0f;
        }