Exemplo n.º 1
0
        public Player(MyGame _main) : base(_main)
        {
            main      = _main;
            GameInput = main.Services.GetService(typeof(GameInput)) as GameInput;
            collision = main.Services.GetService(typeof(Collision)) as Collision;
            collision.list.Add(this);
            //change this into vector 2 later
            screenLimitX = (int)main.GraphicsDevice.Viewport.TitleSafeArea.Width;
            screenLimitY = (int)main.GraphicsDevice.Viewport.TitleSafeArea.Height;
            tag          = "player";
            lives        = 3;
            health       = 1;
            ammoText     = "full";
            ammoNumber   = 0;
            this.texture = sprite.player;
            originalPos  = new Vector2(main.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, main.GraphicsDevice.Viewport.TitleSafeArea.Height - 64);
            Vector2 playerPosition = originalPos;

            position      = playerPosition;
            currentWeapon = sprite.icon_bullet;
        }
Exemplo n.º 2
0
 public void SendInput(GameInput input)
 {
     Task.Run(() => RunSimulation(input));
 }