コード例 #1
0
ファイル: Engine.cs プロジェクト: hatrox/frogger
        public void AddObject(GameObject obj)
        {
            if (obj is Vehicle)
            {
                Vehicle tempVehicle = obj as Vehicle;
                for (int i = 0; i < tempVehicle.Length; i++)
                {
                    this.allObjects.Add(new Vehicle(new Coordinates(tempVehicle.TopLeft.Row, tempVehicle.TopLeft.Col + i), tempVehicle.Speed));
                }
            }
            else if (obj is Frog)
            {
                playerFrog = obj as Frog;
                this.frogStartingPosition = playerFrog.TopLeft;
            }

            this.allObjects.Add(obj);
        }
コード例 #2
0
ファイル: MovingObject.cs プロジェクト: hatrox/frogger
 public MovingObject(Coordinates topLeft, int speed, char[] body)
     : base(topLeft, body)
 {
     this.Speed = speed;
 }