예제 #1
0
 public InactiveState(Block block)
 {
     block.timer = 0;
     block.currentAnimation = Block.INACTIVE;
     block.passability = block.inactivePassability;
 }
예제 #2
0
 /// <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;
 }
예제 #3
0
 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);
         }
     }
 }
예제 #4
0
 public void ApplyEffects(Block block, Sprite sprite)
 {
     // dont apply effects
 }
예제 #5
0
 public ActiveState(Block block)
 {
     block.timer = 0;
     block.frameTimer = 0;
     block.currentFrame = 0;
     block.currentAnimation = Block.ACTIVE;
     block.passability = block.activePassability;
 }