Beispiel #1
0
 public override void Start(IGameplayContainer container)
 {
     Enabled              = true;
     container.GameAct   += ClearTouch;
     container.GameReact += Update;
     container.Draw      += Instance_GameRender;
 }
 public override void Stop(IGameplayContainer container)
 {
     foreach (string sound in sounds)
     {
         Engine.Instance.SoundSystem.StopSfxIfLooping(sound);
     }
 }
Beispiel #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);
            }
        }
 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);
     }
 }
Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #11
0
        public void Start(IGameplayContainer container)
        {
            this.container = container;

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

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

            Running = true;
        }
Beispiel #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;
            }
        }
        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;
            }
        }
Beispiel #16
0
        public override void Start(IGameplayContainer container)
        {
            container.GameThink += Update;
            container.GameCleanup += Instance_GameCleanup;
            Health = StartHealth;

            if (meter != null)
            {
                meter.Start(container);
            }
        }
Beispiel #17
0
 public override void Stop(IGameplayContainer container)
 {
     container.GameAct -= Update;
 }
Beispiel #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;
 }
Beispiel #20
0
 public override void Start(IGameplayContainer container)
 {
     Reset();
     container.GameThink += Update;
     Engine.Instance.GameInputReceived += Instance_GameInputReceived;
 }
 public HandlerMeter(HealthMeter meter, IGameplayContainer container)
 {
     this.Meter = meter;
     this.container = container;
 }
Beispiel #22
0
 public override void Stop(IGameplayContainer container)
 {
     _vars.Clear();
 }
 public HandlerMeter(HealthMeter meter, IGameplayContainer container)
 {
     this.Meter     = meter;
     this.container = container;
 }
 public override void Start(IGameplayContainer container)
 {
     container.GameCleanup += Update;
 }
 public override void Stop(IGameplayContainer container)
 {
     StateFrames = 0;
     Lifetime = 0;
     container.GameThink -= Update;
 }
Beispiel #26
0
 public void Push(IGameplayContainer handler)
 {
     _handlerStack.Push(handler);
 }
 public override void Start(IGameplayContainer container)
 {
     Reset();
     container.GameCleanup             += Update;
     Engine.Instance.GameInputReceived += Instance_GameInputReceived;
 }
Beispiel #28
0
 public abstract void Stop(IGameplayContainer container);
Beispiel #29
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 Start(IGameplayContainer container)
 {
     currentState = "Start";
     stateChanged = false;
     StateFrames = 0;
     Lifetime = 0;
     container.GameThink += Update;
     if (states.ContainsKey(currentState)) states[currentState].Initialize(Parent);
 }
 public override void Start(IGameplayContainer container)
 {
     container.GameThink += Update;
 }
 public void Push(IGameplayContainer handler)
 {
     _handlerStack.Push(handler);
 }
 public override void Stop(IGameplayContainer container)
 {
     Reset();
     container.GameCleanup -= Update;
     Engine.Instance.GameInputReceived -= Instance_GameInputReceived;
 }
 public override void Start(IGameplayContainer container)
 {
 }
 public override void Start(IGameplayContainer container)
 {
     container.GameThink += Update;
     container.Draw      += Instance_GameRender;
 }
 public override void Start(IGameplayContainer container)
 {
     Timers.Clear();
     container.GameThink += Update;
 }
Beispiel #37
0
 public override void Start(IGameplayContainer container)
 {
     Enabled = true;
     container.GameAct += ClearTouch;
     container.GameReact += Update;
     container.Draw += Instance_GameRender;
 }
Beispiel #38
0
 public override void Stop(IGameplayContainer container)
 {
     _vars.Clear();
 }
 public override void Start(IGameplayContainer container)
 {
     container.GameThink += Update;
 }
Beispiel #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);
            }
        }
Beispiel #41
0
 public override void Start(IGameplayContainer container)
 {
 }
 public override void Stop(IGameplayContainer container)
 {
     Timers.Clear();
     container.GameThink -= Update;
 }
Beispiel #43
0
 public override void Stop(IGameplayContainer container)
 {
     foreach (string sound in sounds) Engine.Instance.SoundSystem.StopSfxIfLooping(sound);
 }
Beispiel #44
0
 public override void Stop(IGameplayContainer container)
 {
     container.GameThink -= Update;
     container.GameCleanup -= Instance_GameCleanup;
     if (meter != null)
     {
         meter.Stop();
     }
     Hit = false;
     flashing = 0;
 }
Beispiel #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;
        }
 public override void Stop(IGameplayContainer container)
 {
     StateFrames          = 0;
     Lifetime             = 0;
     container.GameThink -= Update;
 }
Beispiel #47
0
 public abstract void Stop(IGameplayContainer container);
 public override void Stop(IGameplayContainer container)
 {
     container.GameThink -= Update;
     container.Draw      -= Instance_GameRender;
 }
 public override void Stop(IGameplayContainer container)
 {
     container.GameAct -= Update;
 }
 public override void Stop(IGameplayContainer container)
 {
     timers.Clear();
     container.GameThink -= Update;
 }
Beispiel #51
0
 public override void Start(IGameplayContainer container)
 {
     timers.Clear();
     container.GameThink += Update;
 }