Esempio n. 1
0
        public void SetTargetPosition(CommandParams param)
        {
            int layer = param.GetNumber();
            int x     = param.GetNumber();
            int y     = param.GetNumber();

            TargetObject = new ObjectPosition(layer, x, y);
        }
Esempio n. 2
0
        public void InitMapRenderer(CommandParams param)
        {
            int x    = param.GetNumber();
            int y    = param.GetNumber();
            int cols = param.GetNumber();
            int rows = param.GetNumber();

            MapRenderer = new MapRenderer(Map, Window.Display, new Rectangle(x, y, cols, rows));
        }
Esempio n. 3
0
        public void MoveObjectTo(CommandParams param)
        {
            AssertTargetPosition();

            int            layer       = param.GetNumber();
            int            x           = param.GetNumber();
            int            y           = param.GetNumber();
            ObjectPosition newPosition = new ObjectPosition(layer, x, y);

            Map.MoveObject(TargetObject, newPosition);
        }
Esempio n. 4
0
        public void AddObjectAnimation(CommandParams param)
        {
            AssertTargetPosition();

            int tileIx  = param.GetNumber();
            int tileFgc = param.GetNumber();
            int tileBgc = param.GetNumber();

            GameObject o = Map.GetObject(TargetObject);

            o.Animation.AddFrame(new Tile(tileIx, tileFgc, tileBgc));
        }
Esempio n. 5
0
        public void MoveObjectByDistance(CommandParams param)
        {
            AssertTargetPosition();

            int            distLayer   = param.GetNumber();
            int            distX       = param.GetNumber();
            int            distY       = param.GetNumber();
            ObjectPosition newPosition = new ObjectPosition(TargetObject);

            newPosition.MoveDistance(distX, distY);
            newPosition.AtLayer(newPosition.Layer + distLayer);

            Map.MoveObject(TargetObject, newPosition);
        }
Esempio n. 6
0
        public void InitWindow(CommandParams param)
        {
            if (param.Count != 5)
            {
                throw new PTMException("Invalid parameter count");
            }

            try
            {
                string title  = param.GetString();
                int    width  = param.GetNumber();
                int    height = param.GetNumber();
                int    cols   = param.GetNumber();
                int    rows   = param.GetNumber();

                Window      = new GameWindow(this, "", cols, rows);
                Window.Size = new Size(width, height);
                Window.Text = title;
            }
            catch (Exception ex)
            {
                throw new PTMException("Invalid parameter(s)");
            }
        }