Example #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);
    }
    public void Init(Vector2 startPos, float startRotation, FContainer container)
    {
        this.container     = container;
        container.rotation = startRotation;

        SetPosition(startPos);
        gameObject.transform.rotation = Quaternion.Euler(0, 0, startRotation);
        gameObject.transform.parent   = FPWorld.instance.transform;

        nodeLink = gameObject.AddComponent <FPNodeLink>();
        nodeLink.Init(container, true);
    }
 public override void Init()
 {
     GamePage._gameObjects.AddChild(Holder = new FContainer());
     gameObject.transform.position         = new Vector3(Position.x * FPhysics.POINTS_TO_METERS, Position.y * FPhysics.POINTS_TO_METERS, 64);
     gameObject.transform.parent           = GamePage.root.transform;
     bodyLink = gameObject.AddComponent <FPNodeLink>();
     bodyLink.Init(Holder, true);
     Holder.AddChild(Sprite);
     AngularDrag = 5f;
     Mass        = 1f;
     Bounciness  = 0.5f;
     FrictionDyn = 0.3f;
     FrictionSta = 0.2f;
     InitPhysics();
 }
Example #4
0
 public override void Init()
 {
     GamePage._gameObjects.AddChild(Holder = new FContainer());
     gameObject.transform.position = new Vector3(Position.x * FPhysics.POINTS_TO_METERS,Position.y * FPhysics.POINTS_TO_METERS,64);
     gameObject.transform.parent = GamePage.root.transform;
     bodyLink = gameObject.AddComponent<FPNodeLink>();
     bodyLink.Init(Holder, true);
     Holder.AddChild(Sprite);
     AngularDrag=5f;
     Mass=1f;
     Bounciness=0.5f;
     FrictionDyn=0.3f;
     FrictionSta=0.2f;
     InitPhysics();
 }
Example #5
0
    public override void Init()
    {
        GamePage._gameObjects.AddChild(Holder = new FContainer());
        gameObject.transform.position = new Vector3(Position.x * FPhysics.POINTS_TO_METERS,Position.y * FPhysics.POINTS_TO_METERS,32);
        gameObject.transform.parent = GamePage.root.transform;
        bodyLink = gameObject.AddComponent<FPNodeLink>();
        bodyLink.Init(Holder, false);
        Holder.AddChild(sprite);
        AngularDrag=5f;
        Mass=1f;
        Bounciness=0.5f;
        FrictionDyn=0.3f;
        FrictionSta=0.2f;
        InitPhysics();

        pd = new FParticleDefinition("Futile_White");
        pd.endScale = 0.2f;
        pd.startColor = new Color(0,250,0,1f);
        pd.endColor = new Color (0, 90,0,0.01f);
    }
Example #6
0
    public override void Init()
    {
        GamePage._gameObjects.AddChild(Holder = new FContainer());
        gameObject.transform.position         = new Vector3(Position.x * FPhysics.POINTS_TO_METERS, Position.y * FPhysics.POINTS_TO_METERS, 32);
        gameObject.transform.parent           = GamePage.root.transform;
        bodyLink = gameObject.AddComponent <FPNodeLink>();
        bodyLink.Init(Holder, false);
        Holder.AddChild(sprite);
        AngularDrag = 5f;
        Mass        = 1f;
        Bounciness  = 0.5f;
        FrictionDyn = 0.3f;
        FrictionSta = 0.2f;
        InitPhysics();

        pd            = new FParticleDefinition("Futile_White");
        pd.endScale   = 0.2f;
        pd.startColor = new Color(0, 250, 0, 1f);
        pd.endColor   = new Color(0, 90, 0, 0.01f);
    }
Example #7
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;
    }
    public void Init(Vector2 startPos, float startRotation, FContainer container)
    {
        this.container = container;
        container.rotation = startRotation;

        SetPosition(startPos);
        gameObject.transform.rotation = Quaternion.Euler(0, 0, startRotation);
        gameObject.transform.parent = FPWorld.instance.transform;

        nodeLink = gameObject.AddComponent<FPNodeLink>();
        nodeLink.Init(container, true);
    }