예제 #1
0
 void Start()
 {
     _colManager = FindObjectOfType <CollisionManager>();
     _cBox       = gameObject.GetComponent <CollisionBox>();
     _colManager.AddEntity(0, _cBox);
     _vida = gameObject.GetComponent <Vida>();
     _GM   = FindObjectOfType <GameManager>();
 }
예제 #2
0
 void Start()
 {
     _GM         = FindObjectOfType <GameManager>();
     _colManager = FindObjectOfType <CollisionManager>();
     _cBox       = gameObject.GetComponent <CollisionBox>();
     _colManager.AddEntity(1, _cBox);
     _timer = 0;
     _fired = false;
     _posXi = gameObject.transform.position.x;
     _posYi = gameObject.transform.position.y;
 }
예제 #3
0
 void Start()
 {
     _collisionBox = gameObject.GetComponent <CollisionBox>();
     _colManager   = FindObjectOfType <CollisionManager>();
     _colManager.AddEntity(1, _collisionBox);
 }
예제 #4
0
        /// <summary>
        /// Load graphics content for the screen.
        /// </summary>
        public override void LoadContent()
        {
            spriteBatch  = new SpriteBatch(m_core.GraphicsDevice);
            m_player     = new Player();
            m_floor      = new Floor();
            m_enemy      = new Enemy();
            m_car        = new Car();
            m_tree       = new Tree();
            m_building1  = new Building();
            m_building2  = new Building();
            m_building3  = new Building();
            m_building4  = new Building();
            m_building5  = new Building();
            m_building6  = new Building();
            m_building7  = new Building();
            m_building8  = new Building();
            m_building9  = new Building();
            m_building10 = new Building();
            m_building11 = new Building();
            m_building12 = new Building();

            coll_manager = new CollisionManager();

            m_block = new RoadBlock();

            GameCore.Camera.Player = m_player;

            font           = m_core.Content.Load <SpriteFont>("gamefont");
            m_player.Model = m_core.Content.Load <Model>("player/soldier2");
            m_floor.Model  = m_core.Content.Load <Model>("other/model2");
            m_enemy.Model  = m_core.Content.Load <Model>("player/zombie");

            m_car.Model   = m_core.Content.Load <Model>("other/skoda");
            m_tree.Model  = m_core.Content.Load <Model>("other/strom");
            m_block.Model = m_core.Content.Load <Model>("other/zataras");

            m_building1.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_a");
            m_building2.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_a");
            m_building3.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_a");
            m_building4.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_a");
            m_building5.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_b");
            m_building6.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_c");
            m_building7.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_c");
            m_building8.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_c");
            m_building9.Model  = m_core.Content.Load <Model>("other/budova_skola/blok_vchod_a");
            m_building10.Model = m_core.Content.Load <Model>("other/budova_skola/blok_vchod_b");
            m_building11.Model = m_core.Content.Load <Model>("other/budova_skola/blok_vchod_a");
            m_building12.Model = m_core.Content.Load <Model>("other/budova_skola/blok_podstava");


            m_car.Position = new Vector3(0, -6, -20);
            m_car.setBoundingBox();
            coll_manager.AddEntity(m_car);

            m_block.Position = new Vector3(20, -6, -20);
            m_block.setBoundingBox();
            coll_manager.AddEntity(m_block);

            m_tree.Position = new Vector3(20, 5, 0);
            m_tree.setBoundingBox();
            coll_manager.AddEntity(m_tree);

            m_building1.Position  = new Vector3(130, 4, 90);
            m_building2.Position  = new Vector3(-30, 4, 90);
            m_building3.Position  = new Vector3(-190, 4, 90);
            m_building4.Position  = new Vector3(290, 4, 90);
            m_building5.Position  = new Vector3(-200, 4, 100);
            m_building6.Position  = new Vector3(-130, 4, 140);
            m_building7.Position  = new Vector3(30, 4, 140);
            m_building8.Position  = new Vector3(190, 4, 140);
            m_building9.Position  = new Vector3(-130, 4, 80);
            m_building10.Position = new Vector3(30, 4, 80);
            m_building11.Position = new Vector3(190, 4, 80);
            m_building12.Position = new Vector3(250, -5, 30);

            m_building1.setBoundingBox();
            m_building2.setBoundingBox();
            m_building3.setBoundingBox();
            m_building4.setBoundingBox();
            m_building5.setBoundingBox();
            m_building6.setBoundingBox();
            m_building7.setBoundingBox();
            m_building8.setBoundingBox();
            m_building9.setBoundingBox();
            m_building10.setBoundingBox();
            m_building11.setBoundingBox();

            coll_manager.AddEntity(m_building1);
            coll_manager.AddEntity(m_building2);
            coll_manager.AddEntity(m_building3);
            coll_manager.AddEntity(m_building4);
            coll_manager.AddEntity(m_building5);
            coll_manager.AddEntity(m_building6);
            coll_manager.AddEntity(m_building7);
            coll_manager.AddEntity(m_building8);
            coll_manager.AddEntity(m_building9);
            coll_manager.AddEntity(m_building10);

            m_player.Manager = coll_manager;
        }