The Texas two-step is turning into a nightmare for NBA opponents. Twenty-year-old phenom Luka Doncic is taking the NBA by storm, and he has transformed the Dallas Mavericks into one of the better teams in the Western Conference.

James Harden is averaging 38 points per game for the Houston Rockets and he has Russell Westbrook riding shotgun in Mike D’Antoni’s up-tempo offense.

For the beat-up Kings, Sunday and Monday’s back-to-back against the Mavs and Rockets looked like a pair losses before they even hopped on the team bus. But that’s not the way it worked out.

Cory Joseph got away with a touch foul on Doncic in the final seconds and the Kings escaped Dallas with a 110-106 win. There was no time to celebrate. Sacramento boarded a flight for Houston to face Harden fewer than 24 hours later without even a shootaround to prepare for the league’s leading scorer.

In a stroke of genius, coach Luke Walton and his staff created a game plan and then used a roll of tape and the team’s hotel ballroom in Houston to walk through an idea.

“When you can’t get to a gym because you’re trying to get the guys more rest, we grabbed some tape, put a little key down on the floor and walked through sets that we need,” Walton told media following the 119-118 win over the Rockets.

Like the previous game against Doncic, Walton used Joseph, his best perimeter defender, on Harden and ran a box-and-one defense for much of the game. The plan worked to perfection.

Not only did Joseph help limit Harden to 8-of-19 shooting from the field and eight turnovers, but he also played defense without fouling.

Harden came into the night averaging 12.8 free throw makes on 14.8 attempts per game. If he continued at that pace, he would finish second all-time in free throw attempts per game.

Joseph didn’t bite on the up fakes or let Harden tangle him up when he sprawled out for 3-point attempts Monday. He didn’t reach and get his hand caught in the cookie jar and when he did make a play at the ball, he came away with two steals and just one personal foul in 38 minutes of action.

“It was a good win for us, back-to-back," Joseph said Monday. "It’s never easy, but we kept the mentality and we were strong. We turned it up mentality wise from the start to the finish of the game. We felt like these last two games, we competed at a high level and that’s what we’re going to need to do night in and night out to give ourselves a good chance.”

Sacramento paid Joseph handsomely in the offseason to back up De’Aaron Fox. An unlucky accident in practice has cost Fox major time, but Joseph has stepped in and kept the Kings afloat over the last 14 games as a starter.

Joseph isn’t the dynamic scorer that Fox is, but Walton has played to the strengths of his team without his starting point guard. He has taken the ball out of Joseph’s hands on most offensive possessions to save him for the defensive end and improve the flow.

Things will change when Fox returns, but like Nemanja Bjelica, Joseph has proven his worth to the team.

It should be noted that Joseph tweaked his lower back against the Portland Trail Blazers on Wednesday and was questionable against the San Antonio Spurs on Friday and the Mavs on Sunday.

“You go into what Cory did, we had him on Luka last night, we had him on Harden tonight,” Walton said. “Three days ago he couldn’t even walk, we didn’t even think he was going to play. As we talk about culture and what we’re trying to build, the example that he sets with that type of effort every single night is pretty good for our group.”

Over the last three games, he has fought through the injury and averaged nearly 35 minutes per game against some of the best scorers the league has to offer.

At 10-13, the Kings continue to stick around the .500 mark in the standings despite their slow start to the season. Joseph is a big reason why.

[RELATED: Watch Westbrook say game over, then Kings hit game-winner]

The Kings flew home after the win, and they’ll face another tough guard in Chris Paul on Wednesday night at Golden 1 Center.

There is a chance that Marvin Bagley will return to the court against the Oklahoma City Thunder after missing the last 22 games with a broken thumb. Fox stayed behind on the four-game road trip to rehab his ankle, and he is getting closer to a return as well.