Пример #1
0
 /// <summary>
 /// Fully featured constructor for creating a new block
 /// </summary>
 /// <param name="id">Id to associate with this block</param>
 /// <param name="spriteSheet">Spritesheet to use for the block</param>
 /// <param name="position">Position of the block</param>
 /// <param name="effects">Effects to apply when the block is interacted with</param>
 /// <param name="onStep">If the block's effects are applied when it is stepped on, as opposed to when it is touched</param>
 /// <param name="passability">Passability of the block. Default is FULLY_PASSABLE</param>
 /// <param name="activeTime">How long the block is active for in seconds</param>
 /// <param name="inactiveTime">How long the block is inactive for in seconds</param>
 /// <param name="frameTime">How long each frame displays for in seconds</param>
 public Portal(String id, Texture2D spriteSheet, Vector2 position, List<Effect> effects, bool onStep, int[,] activePassability,
     int[,] inactivePassability, Condition passabilityCondition,
     float activeTime, float inactiveTime, float frameTime, float effectDelay)
     : base(id, spriteSheet, position, null, false, Block.FULLY_PASSABLE)
 {
     portalExit = null;
     if (id.Contains("Entrance"))
     {
         state = new ActiveState(this);
     }
 }
Пример #2
0
 /// <summary>
 /// Links the portal to its exit
 /// </summary>
 /// <param name="portalExit">Exit to link to</param>
 public void Link(Portal portalExit)
 {
     this.portalExit = portalExit;
 }
Пример #3
0
 /// <summary>
 /// Constructor that takes a spriteSheet and a position for the block
 /// </summary>
 /// <param name="position">Vector2 of where to place the block</param>
 /// <param name="spriteSheet">Texture2D spriteSheet for the block to display</param>
 public Portal(Texture2D spriteSheet, Vector2 position)
     : base("portalID",spriteSheet, position, null, false, Block.FULLY_PASSABLE)
 {
     portalExit = null;
 }
Пример #4
0
 /// <summary>
 /// Creates a copy of the block at the specified position
 /// </summary>
 /// <param name="position">Position to copy to</param>
 /// <returns>Copy of the block at the specified position</returns>
 public override Block copyBlockAt(Vector2 position)
 {
     Block portal = new Portal(id, spriteSheet, position, effects, onStep, activePassability, inactivePassability,
              passabilityCondition, activeTime, inactiveTime, frameTime, TimerManager.timers[id].time);
     portal.setMatchID(this.matchID);
     return portal;
 }