Esempio n. 1
0
 public override void Start(IGameplayContainer container)
 {
     Enabled              = true;
     container.GameAct   += ClearTouch;
     container.GameReact += Update;
     container.Draw      += Instance_GameRender;
 }
Esempio n. 2
0
 public override void Stop(IGameplayContainer container)
 {
     foreach (string sound in sounds)
     {
         Engine.Instance.SoundSystem.StopSfxIfLooping(sound);
     }
 }
Esempio n. 3
0
 public override void Stop(IGameplayContainer container)
 {
     container.GameAct   -= ClearTouch;
     container.GameReact -= Update;
     container.Draw      -= Instance_GameRender;
     Enabled              = false;
     ClearTouch();
     enabledBoxes.Clear();
 }
 public override void Stop(IGameplayContainer container)
 {
     container.GameThink   -= Update;
     container.GameCleanup -= Instance_GameCleanup;
     if (meter != null)
     {
         meter.Stop();
     }
     Hit      = false;
     flashing = 0;
 }
        public override void Start(IGameplayContainer container)
        {
            container.GameThink   += Update;
            container.GameCleanup += Instance_GameCleanup;
            Health = StartHealth;

            if (meter != null)
            {
                meter.Start(container);
            }
        }
Esempio n. 6
0
 public BlocksPattern(BlockPatternInfo info, IGameplayContainer container, IEntityPool entityPool)
 {
     this.info        = info;
     length           = info.Length;
     leftBoundary     = info.LeftBoundary;
     rightBoundary    = info.RightBoundary;
     blocks           = new List <BlockInfo>();
     running          = false;
     frame            = 0;
     this.container   = container;
     this._entityPool = entityPool;
 }
 public BlocksPattern(BlockPatternInfo info, IGameplayContainer container, IEntityPool entityPool)
 {
     this.info = info;
     length = info.Length;
     leftBoundary = info.LeftBoundary;
     rightBoundary = info.RightBoundary;
     blocks = new List<BlockInfo>();
     running = false;
     frame = 0;
     this.container = container;
     this._entityPool = entityPool;
 }
 public override void Start(IGameplayContainer container)
 {
     currentState         = "Start";
     stateChanged         = false;
     StateFrames          = 0;
     Lifetime             = 0;
     container.GameThink += Update;
     if (states.ContainsKey(currentState))
     {
         states[currentState].Initialize(Parent);
     }
 }
Esempio n. 9
0
        public ScreenHandler(ScreenInfo screen, IEnumerable <ScreenLayer> layers, IEnumerable <JoinHandler> joins,
                             IEnumerable <BlocksPattern> blockPatterns, IGameplayContainer container)
        {
            Screen   = screen;
            patterns = new List <BlocksPattern>();

            this.layers = layers;

            this.patterns = blockPatterns.ToList();

            this.joins = joins;

            teleportEnabled = new List <bool>(screen.Teleports.Select(info => false));

            this.container = container;
        }
Esempio n. 10
0
        public void Start(IGameplayContainer container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            this.container = container;

            if (this.binding != null)
            {
                this.binding.Start(container.Entities);
            }

            container.Draw += GameRender;
            running         = true;
        }
Esempio n. 11
0
        public void Start(IGameplayContainer container)
        {
            this.container = container;

            foreach (Component c in Components)
            {
                c.Start(container);
            }

            if (Started != null)
            {
                Started();
            }

            Running = true;
        }
