public InactiveState(Block block) { block.timer = 0; block.currentAnimation = Block.INACTIVE; block.passability = block.inactivePassability; }
/// <summary> /// create a copy of the block at a new given position /// </summary> /// <param name="position">new position Vector2</param> /// <returns>Copy of the block at the given position</returns> public virtual Block copyBlockAt(Vector2 position) { Block block = new Block(id, spriteSheet, position, effects, onStep, activePassability, inactivePassability, passabilityCondition, activeTime, inactiveTime, frameTime, effectDelay); return block; }
public void ApplyEffects(Block block, Sprite sprite) { if (block.effects != null && TimerManager.timers[block.id].HasElapsed()) { TimerManager.timers[block.id].Reset(); foreach (Effect effect in block.effects) { effect.Apply(sprite); } } }
public void ApplyEffects(Block block, Sprite sprite) { // dont apply effects }
public ActiveState(Block block) { block.timer = 0; block.frameTimer = 0; block.currentFrame = 0; block.currentAnimation = Block.ACTIVE; block.passability = block.activePassability; }