Beispiel #1
0
    public void Init(Player player, Vector2 startPos)
    {
        this.player = player;

        world.beastHolder.AddChild(holder = new FContainer());

        gameObject.transform.position = new Vector3(startPos.x * FPhysics.POINTS_TO_METERS,startPos.y * FPhysics.POINTS_TO_METERS,0);
        gameObject.transform.parent = world.root.transform;

        bodyLink = gameObject.AddComponent<FPNodeLink>();
        bodyLink.Init(holder, false);

        bodySprite = new FSprite("Evil-Eye_"+player.team.numString+"_01");
        holder.AddChild(bodySprite);

        eyeSprite = new FSprite("Eye_" + player.numString);
        eyeSprite.scale = 0.33f;
        holder.AddChild(eyeSprite);
        //holder.alpha = 0.25f;

        goldSprite = new FSprite("Evil-Eye_crown_01");
        holder.AddChild(goldSprite);
        goldSprite.isVisible = false;
        //goldSprite.shader = FShader.Additive;

        InitPhysics();

        holder.ListenForUpdate(HandleUpdate);
        holder.ListenForLateUpdate(HandleLateUpdate);
        holder.ListenForFixedUpdate(HandleFixedUpdate);

        //AddTentacle(new Vector2(-20.0f, -20.0f), -90.0f);
        //AddTentacle(new Vector2(0.0f, -30.0f), 0.0f);
        //AddTentacle(new Vector2(20.0f, -20.0f), 90.0f);
    }
Beispiel #2
0
    public void Init(Team team, Vector2 startPos)
    {
        this.team = team;

        world.orbHolder.AddChild(holder = new FContainer());

        gameObject.transform.position = new Vector3(startPos.x * FPhysics.POINTS_TO_METERS,startPos.y * FPhysics.POINTS_TO_METERS,0);
        gameObject.transform.parent = world.root.transform;

        link = gameObject.AddComponent<FPNodeLink>();
        link.Init(holder, true);

        frames = new FAtlasElement[11];

        for (int f = 0; f<frames.Length; f++)
        {
            frames[f] = Futile.atlasManager.GetElementWithName("orb"+f.ToString("00"));
        }

        sprite = new FSprite(frames[0].name);
        holder.AddChild(sprite);
        sprite.color = team.color;
        sprite.scale = scale;

        InitPhysics();

        holder.ListenForUpdate(HandleUpdate);
        holder.ListenForFixedUpdate(HandleFixedUpdate);

        FSoundManager.PlaySound("orbAppears");

        pd = new FParticleDefinition("Particles/Flame");

        pd.startColor = team.color.CloneWithNewAlpha(0.2f);
        pd.endColor = Color.clear;
    }