Ejemplo n.º 1
0
 public CollisionBox(Player player)
 {
     this.player = null;
     type = CollisionBoxType.Attackbox;
     color = Color.White;
     rectangle = new Rectangle(0, 0, 0, 0);
     damage = 0;
     knockBack = 0;
 }
Ejemplo n.º 2
0
        public override void Init(Viewport viewport)
        {
            base.Init(viewport);
            _world = new World();
            _world.Register(new Rectangle(-600, 680, 2400, 100));
            _world.Register(new Rectangle(-700, 0, 200, 720));
            _world.Register(new Rectangle(1700, 0, 200, 720));
            _inputManager = new InputManager();

            _debug = false;

            _player = new Player("Ryu.xml", _game.Content.Load<Texture2D>("PlayerTemp"), new Vector2(300, 500), _world, PlayerIndex.One);
            _player2 = new Player("Ryu.xml", _game.Content.Load<Texture2D>("PlayerTemp"), new Vector2(800, 500), _world, PlayerIndex.Two);
            //_player3 = new Player("Ryu.xml",_game.Content.Load<Texture2D>("PlayerTemp"), new Vector2(500, 100), _world, PlayerIndex.Three);
            _barLeft = Resource<Texture2D>.Get("BarLeft");
            _barRight = Resource<Texture2D>.Get("BarRight");
            _bar = Resource<Texture2D>.Get("Bar");
            _camera = new Camera(viewport, new Vector2(640, 360));
            _camera.Zoom = 1f;
            _kb = Keyboard.GetState();
            _bg1 = Resource<Texture2D>.Get("BG1");
            _bg2 = Resource<Texture2D>.Get("BG2");
            _rightCollisionIndex = -1;
            _leftCollisionIndex = -1;
        }