Esempio n. 12
0
        public ScreenHandler(ScreenInfo screen, IEnumerable<ScreenLayer> layers, IEnumerable<JoinHandler> joins,
            IEnumerable<BlocksPattern> blockPatterns, IGameplayContainer container)
        {
            Screen = screen;
            patterns = new List<BlocksPattern>();
            spawnedEntities = new List<GameEntity>();

            this.layers = layers;

            this.patterns = blockPatterns.ToList();

            this.joins = joins;

            teleportEnabled = new List<bool>(screen.Teleports.Select(info => false));

            this.container = container;
        }
        public override void Start(IGameplayContainer container)
        {
            if (Direction == Direction.Unknown)
            {
                Direction = Direction.Right;
            }

            container.GameAct += Update;

            pushX = pushY = 0;
            dragX = dragY = resistX = resistY = 1;

            if (Parent.Screen != null && position != null)
            {
                overTile = Parent.Screen.TileAt(position.Position.X, position.Position.Y);
            }
        }
        public BossDoorHandler(Join join, IGameplayContainer container, IEntityPool entityPool, int tileSize, int height, int width, string name)
            : base(join, tileSize, height, width, name)
        {
            this.container = container;
            _entityPool = entityPool;

            if (direction == Direction.Down)
            {
                doorOneX = join.offsetOne * tileSize;
                doorOneY = height - tileSize;

                doorTwoX = join.offsetOne * tileSize;
                doorTwoY = height;
            }
            else if (direction == Direction.Left)
            {
                doorOneX = 0;
                doorOneY = join.offsetTwo * tileSize;

                doorTwoX = -tileSize;
                doorTwoY = join.offsetTwo * tileSize;
            }
            else if (direction == Direction.Right)
            {
                doorOneX = width - tileSize;
                doorOneY = join.offsetOne * tileSize;

                doorTwoX = width;
                doorTwoY = join.offsetOne * tileSize;
            }
            else if (direction == Direction.Up)
            {
                doorOneX = join.offsetTwo * tileSize;
                doorOneY = 0;

                doorTwoX = join.offsetTwo * tileSize;
                doorTwoY = -tileSize;
            }
        }
Esempio n. 15
0
        public BossDoorHandler(Join join, IGameplayContainer container, IEntityPool entityPool, int tileSize, int height, int width, string name)
            : base(join, tileSize, height, width, name)
        {
            this.container = container;
            _entityPool    = entityPool;

            if (direction == Direction.Down)
            {
                doorOneX = join.offsetOne * tileSize;
                doorOneY = height - tileSize;

                doorTwoX = join.offsetOne * tileSize;
                doorTwoY = height;
            }
            else if (direction == Direction.Left)
            {
                doorOneX = 0;
                doorOneY = join.offsetTwo * tileSize;

                doorTwoX = -tileSize;
                doorTwoY = join.offsetTwo * tileSize;
            }
            else if (direction == Direction.Right)
            {
                doorOneX = width - tileSize;
                doorOneY = join.offsetOne * tileSize;

                doorTwoX = width;
                doorTwoY = join.offsetOne * tileSize;
            }
            else if (direction == Direction.Up)
            {
                doorOneX = join.offsetTwo * tileSize;
                doorOneY = 0;

                doorTwoX = join.offsetTwo * tileSize;
                doorTwoY = -tileSize;
            }
        }
Esempio n. 16
0
        public override void Start(IGameplayContainer container)
        {
            container.GameThink += Update;
            container.GameCleanup += Instance_GameCleanup;
            Health = StartHealth;

            if (meter != null)
            {
                meter.Start(container);
            }
        }
Esempio n. 17
0
 public override void Stop(IGameplayContainer container)
 {
     container.GameAct -= Update;
 }
Esempio n. 18
0
 public override void Stop(IGameplayContainer container)
 {
     Reset();
     container.GameThink -= Update;
     Engine.Instance.GameInputReceived -= Instance_GameInputReceived;
 }
 public override void Start(IGameplayContainer container)
 {
     container.GameCleanup += Update;
 }
Esempio n. 20
0
 public override void Start(IGameplayContainer container)
 {
     Reset();
     container.GameThink += Update;
     Engine.Instance.GameInputReceived += Instance_GameInputReceived;
 }
Esempio n. 21
0
 public HandlerMeter(HealthMeter meter, IGameplayContainer container)
 {
     this.Meter = meter;
     this.container = container;
 }
Esempio n. 22
0
 public override void Stop(IGameplayContainer container)
 {
     _vars.Clear();
 }
Esempio n. 23
0
 public HandlerMeter(HealthMeter meter, IGameplayContainer container)
 {
     this.Meter     = meter;
     this.container = container;
 }
 public override void Start(IGameplayContainer container)
 {
     container.GameCleanup += Update;
 }
Esempio n. 25
0
 public override void Stop(IGameplayContainer container)
 {
     StateFrames = 0;
     Lifetime = 0;
     container.GameThink -= Update;
 }
Esempio n. 26
0
 public void Push(IGameplayContainer handler)
 {
     _handlerStack.Push(handler);
 }
