public override void Execute(Tile p, Entity e)
        {
            if (IsActive)
            {
                // target is in parameters
                // Param1 = x
                // Param2 = y
                // Param3 = layer

                // does the platform already exists?
                Tile px = Game.I.level.GetPlatform(Param1.ToInt(), Param2.ToInt(), Param3.ToInt());


                if (px != null)
                {
                    //no so we can create it
                    //Tile ppp = Game.I.level.CreatePlatform(Param1.ToInt(), Param2.ToInt(), Param3.ToInt());

                    // add to level and sort
                    //Game.I.level.Platforms.Add(ppp);
                    //Game.I.level.Sort();
                }

                if (IsOneTimeAction)
                {
                    IsActive = false;
                }
            }
        }
示例#2
0
        public override void Execute(Tile p, Entity e)
        {
            if (IsActive)
            {
                // target is in parameters
                // Param1 = x
                // Param2 = y
                // Param3 = layer

                Tile px = Game.I.level.GetPlatform(Param1.ToInt(), Param2.ToInt(), Param3.ToInt());
                Game.I.level.RemovePlatform(px);

                if (IsOneTimeAction)
                {
                    IsActive = false;
                }
            }
        }
示例#3
0
        public override void Execute(Tile p, Entity e)
        {
            if (IsActive)
            {
                // target is in parameters
                // Param1 = x
                // Param2 = y
                // Param3 = layer

                e.position.X     = Param1.ToInt();
                e.position.Y     = Param2.ToInt();
                e.position.Layer = Param3.ToInt();

                if (IsOneTimeAction)
                {
                    IsActive = false;
                }
            }
        }
        public override void Execute(Tile p, Entity e)
        {
            if (IsActive)
            {
                // target is in parameters
                // Param1 = x
                // Param2 = y
                // Param3 = layer

                // does the platform already exists?
                Tile px = Game.I.level.GetPlatform(Param1.ToInt(), Param2.ToInt(), Param3.ToInt());

                if (px != null)
                {
                    new Action_CreatePlatform().Execute(p, e);
                }
                else
                {
                    new Action_DestroyPlatform().Execute(p, e);
                }
            }
        }