示例#1
0
        public Snake(Keys[] keys, Color color, Game game, Player player)
        {
            // Params
            this.color = color;
            this.keys = keys;

            this.game = game;
            this.player = player;

            // Defaults
            this.speed = Game.snakeDefaultSpeed;
            this.turningSpeed = Game.snakeDefaultTurningSpeed;
            this.size = Game.snakeDefaultSize;

            this.isDrawing = true;
            this.inverse = 1;
            this.crashed = false;

            this.isNotDrowingUntil = DateTime.Now;

            // Pen
            RecreateTrailingPen();

            // Poweups
            powerups = new List<Powerup>();
            penGreen = new Pen(new SolidBrush(Color.PaleGreen), 4);
            penRed = new Pen(new SolidBrush(Color.PaleVioletRed), 4);
        }
示例#2
0
        public Player(Color color, Keys[] keys, Game game)
        {
            this.color = color;
            this.keys = keys;
            this.game = game;

            this.snake = createSnake();
        }
示例#3
0
 public Collisions(int x, int y, Game game)
 {
     this.game = game;
     field = new int[x, y];
     pointsHistory = new Dictionary<int, Dictionary<Point, int>>();
 }