“java实现推箱子游戏”

0 下载量 66 浏览量 更新于2023-11-23 收藏 2.15MB DOC 举报
me. It is characterized by simple operation and easy to get started. The gameplay of the Sokoban game is very simple - controlling the character to bypass obstacles and reach the destination. This experiment is based on the Java language. The game map is designed as a universal level design, and the level is set in a text file. The game core module randomly generates images using numbers and images binding, and uses random functions and array swapping algorithms to achieve the initialization of game images, effectively solving the problem of image layout. It fully utilizes the storage characteristics of the stack to implement the undo function. Iteration is used to calculate the movement of the little person and the box, one to calculate whether the person can reach a certain grid, and the other to calculate whether the box can reach an adjacent grid. The soothing music and interesting steps believe can arouse the interest of many people. As a game with a long history, it can also evoke people's nostalgia and resonance. Keywords: pressure; game; java; multi-function.