Beispiel #1
0
        public GTA2Game(string mapName, string styleName)
        {
            map = new Map.Map(mapName, styleName);
            map.CalcCoord();

            _physics = new WorldSimulation(map);

            sprites = new Sprites();
            GameObject.spriteAtlas = sprites;
            pedList = new List<Pedestrian>();
            Pedestrian ped = new Pedestrian(new Vector3(65, 178, 5));
            pedList.Add(ped);
            _physics.AddPed(ped);

            debugDraw = false;
        }
Beispiel #2
0
        /// <summary>
        /// Add a new pedestrian to the simulation.
        /// </summary>
        /// <param name="ped">The pedestrian to add.</param>
        public void AddPed(Pedestrian ped)
        {
            RigidBody body = ped.Body;
            world.AddBody(body);

            PedestrianController controller = new PedestrianController(world, body);
            world.AddConstraint(controller);
            ped.Controller = controller;
        }