예제 #1
0
        public DefaultSubLevelTransitionEvent(TimeSpan timeToTextOverlay, TimeSpan timeToLevelChange, String transitionMessage, SpriteFontContainer transitionFont)
        {
            this.timeIds                   = new int[2];
            this.timeIds[0]                = ClockFactory.RegisterTimer(timeToTextOverlay);
            this.timeIds[1]                = ClockFactory.RegisterTimer(timeToLevelChange);
            this.transitionMessage         = transitionMessage;
            this.transitionFont            = transitionFont;
            this.transitionMessagePosition = new Vector2();

            ClockFactory.StartTimer(timeIds[0]);
        }
        public DefaultDeathEvent(TimeSpan timeToTextOverlay, TimeSpan timeToLevelReset,
                                 String deathMessage, SpriteFontContainer deathFont)
        {
            this.timeIds              = new int[2];
            this.timeIds[0]           = ClockFactory.RegisterTimer(timeToTextOverlay);
            this.timeIds[1]           = ClockFactory.RegisterTimer(timeToLevelReset);
            this.deathMessage         = deathMessage;
            this.deathFont            = deathFont;
            this.deathMessagePosition = new Vector2();

            ClockFactory.StartTimer(timeIds[0]);
        }
 public InvincibilityStar(AbstractAnimatedSprite sprite, int duration, Rectangle position, CollisionType collisionType, string message)
 {
     this.timer                 = ClockFactory.RegisterTimer(new TimeSpan(0, 0, duration));
     this.EffectHasFinished     = false;
     this.HasBeenConsumed       = false;
     this.ShouldNotifyReceivers = false;
     this.CollisionType         = collisionType;
     this.sprite                = sprite;
     this.duration              = duration;
     this.Position              = new Vector2(position.X, position.Y);
     this.Size = new Vector2(position.Width, position.Height);
     this.MessageToReceivers = message;
 }
        public DefaultLevelCompleteEvent(TimeSpan timeToTextOverlay, TimeSpan timeToScoreOverlay,
                                         TimeSpan timeToLevelChange, String completeMessage, String scoreMessage, SpriteFontContainer completeFont, SpriteFontContainer scoreFont)
        {
            this.timeIds                 = new int[3];
            this.timeIds[0]              = ClockFactory.RegisterTimer(timeToTextOverlay);
            this.timeIds[1]              = ClockFactory.RegisterTimer(timeToScoreOverlay);
            this.timeIds[2]              = ClockFactory.RegisterTimer(timeToLevelChange);
            this.completeMessage         = completeMessage;
            this.scoreMessage            = scoreMessage;
            this.completeFont            = completeFont;
            this.scoreFont               = scoreFont;
            this.completeMessagePosition = new Vector2();

            ClockFactory.StartTimer(timeIds[0]);
        }
예제 #5
0
        public CharacterImpl(int health, int fishbowlWaterLevel, Rectangle position, List <IController> controllersList, bool isDehydrationEnabled, int dehydrationDamage, int dehydrationTime, CollisionType collisionType, string message)
        {
            this.Position              = new Vector2(position.X, position.Y);
            this.Size                  = new Vector2(position.Width, position.Height);
            this.Velocity              = new Vector2();
            this.originalHitbox        = position;
            this.HealthLevel           = health;
            this.maxHealthLevel        = health;
            this.MeterLevel            = fishbowlWaterLevel;
            this.controllers           = controllersList == null ? new List <IController>() : controllersList;
            this.StateManager          = new CharacterStateManagerImpl(this);
            this.CurrentItem           = null;
            this.ShouldNotifyReceivers = false;
            this.CollisionType         = collisionType;
            this.isDehydrationEnabled  = isDehydrationEnabled;
            this.keyPickupHeld         = false;
            this.dehydrationDamage     = dehydrationDamage;
            this.CurrentPowerup        = null;
            this.timer                 = ClockFactory.RegisterTimer(new TimeSpan(0, 0, dehydrationTime));
            this.MessageToReceivers    = message;

            ClockFactory.StartTimer(timer);
        }