Ejemplo n.º 1
0
    public void SetUp(MazeController mazeController, SnakeConfig config, int numSegments)
    {
        base.SetUp(mazeController);

        this.Visible = false;
        this.Dead    = false;

        this.trail            = new SnakeTrail();
        this.sinusoidalMotion = new SinusoidalMotion(this.trail);

        if (config.Player)
        {
            this.Side = Side.Player;
        }

        this.config        = config;
        this.initialLength = numSegments;
        for (int i = 0; i < numSegments; ++i)
        {
            AddSegment();
        }

        if (config.Player)
        {
            this.Controller = new PlayerSnakeController(this, mazeController);
        }
        else
        {
            this.Controller = new AISnakeController(this, mazeController);
        }
    }
Ejemplo n.º 2
0
 public SinusoidalMotion(SnakeTrail trail)
 {
     // to handle curves, we want access to all the trail data.
     this.trail = trail;
 }