Example #1
0
    public override void Use(S_Player player, S_Tile tile)
    {
        S_Enemy swappee = (S_Enemy)tile.occupier;

        float time   = 0.2f;
        Color col    = Colours.GREEN;
        int   width  = (S_Tile.width - S_Camera.scale) / S_Camera.scale;
        int   height = S_Tile.height / S_Camera.scale;

        GameObject flasher = S_Flasher.CreateFlasher(width, height, col, time);

        Util.SetLayer(flasher, Util.LayerName.UI, 0);
        flasher.transform.SetParent(tile.transform, false);

        flasher = S_Flasher.CreateFlasher(width, height, col, time);
        Util.SetLayer(flasher, Util.LayerName.UI, 0);
        flasher.transform.SetParent(player.currentTile.transform, false);

        swappee.CancelMove();
        swappee.MoveToTile(player.currentTile, true);
        player.MoveToTile(tile, true);
        swappee.Stun(1);
        Sounds.PlaySound(Sounds.teleport);
        SuccessfulUse();
        Level.Get(gameObject).EnemyTurn();
    }
Example #2
0
    public static GameObject CreateFlasher(int width, int height, Color col, float duration)
    {
        GameObject go      = Primitives.CreateRectangle(width, height, col);
        S_Flasher  flasher = go.AddComponent <S_Flasher>();

        flasher.Init(width, height, duration);
        return(go);
    }