Esempio n. 27
0
 public override void Start(IGameplayContainer container)
 {
     Reset();
     container.GameCleanup             += Update;
     Engine.Instance.GameInputReceived += Instance_GameInputReceived;
 }
Esempio n. 28
0
 public abstract void Stop(IGameplayContainer container);
Esempio n. 29
0
 public override void Stop(IGameplayContainer container)
 {
     container.GameAct -= ClearTouch;
     container.GameReact -= Update;
     container.Draw -= Instance_GameRender;
     Enabled = false;
     ClearTouch();
     enabledBoxes.Clear();
 }
Esempio n. 30
0
 public override void Start(IGameplayContainer container)
 {
     currentState = "Start";
     stateChanged = false;
     StateFrames = 0;
     Lifetime = 0;
     container.GameThink += Update;
     if (states.ContainsKey(currentState)) states[currentState].Initialize(Parent);
 }
Esempio n. 31
0
 public override void Start(IGameplayContainer container)
 {
     container.GameThink += Update;
 }
 public void Push(IGameplayContainer handler)
 {
     _handlerStack.Push(handler);
 }
Esempio n. 33
0
 public override void Stop(IGameplayContainer container)
 {
     Reset();
     container.GameCleanup -= Update;
     Engine.Instance.GameInputReceived -= Instance_GameInputReceived;
 }
Esempio n. 34
0
 public override void Start(IGameplayContainer container)
 {
 }
Esempio n. 35
0
 public override void Start(IGameplayContainer container)
 {
     container.GameThink += Update;
     container.Draw      += Instance_GameRender;
 }
Esempio n. 36
0
 public override void Start(IGameplayContainer container)
 {
     Timers.Clear();
     container.GameThink += Update;
 }
Esempio n. 37
0
 public override void Start(IGameplayContainer container)
 {
     Enabled = true;
     container.GameAct += ClearTouch;
     container.GameReact += Update;
     container.Draw += Instance_GameRender;
 }
Esempio n. 38
0
 public override void Stop(IGameplayContainer container)
 {
     _vars.Clear();
 }
 public override void Start(IGameplayContainer container)
 {
     container.GameThink += Update;
 }
Esempio n. 40
0
        public override void Start(IGameplayContainer container)
        {
            if (Direction == Direction.Unknown)
            {
                Direction = Direction.Right;
            }

            container.GameAct += Update;

            pushX = pushY = 0;
            dragX = dragY = resistX = resistY = 1;

            if (Parent.Screen != null && position != null)
            {
                overTile = Parent.Screen.TileAt(position.Position.X, position.Position.Y);
            }
        }
Esempio n. 41
0
 public override void Start(IGameplayContainer container)
 {
 }
Esempio n. 42
0
 public override void Stop(IGameplayContainer container)
 {
     Timers.Clear();
     container.GameThink -= Update;
 }
Esempio n. 43
0
 public override void Stop(IGameplayContainer container)
 {
     foreach (string sound in sounds) Engine.Instance.SoundSystem.StopSfxIfLooping(sound);
 }
Esempio n. 44
0
 public override void Stop(IGameplayContainer container)
 {
     container.GameThink -= Update;
     container.GameCleanup -= Instance_GameCleanup;
     if (meter != null)
     {
         meter.Stop();
     }
     Hit = false;
     flashing = 0;
 }
Esempio n. 45
0
        public void Start(IGameplayContainer container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            this.container = container;

            if (this.binding != null)
            {
                this.binding.Start(container.Entities);
            }

            container.Draw += GameRender;
            running = true;
        }
Esempio n. 46
0
 public override void Stop(IGameplayContainer container)
 {
     StateFrames          = 0;
     Lifetime             = 0;
     container.GameThink -= Update;
 }
Esempio n. 47
0
 public abstract void Stop(IGameplayContainer container);
Esempio n. 48
0
 public override void Stop(IGameplayContainer container)
 {
     container.GameThink -= Update;
     container.Draw      -= Instance_GameRender;
 }
 public override void Stop(IGameplayContainer container)
 {
     container.GameAct -= Update;
 }
Esempio n. 50
0
 public override void Stop(IGameplayContainer container)
 {
     timers.Clear();
     container.GameThink -= Update;
 }
Esempio n. 51
0
 public override void Start(IGameplayContainer container)
 {
     timers.Clear();
     container.GameThink += Update;
 }