public Tile(int _x, int _y, TileType _tileType, Graphic _tileGraphic)
 {
     width = WIDTH;
     height = HEIGHT;
     x = _x;
     y = _y;
     tileType = _tileType;
     tileGraphic = _tileGraphic;
     rect = new Rectangle (new Point ((int)x, (int)y), new Size (Tile.WIDTH, Tile.HEIGHT));
     system = null;
 }
 public Player(float _x, float _y)
 {
     colour = Color.Blue;
     falling = true;
     MOVE_SPEED = 200;
     FALL_SPEED = 4;
     FALL_CAP = (MOVE_SPEED + MOVE_SPEED / 100 * 50) / FALL_SPEED;
     x = _x;
     y = _y;
     gun = new Gun (GunType.HandGun, this);
     width = WIDTH;
     height = HEIGHT;
     graphic = new Graphic (colour, WIDTH, HEIGHT);
 }
 public Bullet(float _x, float _y, GunType type, int _xDir, int _yDir=0)
 {
     x = _x;
     y = _y;
     xDir = _xDir;
     yDir = _yDir;
     if (type == GunType.HandGun) {
         speed = 300;
         hitPoints = 10;
         hitPointSpeed = -0.7f;
         width = 5;
         height = 2;
         graphic = new Graphic (Color.Black, width, height);
     }
 }
        public Particle(Graphic _graphic, int _alpha, int _alphaStep, float _x, float _xStep, float _y, float _yStep, 
			int _xStop, int _yStop)
        {
            xTravelled = yTravelled = 0;
            graphic = _graphic;
            width = graphic.width;
            height = graphic.height;
            alpha = _alpha;
            alphaStep = _alphaStep;
            x = _x;
            y = _y;
            xStep = _xStep;
            yStep = _yStep;
            xStop = _xStop;
            yStop = _yStop;
        }
 public EditorGrid()
 {
     sfcGrid = new Surface (new Size (Constants.Constants.MAP_WIDTH + Constants.Constants.MAP_WIDTH *
         Tile.WIDTH, Constants.Constants.MAP_HEIGHT + Constants.Constants.MAP_HEIGHT * Tile.HEIGHT));
     sfcGrid.Fill (Color.Transparent);
     Graphic vertical = new Graphic (Color.Black, 1, Tile.HEIGHT * Constants.Constants.MAP_HEIGHT
         + Constants.Constants.MAP_HEIGHT * 2);
     Graphic horizont = new Graphic (Color.Black, Tile.WIDTH * Constants.Constants.MAP_WIDTH +
         Constants.Constants.MAP_WIDTH * 2, 1);
     for (int x=0; x < Constants.Constants.MAP_WIDTH; x++) {
         vertical.Draw (sfcGrid, x * 2 + x * Tile.WIDTH, 0, 255, true);
     }
     for (int y=0; y < Constants.Constants.MAP_HEIGHT; y++) {
         horizont.Draw (sfcGrid, 0, y * 2 + y * Tile.HEIGHT, 255, true);
     }
 }
 public EffectDie(Color colour, KillableSprite kS)
 {
     xDirRange = new Vector (new PointF (-1.0f, 2.0f));
     yDirRange = new Vector (new PointF (-1.0f, -1.0f));
     xSpeedRange = new Vector (new Point (150, 200));
     ySpeedRange = new Vector (new Point (150, 200));
     numberRange = new Vector (new Point (100, 200));
     xStopRange = new Vector (new Point ((int)(kS.width*1.1), kS.width*2));
     yStopRange = new Vector (new Point ((int)(kS.height*1.1), kS.height*2));//(Tile.HEIGHT - 5, Tile.HEIGHT-2));
     newParticlesNumberRange = new Vector (new Point (0, 0));
     newParticlesTimeRange = new Vector (new PointF (0, 0));
     alpha = 255;
     alphaStep = -200;
     repeat = false;
     graphics = new Graphic[]{new Graphic(colour, WIDTH, HEIGHT), new Graphic(Color.Red, WIDTH, HEIGHT)};
     Vector blank = new Vector (0);
     template = new ParticleOptions (blank, blank, xDirRange, yDirRange, xSpeedRange, ySpeedRange, numberRange,
         xStopRange,yStopRange, newParticlesTimeRange, newParticlesNumberRange, alpha, alphaStep, repeat, graphics);
 }
 public EffectFire()
 {
     xDirRange = new Vector (new PointF (-0.5f, 0.5f));
     yDirRange = new Vector (new Point (-1, -1));
     xSpeedRange = new Vector (new Point (0, 0));
     ySpeedRange = new Vector (new Point (100, 600));
     numberRange = new Vector (new Point (8, 10));
     xStopRange = new Vector (new Point (Tile.WIDTH, Tile.WIDTH));
     yStopRange = new Vector (new Point (1, 20));//(Tile.HEIGHT - 5, Tile.HEIGHT-2));
     newParticlesNumberRange = new Vector (new Point (1, 6));
     newParticlesTimeRange = new Vector (new PointF (0.01f, 0.34f));
     alpha = 255;
     alphaStep = -200;
     repeat = true;
     graphics = new Graphic[]{new Graphic(Color.Orange, WIDTH, HEIGHT), new Graphic(Color.Red, WIDTH, HEIGHT),
         new Graphic(Color.Yellow, WIDTH,HEIGHT)};
     Vector blank = new Vector (0);
     template = new ParticleOptions (blank, blank, xDirRange, yDirRange, xSpeedRange, ySpeedRange, numberRange,
         xStopRange, yStopRange, newParticlesTimeRange, newParticlesNumberRange, alpha, alphaStep, repeat, graphics);
 }
        public ParticleOptions(Vector _xPosRange, Vector _yPosRange, Vector _xDirRange, Vector _yDirRange, Vector _xSpeedRange,
			Vector _ySpeedRange, Vector _numberRange, Vector _xStopRange, Vector _yStopRange, Vector _newParticlesTimeRange, 
			Vector _newParticlesNumberRange, int _alpha, int _alphaStep, bool _repeat, Graphic[] _graphics)
        {
            xPosRange = _xPosRange;
            yPosRange = _yPosRange;
            xDirRange = _xDirRange;
            yDirRange = _yDirRange;
            xSpeedRange = _xSpeedRange;
            ySpeedRange = _ySpeedRange;
            numberRange = _numberRange;
            xStopRange = _xStopRange;
            yStopRange = _yStopRange;
            newParticlesTimeRange = _newParticlesTimeRange;
            newParticlesNumberRange = _newParticlesNumberRange;
            alpha = _alpha;
            alphaStep = _alphaStep;
            repeat = _repeat;
            graphics = _graphics;
            graphicRange = new Vector (new Point (0, graphics.Length));
        }
 public void ChangeGun()
 {
     Surface sfc = new Surface (100, 100);
     if (gunType == GunType.HandGun) {
         width = (int)(width / 4);
         height = (int)(height / 10);
         sfc = new Surface (new Size (width, height));
         sfc.Fill (Color.White);
         sfc.Draw (new Box (new Point (0, 0), new Size (width, height)),
             Color.Black, true, true);
         fireInterval = 0.25f;
     } else if (gunType == GunType.NullGun) {
         width = height = 0;
         fireInterval = float.MaxValue;
     }
     sfc.Update ();
     graphic = new Graphic (sfc);
 }
 public void GenerateMenuBackground()
 {
     menuBackgroundBorder = new Graphic (Color.Black, menu.width - 2, Constants.Constants.HEIGHT - 700);
     menuBackground = new Graphic (Color.White, menu.width - 2, Constants.Constants.HEIGHT - 700 - 2);
 }