Example #1
0
        public Tank(float x, float y, string path) : base(x, y)
        {
            _tank    = new Sprite(path);
            _tankBox = new AABB(40, 40);
            _turret  = new TankTurret(0, 0);

            AddChild(_tank);
            AddChild(_tankBox);
            AddChild(_turret);
        }
Example #2
0
        public TankBody(int x, int y, string path) : base(x, y)
        {
            _texture   = new Sprite(path);
            tankBarrel = new TankTurret(0, 0, "barrelBlue.png");
            _hitbox    = new AABB(_texture.Width, _texture.Height);
            AddChild(_texture);
            AddChild(_hitbox);
            AddChild(tankBarrel);

            OnDraw += PositionFinder;
        }
Example #3
0
        public TankBody(int x, int y, string path) : base(x, y)
        {
            _texture = new Sprite(path);
            _hitbox  = new AABB(_texture.Width, _texture.Height);
            _turret  = new TankTurret("barrelBlue.png");

            AddChild(_texture);
            AddChild(_hitbox);
            AddChild(_turret);
            //Rotate(-50);
            OnUpdate += TurnLeft;
            OnUpdate += TurnRight;
            OnUpdate += MoveForward;
            OnUpdate += MoveBackward;
        }