8000 GitHub - doctordragon666/Sokoban: 推箱子实现
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 17, 2024. It is now read-only.

doctordragon666/Sokoban

Repository files navigation

Sokoban

It's a game of pushing boxes, a program developed based on Visual Studio and EasyX. All the code is process-oriented. 中文文档点击这里

Running

Download the project files, then click on the.sln solution file and click "Run".

Here are several running screenshots:

  1. Initialization interface

Start interface

  1. Running process

You can move by pressing WASD and quit by pressing Q.

Running interface

  1. Ending animation

End interface

After the game ends, the program will close automatically.

Principle Explanation

Flowchart

flowchart TB
	subgraph graph_initmap
	a("Loading images") --> b("Initializing the window size") --> c("Setting the background image") --> d("Rendering the map blocks") --> e("Setting the counter board")
	end
	subgraph graph_gamecontrol
	m{Getting Keyboard Messages} -->|WASD| mt("Moving Task") -->|Continue to Get| m
	m ===>|Q| qtg("Quit the Game")
	end
	graph_initmap --- graph_gamecontrol --- ctm("Clearing the Map")
Loading

Explanation of Key Algorithms

The key here is the algorithm for the moving task. A simple simulation is adopted. First, determine the direction, calculate the coordinates of the current task, and then update the textures of several points on the map according to the changes in the coordinates.

License

This project has no license.

About

推箱子实现

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published
0