コード例 #1
0
 public Tom(Game game, TomAni tomani, Jerry jerry, SteeringBehaviors sb) : base(game)
 {
     this.jerry = jerry;
     jerry.Attach(this);
     this.tomani = tomani; //Instance of Tom Animation class
     this.sb     = sb;
 }
コード例 #2
0
        public Game1()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";



            sb = new SteeringBehaviors(this);
            this.Components.Add(sb);

            tomani = new TomAni(this);
            this.Components.Add(tomani);

            jerryani = new JerryAni(this);
            this.Components.Add(jerryani);



            cheese = new Cheese(this);
            this.Components.Add(cheese);

            score = new ScoreKeeper(this, cheese);
            this.Components.Add(score);

            hm = new HolesManager(this);
            this.Components.Add(hm);

            jerry = new Jerry(this, jerryani);
            this.Components.Add(jerry);

            tom = new Tom(this, tomani, jerry, sb);
            this.Components.Add(tom);

            collision = new Collision(this, tom, jerry, sb, cheese, hm, score);
            this.Components.Add(collision);

            jerryai = new JerryAI(this, sb, cheese, hm, jerry, collision, tom);
            this.Components.Add(jerryai);
        }