public CCGridSize GetDelta(CCGridSize pos) { var pos2 = new CCPoint(); int idx = pos.X * m_sGridSize.Y + pos.Y; pos2.X = (m_pTilesOrder[idx] / m_sGridSize.Y); pos2.Y = (m_pTilesOrder[idx] % m_sGridSize.Y); return(new CCGridSize((int)(pos2.X - pos.X), (int)(pos2.Y - pos.Y))); }
public CCGridSize GetDelta(CCGridSize pos) { var pos2 = new CCPoint(); int idx = pos.X * m_sGridSize.Y + pos.Y; pos2.X = (m_pTilesOrder[idx] / m_sGridSize.Y); pos2.Y = (m_pTilesOrder[idx] % m_sGridSize.Y); return new CCGridSize((int) (pos2.X - pos.X), (int) (pos2.Y - pos.Y)); }
/// <summary> /// initializes the action with a random seed, the grid size and the duration /// </summary> protected virtual bool InitWithDuration(float duration, CCGridSize gridSize, int seed) { if (base.InitWithDuration(duration, gridSize)) { m_nSeed = seed; m_pTilesOrder = null; return(true); } return(false); }
public bool InitWithRange(int range, bool shakeZ, CCGridSize gridSize, float duration) { if (base.InitWithSize(gridSize, duration)) { m_nRandrange = range; m_bShakeZ = shakeZ; return true; } return false; }
/// <summary> /// initializes the action with a random seed, the grid size and the duration /// </summary> protected virtual bool InitWithSeed(int s, CCGridSize gridSize, float duration) { if (base.InitWithSize(gridSize, duration)) { m_nSeed = s; m_pTilesOrder = null; return(true); } return(false); }
/// <summary> /// initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration /// </summary> protected virtual bool InitWithDuration(float duration, CCGridSize gridSize, int nRange, bool bShakeZ) { if (base.InitWithDuration(duration, gridSize)) { m_nRandrange = nRange; m_bShakeZ = bShakeZ; return(true); } return(false); }
protected virtual bool InitWithRange(int range, bool shakeZ, CCGridSize gridSize, float duration) { if (base.InitWithSize(gridSize, duration)) { m_nRandrange = range; m_bShakeZ = shakeZ; return(true); } return(false); }
/// <summary> /// initializes the action with a random seed, the grid size and the duration /// </summary> protected virtual bool InitWithSeed(int s, CCGridSize gridSize, float duration) { if (base.InitWithSize(gridSize, duration)) { m_nSeed = s; m_pTilesOrder = null; return true; } return false; }
/// <summary> /// initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration /// </summary> protected virtual bool InitWithDuration(float duration, CCGridSize gridSize, int nRange, bool bShakeZ) { if (base.InitWithDuration(duration, gridSize)) { m_nRandrange = nRange; m_bShakeZ = bShakeZ; return true; } return false; }
/// <summary> /// initializes the action with a random seed, the grid size and the duration /// </summary> protected virtual bool InitWithDuration(float duration, CCGridSize gridSize, int seed) { if (base.InitWithDuration(duration, gridSize)) { m_nSeed = seed; m_pTilesOrder = null; return true; } return false; }
protected CCGridSize GetDelta(CCGridSize pos) { var pos2 = CCPoint.Zero; int idx = pos.X * GridSize.Y + pos.Y; int tileOrder = TilesOrder [idx]; pos2.X = (tileOrder / GridSize.Y); pos2.Y = (tileOrder % GridSize.Y); return(new CCGridSize((int)(pos2.X - pos.X), (int)(pos2.Y - pos.Y))); }
/// <summary> /// initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration /// </summary> protected virtual bool InitWithRange(int nRange, bool bShatterZ, CCGridSize gridSize, float duration) { if (base.InitWithSize(gridSize, duration)) { m_bOnce = false; m_nRandrange = nRange; m_bShatterZ = bShatterZ; return(true); } return(false); }
/// <summary> /// initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration /// </summary> protected virtual bool InitWithRange(int nRange, bool bShatterZ, CCGridSize gridSize, float duration) { if (base.InitWithSize(gridSize, duration)) { m_bOnce = false; m_nRandrange = nRange; m_bShatterZ = bShatterZ; return true; } return false; }
public CCActionInterval ActionWithSize(CCGridSize vector) { if (m_bBack) { // Get hold of the PageTurn3DAction return new CCReverseTime ( CCPageTurn3D.Create(vector, m_fDuration) ); } else { // Get hold of the PageTurn3DAction return CCPageTurn3D.Create(vector, m_fDuration); } }
public CCFiniteTimeAction ActionWithSize(CCGridSize vector) { if (Back) { // Get hold of the PageTurn3DAction return(new CCReverseTime ( new CCPageTurn3D(Duration, vector) )); } else { // Get hold of the PageTurn3DAction return(new CCPageTurn3D(Duration, vector)); } }
public CCActionInterval ActionWithSize(CCGridSize vector) { if (m_bBack) { // Get hold of the PageTurn3DAction return(new CCReverseTime ( new CCPageTurn3D(vector, m_fDuration) )); } else { // Get hold of the PageTurn3DAction return(new CCPageTurn3D(vector, m_fDuration)); } }
public void PlaceTile(CCGridSize pos, CCTile t) { CCQuad3 coords = OriginalTile(pos); CCPoint step = m_pTarget.Grid.Step; coords.BottomLeft.X += (int) (t.Position.X * step.X); coords.BottomLeft.Y += (int) (t.Position.Y * step.Y); coords.BottomRight.X += (int) (t.Position.X * step.X); coords.BottomRight.Y += (int) (t.Position.Y * step.Y); coords.TopLeft.X += (int) (t.Position.X * step.X); coords.TopLeft.Y += (int) (t.Position.Y * step.Y); coords.TopRight.X += (int) (t.Position.X * step.X); coords.TopRight.Y += (int) (t.Position.Y * step.Y); SetTile(pos, ref coords); }
protected void PlaceTile(CCGridSize pos, CCTile tile) { CCQuad3 coords = OriginalTile(pos); var step = ((CCNodeGrid)Target).Grid.Step; coords.BottomLeft.X += (int)(tile.Position.X * step.X); coords.BottomLeft.Y += (int)(tile.Position.Y * step.Y); coords.BottomRight.X += (int)(tile.Position.X * step.X); coords.BottomRight.Y += (int)(tile.Position.Y * step.Y); coords.TopLeft.X += (int)(tile.Position.X * step.X); coords.TopLeft.Y += (int)(tile.Position.Y * step.Y); coords.TopRight.X += (int)(tile.Position.X * step.X); coords.TopRight.Y += (int)(tile.Position.Y * step.Y); SetTile(pos, ref coords); }
public CCTurnOffTilesState(CCTurnOffTiles action, CCNodeGrid target) : base(action, target) { int i; if (action.Seed != CCShuffleTiles.NoSeedSpecified) { CCRandom.Next(action.Seed); } CCGridSize gridSize = action.GridSize; TilesCount = gridSize.X * gridSize.Y; TilesOrder = new int[TilesCount]; for (i = 0; i < TilesCount; ++i) { TilesOrder [i] = i; } Shuffle(TilesOrder, TilesCount); }
public override void Update(float time) { int i, l, t; l = (int)(time * m_nTilesCount); for (i = 0; i < m_nTilesCount; i++) { t = m_pTilesOrder[i]; var tilePos = new CCGridSize(t / m_sGridSize.Y, t % m_sGridSize.Y); if (i < l) { TurnOffTile(tilePos); } else { TurnOnTile(tilePos); } } }
public CCShuffleTilesState(CCShuffleTiles action, CCNode target) : base(action, target) { CCGridSize gridSize = action.GridSize; TilesCount = gridSize.X * gridSize.Y; int[] shuffledTilesOrder = new int[TilesCount]; int i, j, f = 0; for (i = 0; i < TilesCount; i++) { shuffledTilesOrder [i] = i; } if (action.Seed != CCShuffleTiles.NoSeedSpecified) { CCRandom.Next(action.Seed); } Shuffle(ref shuffledTilesOrder, TilesCount); TilesOrder = shuffledTilesOrder; Tiles = new CCTile[TilesCount]; for (i = 0; i < gridSize.X; ++i) { for (j = 0; j < gridSize.Y; ++j) { Tiles [f] = new CCTile { Position = new CCPoint(i, j), StartPosition = new CCPoint(i, j), Delta = GetDelta(i, j) }; f++; } } }
protected override CCFiniteTimeAction CreateAction(CCGridSize size) { return new CCFadeOutUpTiles(Duration, size); }
public void TurnOnTile(CCGridSize pos) { CCQuad3 orig = OriginalTile(pos); SetTile(pos, ref orig); }
protected override CCFiniteTimeAction CreateAction(CCGridSize size) { return(new CCFadeOutUpTiles(Duration, size)); }
/// <summary> /// creates the action with a range, whether of not to shatter Z vertices, a grid size and duration /// </summary> public CCShatteredTiles3D(int nRange, bool bShatterZ, CCGridSize gridSize, float duration) : base(duration) { InitWithRange(nRange, bShatterZ, gridSize, duration); }
public override CCActionInterval CreateAction(CCGridSize size) { return(new CCFadeOutDownTiles(m_fDuration, size)); }
/// <summary> /// creates the action with a range, whether or not to shake Z vertices, a grid size, and duration /// </summary> public CCShakyTiles3D(float duration, CCGridSize gridSize, int nRange, bool bShakeZ) : base(duration) { InitWithDuration(duration, gridSize, nRange, bShakeZ); }
public override CCActionInterval CreateAction(CCGridSize size) { return new CCFadeOutUpTiles(m_fDuration, size); }
public CCShaky3D (float duration, CCGridSize gridSize, int range = 0, bool shakeZ = true) : base (duration, gridSize) { Range = range; Shake = shakeZ; }
public override CCActionInterval CreateAction(CCGridSize size) { return CCFadeOutDownTiles.Create(size, m_fDuration); }
public CCShaky3D(int range, bool shakeZ, CCGridSize gridSize, float duration) : base(duration) { InitWithRange(range, shakeZ, gridSize, duration); }
/// <summary> /// creates the action with a random seed, the grid size and the duration /// </summary> public CCTurnOffTiles (float duration, CCGridSize gridSize, int seed = CCShuffleTiles.NoSeedSpecified) : base (gridSize, duration, seed) { }
/// <summary> /// creates the action with a random seed, the grid size and the duration /// </summary> public CCTurnOffTiles(float duration, CCGridSize gridSize, int seed) : base(duration) { InitWithDuration(duration, gridSize, seed); }
protected virtual CCFiniteTimeAction CreateAction(CCGridSize size) { return(new CCFadeOutTRTiles(Duration, size)); }
public virtual CCActionInterval CreateAction(CCGridSize size) { return new CCFadeOutTRTiles(m_fDuration, size); }
public void TurnOffTile(CCGridSize pos) { SetTile(pos, ref m_pZero); }
/// <summary> /// creates the action with a random seed, the grid size and the duration /// </summary> public CCShuffleTiles(CCGridSize gridSize, float duration, int seed) : base(duration) { InitWithDuration(duration, gridSize, seed); }
public virtual CCActionInterval CreateAction(CCGridSize size) { return CCFadeOutTRTiles.Create(size, m_fDuration); }
public virtual CCActionInterval CreateAction(CCGridSize size) { return(new CCFadeOutTRTiles(m_fDuration, size)); }
/// <summary> /// creates the action with a range, whether of not to shatter Z vertices, a grid size and duration /// </summary> public CCShatteredTiles3D (float duration, CCGridSize gridSize, int range = 0, bool shatterZ = true) : base (duration, gridSize) { Range = range; ShatterZ = shatterZ; }
public override void Update(float time) { int i, l, t; l = (int) (time * m_nTilesCount); for (i = 0; i < m_nTilesCount; i++) { t = m_pTilesOrder[i]; var tilePos = new CCGridSize(t / m_sGridSize.Y, t % m_sGridSize.Y); if (i < l) { TurnOffTile(tilePos); } else { TurnOnTile(tilePos); } } }
/// <summary> /// creates the action with a random seed, the grid size and the duration /// </summary> public CCTurnOffTiles(int s, CCGridSize gridSize, float duration) : base(duration) { InitWithSeed(s, gridSize, duration); }
public override CCActionInterval CreateAction(CCGridSize size) { return(new CCFadeOutBLTiles(size, m_fDuration)); }
public override CCActionInterval CreateAction(CCGridSize size) { return new CCFadeOutBLTiles(size, m_fDuration); }
protected virtual CCFiniteTimeAction CreateAction(CCGridSize size) { return new CCFadeOutTRTiles(Duration, size); }
/// <summary> /// creates the action with a range, whether or not to shake Z vertices, a grid size, and duration /// </summary> public static CCShakyTiles3D Create(int nRange, bool bShakeZ, CCGridSize gridSize, float duration) { var pAction = new CCShakyTiles3D(); pAction.InitWithRange(nRange, bShakeZ, gridSize, duration); return pAction; }
/// <summary> /// creates the action with a random seed, the grid size and the duration /// </summary> public CCTurnOffTiles(float duration, CCGridSize gridSize, int seed = CCShuffleTiles.NoSeedSpecified) : base(gridSize, duration, seed) { }
/// <summary> /// creates the action with the grid size and the duration /// </summary> public CCTurnOffTiles(CCGridSize size, float d) :base(d) { InitWithSize(size, d); }
/// <summary> /// creates the action with the grid size and the duration /// </summary> public CCTurnOffTiles(CCGridSize size, float d) : base(d) { InitWithSize(size, d); }
/// <summary> /// creates the action with a range, whether of not to shatter Z vertices, a grid size and duration /// </summary> public CCShatteredTiles3D(float duration, CCGridSize gridSize, int nRange, bool bShatterZ) : base(duration) { InitWithDuration(duration, gridSize, nRange, bShatterZ); }
public CCShaky3D(float duration, CCGridSize gridSize, int range = 0, bool shakeZ = true) : base(duration, gridSize) { Range = range; Shake = shakeZ; }
/// <summary> /// creates the action with a random seed, the grid size and the duration /// </summary> public static CCShuffleTiles Create(int s, CCGridSize gridSize, float duration) { var pAction = new CCShuffleTiles(); pAction.InitWithSeed(s, gridSize, duration); return pAction; }
/// <summary> /// creates the action with a random seed, the grid size and the duration /// </summary> public CCShuffleTiles(CCGridSize gridSize, float duration, int seed = NoSeedSpecified) : base(duration, gridSize) { }