The dispersionless Kadomtsev–Petviashvili (dKP) equation is one of the simplest nonlinear wave equations describing two-dimensional shocks. To solve the dKP equation numerically we use a coordinate transformation inspired by the method of characteristics for the one-dimensional Hopf equation . We show numerically that the solutions to the transformed equation stays regular for longer times than the solution of the dKP equation. This permits us to extend the dKP solution as the graph of a multivalued function beyond the critical time when the gradients blow up. This overturned solution is multivalued in a lip shape region in the (x, y) plane, where the solution of the dKP equation exists in a weak sense only, and a shock front develops. A local expansion reveals the universal scaling structure of the shock, which after a suitable change of coordinates corresponds to a generic cusp catastrophe. We provide a heuristic derivation of the shock front position near the critical point for the solution of the dKP equation, and study the solution of the dKP equation when a small amount of dissipation is added. Using multiple-scale analysis, we show that in the limit of small dissipation and near the critical point of the dKP solution, the solution of the dissipative dKP equation converges to a Pearcey integral. We test and illustrate our results by detailed comparisons with numerical simulations of both the regularized equation, the dKP equation, and the asymptotic description given in terms of the Pearcey integral.