public void SetTargetPosition(CommandParams param) { int layer = param.GetNumber(); int x = param.GetNumber(); int y = param.GetNumber(); TargetObject = new ObjectPosition(layer, x, y); }
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)); }
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); }
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)); }
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); }
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)"); } }