The Prim's algorithm, extracted from the graph theory, is easily adaptable for generating random mazes in the game development process. This study provides the theoretical framework of the algorithm, its adaptation to generate two-dimensional arrays of values, coding in Java and use of libraries provided by this programming language. It restricts the creation of the arrays to a minimum size of 11x11 to ensure that generates coherent sizes mazes and its application is for generating orthogonal called labyrinths (2D view). Finally, the measurement is made of the performance of the proposed encoding and concludes that in all tests, the average response time is less than a tenth of a second to generate maps of labyrinths.El algoritmo de Prim, e...